How can I set the OMP_CANCELLATION environment variable to true? Within my code, I tried
!$ OMP_CANCELLATION = .TRUE.
but the compiler says OMP_CANCELLATION variable is not defined. Other OMP directives in my code aare recognized so I think I properly activated OpenMP compilation. I am using compiler version 184.108.40.206.
Environment variables are set in the command shell before you run the program. I don't know if a SETENV call (USE IFPORT to declare it) will be honored in this case.
I tried setting this variable by executing
set OMP_CANCELLATION = true
command from the command prompt in which I ran my program. It didn't work, I also tried setting it through the VS IDE through Debugging -> Environment, or by calling the SETENVQQ command from IFPORT. Non of them worked.
Any suggestions how I can set this variable to true?
I was putting together a simple program and SET command does work as well as setting the variable through the IDE Debugging-> Environment. I don't know what went wrong with my original program. SETENVQQ from IFPORT does not work though.
Is there any way to set the variable during run-time, though? I distribute my compiled executable to other parties and I would rather send them an .exe file instead of a batch file.
On another note, as I was testing my simple program I noticed that the program hangs at a simple WRITE command within the parallel region which is trying to write the loop index value to a file. I seem to remember that I used to be able to do this without any problem in the past. Is this the expected behavior or am I maybe doing something wrong? The code and the VS project file is attached.
Thanks for all your help,
As I suggested above, changing this value at run-time might not work. Most of these things are looked at when the program starts up and not again later.
Try changing option Code Generation > Generate Reentrant Code to Threaded. This controls how the run-time library protects itself against reentrant calls. In version 17 Threaded is the default, but in earlier versions it isn't.