[hugin-ptx] Re: Hugin & parallelization

2010-06-06 Thread Pablo d'Angelo

Hi Markku,

Am 05.06.2010 13:40, schrieb markku.kol...@iki.fi:

On 5 kesä, 09:33, Lukáš Jirkovský  wrote:

OpenMP isn't supported in the Express edition of VisualC++, you need
at least the Professional version to use it:
http://msdn.microsoft.com/en-us/library/hs24szh9%28VS.100%29.aspx
This will cause problems for Windows users that want/need to compile
Hugin.


Not really, if OpenMP is not mandatory (Which should be easily 
possible). Users of the Express edition won't get parallel support 
though. As parallelizing with OpenMP is really so much easier than with 
explicit threads, I think the missing support in the free Microsoft 
compiler should not stop Linux or OSX users from using all their 
processor cores.


ciao
  Pablo

--
You received this message because you are subscribed to the Google Groups "hugin and 
other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


Re: [hugin-ptx] Re: Hugin & parallelization

2010-06-05 Thread Lukáš Jirkovský
On 5 June 2010 13:40, markku.kol...@iki.fi  wrote:
>
> OpenMP isn't supported in the Express edition of VisualC++, you need
> at least the Professional version to use it:
> http://msdn.microsoft.com/en-us/library/hs24szh9%28VS.100%29.aspx
> This will cause problems for Windows users that want/need to compile
> Hugin.
>
> --
>    Markku Kolkka
>    markku.kol...@iki.fi
>

I think this is a valid reason not to use OpenMP.

On 5 June 2010 14:24, Yuv  wrote:
> Hugin depends on Enblend which in turn depends on OpenMP, so you would
> not be adding an extra dependency.

But you don't have to compile enblend yourself. You can compile hugin
but use enblend binary downloaded somewhere else. Moreover as Harry
pointed out it's not enabled by default.

> Bottom line: the decision to use OpenMP or boost::thread should IMHO
> be driven purely by performance considerations and not by the free-
> ride consideration of MSVC Express vs. Professional.

I can do some tests but my guess that the speed difference will be
minimal. Computation demands certainly overweights possible overhead
in both OpenMP and boost:thread.


Thank you all for your opinions!

Lukas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


[hugin-ptx] Re: Hugin & parallelization

2010-06-05 Thread Andreas Metzler
Harry van der Wolf  wrote:
> 2010/6/5 Yuv 
>> On Jun 5, 2:33 am, Lukáš Jirkovský  wrote:
>> > Thank you. I'm still considering the boost::thread. If it is not too
>> > complicated to use boost thread I'll use it because OpenMP adds
>> > another dependency. But certainly it's good to know that it's OK to
>> > stick with OpenMP.

>> Hugin depends on Enblend which in turn depends on OpenMP, so you would
>> not be adding an extra dependency.

> Not completely true. OpenMP is by default off. You need to add the compiler
> flag to compile enblend/enfuse with OpenMP support.
> Therefore hugin should also get an extra compiler flag to enable OpenMP or
> not (default).

enblend/enfuse is a special case. OpenMP conflicts with
--enable-image-cache. Enabling OpenMP is a win on multiprocessor
systems with (relative to the amount of RAM) non-huge panoramas. If
hugin's OpenMP capabilitly does not have this or a similar downside
there will be no reason for not enabling it by default. imho.

cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


Re: [hugin-ptx] Re: Hugin & parallelization

2010-06-05 Thread Harry van der Wolf
Hi all,

2010/6/5 Yuv 

> On Jun 5, 2:33 am, Lukáš Jirkovský  wrote:
> > Thank you. I'm still considering the boost::thread. If it is not too
> > complicated to use boost thread I'll use it because OpenMP adds
> > another dependency. But certainly it's good to know that it's OK to
> > stick with OpenMP.
>
> Hugin depends on Enblend which in turn depends on OpenMP, so you would
> not be adding an extra dependency.
>
>
Not completely true. OpenMP is by default off. You need to add the compiler
flag to compile enblend/enfuse with OpenMP support.
Therefore hugin should also get an extra compiler flag to enable OpenMP or
not (default).



>
> On Jun 5, 7:40 am, "markku.kol...@iki.fi" 
> wrote:
> > OpenMP isn't supported in the Express edition of VisualC++, you need
> > at least the Professional version to use it:
> http://msdn.microsoft.com/en-us/library/hs24szh9%28VS.100%29.aspx
> > This will cause problems for Windows users that want/need to compile
> > Hugin.
>
> IIRC there were some workarounds posted on the web. If Windows users
> really want/need to compile Hugin for their platform, they can afford
> to spend money on a Microsoft compiler license like they do on a
> Microsoft operating system license.
>
> Bottom line: the decision to use OpenMP or boost::thread should IMHO
> be driven purely by performance considerations and not by the free-
> ride consideration of MSVC Express vs. Professional.
>
> Yuv
>
>
Like mentioned above: Hugin should get an extra compiler flag to enable
OpenMP or not (default).

Despite my reservations here to make OpenMP default for Hugin, I would
really like to see more parallellization in Hugin. Please continue on this
path.

Hoi,
Harry

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

[hugin-ptx] Re: Hugin & parallelization

2010-06-05 Thread Yuv
On Jun 5, 2:33 am, Lukáš Jirkovský  wrote:
> Thank you. I'm still considering the boost::thread. If it is not too
> complicated to use boost thread I'll use it because OpenMP adds
> another dependency. But certainly it's good to know that it's OK to
> stick with OpenMP.

Hugin depends on Enblend which in turn depends on OpenMP, so you would
not be adding an extra dependency.


On Jun 5, 7:40 am, "markku.kol...@iki.fi" 
wrote:
> OpenMP isn't supported in the Express edition of VisualC++, you need
> at least the Professional version to use 
> it:http://msdn.microsoft.com/en-us/library/hs24szh9%28VS.100%29.aspx
> This will cause problems for Windows users that want/need to compile
> Hugin.

IIRC there were some workarounds posted on the web. If Windows users
really want/need to compile Hugin for their platform, they can afford
to spend money on a Microsoft compiler license like they do on a
Microsoft operating system license.

Bottom line: the decision to use OpenMP or boost::thread should IMHO
be driven purely by performance considerations and not by the free-
ride consideration of MSVC Express vs. Professional.

Yuv

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


[hugin-ptx] Re: Hugin & parallelization

2010-06-05 Thread markku.kol...@iki.fi
On 5 kesä, 09:33, Lukáš Jirkovský  wrote:
> Thank you. I'm still considering the boost::thread. If it is not too
> complicated to use boost thread I'll use it because OpenMP adds
> another dependency. But certainly it's good to know that it's OK to
> stick with OpenMP.

OpenMP isn't supported in the Express edition of VisualC++, you need
at least the Professional version to use it:
http://msdn.microsoft.com/en-us/library/hs24szh9%28VS.100%29.aspx
This will cause problems for Windows users that want/need to compile
Hugin.

--
Markku Kolkka
markku.kol...@iki.fi

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


Re: [hugin-ptx] Re: Hugin & parallelization

2010-06-04 Thread Lukáš Jirkovský
On 4 June 2010 23:00, Pablo d'Angelo  wrote:
> Am 04.06.2010 15:42, schrieb Lukáš Jirkovský:
>>
>> Hello,
>> today I decided to improve the performance of deghosting in hugin.
>> First try using SSE didn't work really well [1].
>
> Did you check that your data was properly aligned for use with SSE?

Yep, I did. I used #pragma pack(16) for it.

My guess is that the slowdown may be caused by some caching or maybe
the data array is stored using general registers first and then moved
to the XMM, I remember that I read the move from general registers to
the XMM registers is quite expensive. Other possibility is that the
slowdown is caused by the fact the data are aligned and takes more
space than usually and caching becomes less effective.

>
>> Second one using
>>
>> OpenMP show noticeable increase of performance, because the code can
>> be parallelized quite easily (the only thing needed is to add two
>> pragma's) and efficiently (it runs four times faster on my Core i7).
>>
>> I can see that the most of the threaded code in Hugin uses
>> boost::thread but I remember that the thread class from wxWidgets was
>> also mentioned. What should I use? Personally I'd like to avoid
>> wxWidgets threads because both deghosting_mask and hugin_hdrmerge are
>> console applications.
>
> If OpenMP works fine for you, go ahead and use it. When I parallized the
> remapping with boost::thread, OpenMP was not properly supported by gcc, but
> this has changed since then. If you need generic thread support use
> boost::thread, except if it tied to the wxWidgets UI, where wxThreads might
> be more suitable for some tasks.
>
> ciao
>  Pablo
>

Thank you. I'm still considering the boost::thread. If it is not too
complicated to use boost thread I'll use it because OpenMP adds
another dependency. But certainly it's good to know that it's OK to
stick with OpenMP.

Lukas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx


[hugin-ptx] Re: Hugin & parallelization

2010-06-04 Thread Pablo d'Angelo

Am 04.06.2010 15:42, schrieb Lukáš Jirkovský:

Hello,
today I decided to improve the performance of deghosting in hugin.
First try using SSE didn't work really well [1].


Did you check that your data was properly aligned for use with SSE?

> Second one using

OpenMP show noticeable increase of performance, because the code can
be parallelized quite easily (the only thing needed is to add two
pragma's) and efficiently (it runs four times faster on my Core i7).

I can see that the most of the threaded code in Hugin uses
boost::thread but I remember that the thread class from wxWidgets was
also mentioned. What should I use? Personally I'd like to avoid
wxWidgets threads because both deghosting_mask and hugin_hdrmerge are
console applications.


If OpenMP works fine for you, go ahead and use it. When I parallized the 
remapping with boost::thread, OpenMP was not properly supported by gcc, 
but this has changed since then. If you need generic thread support use 
boost::thread, except if it tied to the wxWidgets UI, where wxThreads 
might be more suitable for some tasks.


ciao
 Pablo

--
You received this message because you are subscribed to the Google Groups "hugin and 
other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx