Reputation: 13
I am working on Image Processing . I am having a computer with Intel(R) Core(TM) i7 -3770 CPU @3.40 GHz, RAM 4 GB Configuration. I just want parallelize our code of an algorithm of image processing using SPMD command of PCT. For this i have divided image vertically into 8 parts and send it different labs and by using SPMD command i executed algorithm of image processing parallely on different parts on different lab.
I got the right answer which i got from sequential code. But this is taking more time than a sequential code . I have tried this with very largest image to smallest image but didn't get the significant result.
Suggest me how can i get significant speed up using SPMD command?
Upvotes: 0
Views: 536
Reputation: 24127
If you want to apply the same operation to several blocks within an image, then rather than worry about constructs such as spmd
, you can just apply the command blockproc
and set the UseParallel
option to true
. It will parallelize everything for you, without you needing to do anything.
If that doesn't work for you and you really have a requirement to implement your algorithm directly using spmd
, you'll need to post some example code to indicate what you've tried, and where it's going wrong.
Upvotes: 0
Reputation: 1189
Since you did not provide any code I'll have to stick to a general answer. In all parallel computing there are several design considerations, the two most important are: is your code able to run in parallel, and secondly: how much communication overhead do you create.
Calling workers means sending information back and forth, so there is an optimum in parallel computing. Make sure you provide your workers with enough work so that the communication to and from your workers requires less time than the speed-up gained from parallel computing.
Last but not least: if you provide a working code example the community is able to help you much better!
Upvotes: 1