There are no OpenMP constructs in the code shown, so compiling with or without -fopenmp should not affect it. But if there was a [parallel] for construct, then it fails, because the ceil() type is double , and OpenMP allows only integer types in loops.
You must force the result from ceil() to an integer:
#pragma omp parallel for for(int iter = 0; iter < (int)ceil((double)n/size); iter++) { random(M,a,c,seq,1,1); }
source share