ejd wrote:What compiler are you using? What do you mean when you say the "index of W goes to 1001"? Where in the code is this happening and why do you think it is wrong?
ejd wrote:There is no reason that adding an "implicit none" and "integer i,j" will help unless the variables "i,j" are declared in the module or the subroutines are "contained" withing the main program. If either of these are true, then the variables "i,j" would be shared. Otherwise, they should be private. In your example code, "i,j" are explicitly declared within serial, so they should be private there and variable "i" is declared within subroutine work, so it should be private. I am not sure what is going on from your example and question.
As to your last question, about the array causing a stack overflow, you need to check the documentation. There are two stacks you have to worry about. The stack of the master thread that executes the sequential part of the OpenMP program and the stack allocated for each OpenMP thread created by the master thread. For the Intel Fortran for Windows, the defaults are 2MB for the IA-32 architecture and 4MB for the IA-64 architecture. Take a look for information on the KMP_STACKSIZE environment variable.
Toey_Hylton wrote:Does this "4MB for the IA-64 architecture" mean I can only use 4M memory for each OpenMP thread?
In other words, how can I deal with the large arrays in subroutines in parallelization section ?
Users browsing this forum: No registered users and 3 guests