Parallel Image Processing in OpenMP - Splitting Image

General OpenMP discussion
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
Drazick
Posts: 2
Joined: Sat Mar 28, 2015 11:24 am

Parallel Image Processing in OpenMP - Splitting Image

Post by Drazick »

Hello,
I'm doing my first steps in the OpenMP world.

I have an image I want to apply a filter on.
Since the image is large I wanted to break it into non overlapping parts and apply the filter on each independently in parallel.
Namely, I'm creating 4 images I want to have different threads.

I'm using Intel IPP for the handling of the images and the function to apply on each sub image.

I described the code here:

http://stackoverflow.com/questions/2931 ... ting-image

The problem is I tried both sections and parallel for and got only 20% improvement.

What am I doing wrong?
How can I tell each "Worker" that though data is taken from the same array, it is safe to read (Data won't change) and write (Each worker has exclusive approach to its part of the result image).

Thank You.

MarkB
Posts: 808
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Parallel Image Processing in OpenMP - Splitting Image

Post by MarkB »

A few questions to try and help me figure out what's going on here:

What are you using to time the code?
Are you measuring the time for the whole code or just the parallel region?
What was the sequential time you measured?

Drazick
Posts: 2
Joined: Sat Mar 28, 2015 11:24 am

Re: Parallel Image Processing in OpenMP - Splitting Image

Post by Drazick »

Hi,

I'm using Visual Studio 2013 as IDE.
I'm using Intel ICC as compiler.

To time it, I use the clock function.

MarkB
Posts: 808
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Parallel Image Processing in OpenMP - Splitting Image

Post by MarkB »

clock() measures CPU time accumulated across all threads, which is probably not what you want.
Try using omp_get_wtime() which measures wall-clock time.

Vishal97
Posts: 1
Joined: Mon Jun 08, 2020 2:04 am

Re: Parallel Image Processing in OpenMP - Splitting Image

Post by Vishal97 »

Thank you for your help. I'm looking for something like that... :)

Locked