I am modifying some old, old Fortran code to run with OpenMP directives, and it makes heavy use of COMMON block. I have found multiple sources that say that using OMP directives to declare COMMON blocks as THREADPRIVATE solves the issue of COMMON blocks residing in global scope by giving each OpenMP thread its own copy. What I'm unsure of though, is whether the THREADPRIVATE directive needs to be after declaration in every single subroutine, or whether having it in the main (and only) PROGRAM is enough?
Do COMMON blocks in Fortran have to be declared threadprivate in every subroutine for OpenMP?
382 Views Asked by Frank At
1
There are 1 best solutions below
Related Questions in FORTRAN
- Looping over defined array elements in Fortran
- Is it safe to list optional fortran function argument in OpenMP shared clause?
- Equivalent to asm volatile in Gfortran?
- gfortran does not find symbol fabsq_ in libquadmath
- Assigning values of an array in a loop
- Data exchange - Python and Fortran
- ieee_arithmetic intrinsic module in gfortran
- How to initialize two distinct blacs contexts?
- Fortran Debugging
- need to get f2py working, but don't know any fortran
- Combine Fortran .for and .f90 include header files
- How to parallelize csh script with nested loop
- VS2013 integration with Intel Fortran Compiler
- Windows 8.1 Pro MinGW Gfortran Command Prompt 'not recognized command' error
- How does automatic typecasting (type conversion) work in Fortran?
Related Questions in OPENMP
- Is it safe to list optional fortran function argument in OpenMP shared clause?
- omp barriers are blocking
- OpenMP SIMD on Power8
- MPI+OpenMP job submission script on LSF
- Does OMP Pragmas nesting have significance?
- How to make DGEMM execute sequentially instead of in parallel in Matlab Mex Function
- Increased speed despite false sharing
- Simple speed up of C++ OpenMP kernel
- Performance issue of OpenMP code called from a pthread
- What preprocessor define does -fopenmp provide?
- OpenMP shared variable seems to be private
- Error with openmp for Nested for-loop
- Convert do/while into parallel do/while loop
- How to measure the load balancing in OpenMP of GCC
- Parallel for loop with reduction and manipulating arrays
Related Questions in FORTRAN-COMMON-BLOCK
- How to declare OpenMP private common block variables?
- Named common block in a shared library
- Pass a common variable to a subroutine in Fortran
- Gfortran COMMON block with array size
- Visibility, Fortran common variables, runtime loading of shared libraries
- Purpose of SAVE and COMMON together in Fortran
- Common Blocks in Fortran
- C-Fortran Mixed Programming
- Can I add a watch to a COMMON block?
- Passing 3d arrays using MPI_Bcast
- How to re-engineer Fortran and C++ mixed-language library from common blocks - global struct aliasing?
- Fortran COMMON block initialization
- Do COMMON blocks in Fortran have to be declared threadprivate in every subroutine for OpenMP?
- Is there a difference memory-wise between using Common Blocks and Modules in Fortran 90
- Char array dimensioning confusion in Fortran 77
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes, it must be at every occurrence. Quoting from the OpenMP 5.0 standard
As a comment putting OpenMP into a program full of global variables is likely to lead to a life of pain. I would at least give some thought to "do I want to start from here" before I begin such an endeavour - modernisation of the code before you add OpenMP might turn out to be an easier and cheaper option, especially in the long run.