Hi, I am trying to parallelize a section of my code. The for loop calls an external function pvnorm which is in a wrapper for some FORTRAN code. Since most of the arguments are pointers/addresses, I declared and initialized all of them within the for loop.
The following example is a simplified version I have been trying to debug. Ideally it must produce the same output since all the arguments are constant but it returns different values over different iterations.
The code works well if I have the function in a critical region. Is there a reason why the code doesn't work. Any help would be greatly appreciated. Thanks!