title: Openmp rendering bmp images
body: <p>I am trying to generate some julia fractal images and I would like to use multiple cores for faster execution. But generated images are bad if I i use parallel for (they have lines of wrong color, are out of scale,...) and also, instead of 40 images, only about 20 are created. Generated images are fine if I delete line with #pragma</p>
  
  <pre><code>#pragma omp parallel for
      for (k = 0; k &lt; 40; k++) { //for loop that creates 40 images
          z.Im = scale;     //z and c are complex numbers
  
              imeDatoteke[7] = k / 10 + '0'; // file name
              imeDatoteke[8] = k % 10 + '0';
  
              c.Im += 0.005; // imaginary part increments every image  
  
              for (i = 0; i &lt; DIM - 1; i++) { //DIM is image dimension
  
                  z.Im -= 2 * scale / (DIM - 1);
                  z.Re = -scale;
  
                  for (j = 0; j &lt; DIM - 1; j++) {
  
                      z.Re += 2 * scale / (DIM - 1);
  
                      picture[i][j] = polinom(z, c); // a function that returns color between 0 and 255
                  }
              }
  
              saveBMP(picture, DIM, DIM, imeDatoteke); //save image arrays in bpm files
  
      } 
  </code></pre>