Parallel execution of functions with side effects

Perhaps the below 3 links may help, all mentioned /qparallel a little bit.

I think /qparallel is more or less a compiler flag, a lot of compiler engineers’ work is devoted in this flag. It is aiming at intelligently and automatically parallelize some loops for you, but in reality not always work very well. I believe if you can use openMP, that will be more efficient than /qparallel. After all, you know your code better than the compiler :slight_smile:
If I remember correctly, you may enable the /qparallel and also the optimziation report to level 5, then in visual studio (with Intel OneAPI), you will see how much speedup it gains for each loops.

In addition, if I remember correctly, if you use /qparallel on a, say, 10 core machine, and if you use call cpu_time() to do timing, that time will be the real wall time multiply by 10. So if your code finished in 1 second, call cpu_time will show you 10 seconds.

1 Like