Openmp programming

 Calculate the occurrence of each pixel in the histogram of a grayscale image

Use OpenMP task to parallelize the histogram calculation.

You need to process each chuck using a OpenMP task.

Image array (read-only) can be shared among tasks.

The array that stores the histogram must be updated inside each task using OpenMP atomic construct (reference links below, more details in the discussion).  

HINT: You may need OpenMP (OMP) directives such as: omp task and omp taskwait.

HINT: You may also need OMP clauses such as: shared and firstprivate.

Your implementation will take three command line arguments (in this order): Grayscale PGM image, chunk size and histogram output filename.

Print histogram output into the output file where each line will represent the # of pixels for each intensity. Therefore, the output file MUST have 256 lines only.