Alright, conv2d with threads or with 3D piddles will work well enough for my purposes, I think...
I was hoping that I could get convolveND to work with threads because convolveND is slightly faster than conv2d. However, after thinking about it some more, I think the extra time it takes conv2d to process images will be pretty insignificant compared to the time savings from doing many images in parallel. Thanks everyone for your help, Perldough 2012/10/26 David Mertens <[email protected]> > On Fri, Oct 26, 2012 at 2:38 PM, Grasswistle <[email protected]>wrote: > >> Chris, >> >> Thank you for your detailed reply. >> >> You mentioned that if I wanted to perfrom many 2D convolution operations >> in parallel it would suffice to spawn many Perl threads (using Perl's >> "threads") and to send each one off with a convolution task involving a >> different image. >> >> I believe the code posted in the original email did just this. Do you >> know why that implementation fails when I use convolveND to perform the >> convolutions? The same implementation does not fail if you comment out the >> convolveND part and use conv2d. >> > > I don't know, but I suspect that convolveND allocates some work space that > is not thread-specific. This could cause a segmentation fault, as I > suggested earlier, if multiple threads use the same global to point to a > common workspace. When the first thread exits it frees the workspace and > when the other threads---having presumably not yet finished---try to work > with that memory, they trip a segmentation fault. > > >> I'm going to see if I can put my images in a 3D piddle and implement the >> other solution you suggested, but I would still like to find out why I >> cannot make convolution using convolveND parallel... >> > > I think it would take some digging around the convolveND code to figure it > out. > > >> Thanks, >> Perldough >> > > You're welcome. Hope you manage to get the threading working with the 3D > piddle! > > David > > -- > "Debugging is twice as hard as writing the code in the first place. > Therefore, if you write the code as cleverly as possible, you are, > by definition, not smart enough to debug it." -- Brian Kernighan > >
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
