- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to parallelize a code that is already written and contains close to 102 subroutines in the function I am trying to parallelize. In the process I saw that there were many global variables that each subroutine access and this is not good for parallel programming.
I have two questions:
1 - Under such scenarios, what is the best way to fix this? Do I make the variables an array so that it can be a function of the thread? Its quite tideous though and I am looking for some good work around
2 - Is there any way I can detect global variables that my thread is trying to access without reverse engineering the code a lot ?
- Ajay
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Making arrays is a possible solution, but it would be better if the data can be made local with private effect.
A possible way to work up toward OpenMP is to turn on /Qparallel and the associated diagnostics then replace parallels with OpenMP incrementally where it shows promise.
Intel Inspector was originally intended to facilitate finding read/write conflicts among threads even when omp parallel is applied without full analysis of conflicts. You might try it on 30 day trial to see if it looks helpful in the current form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think when you are starting, Intel Advisor XE is the more appropriate tool. Intel Inspector XE is powerful, but better suited to debugging after you've done the basic initial work. See http://software.intel.com/en-us/videos/avoid-common-fortran-parallelization-mistakes-with-the-help-of-intel-advisor-xe
The important distinction is between those variables that can be shared between threads, and those for which each thread needs a private copy (whether they are global or local). In the routine with the OpenMP constructs, you can use PRIVATE and SHARED clauses. If you need private copies of global variables, you can use a threadprivate directive for a common block or for module variables. If you're not already familiar with this, I suggest you read an introduction or tutorial for OpenMP. For a subroutine without OpenMP directives that might be called from within a parallel region, local variables including arrays will be placed on the stack to make them threadsafe if you compile with /Qopenmp (and don't use SAVE statements, /Qsave, or data statements that imply SAVE). /Qopenmp effectively sets /Qauto.
Another reference for Fortran tips for OpenMP is http://software.intel.com/en-us/articles/threading-fortran-applications-for-parallel-performance-on-multi-core-systems/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I am trying to use these tools for my project now. However after I have installed the tool the build is consistently failing with the error:
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
This happened after I have installed the intel inspector and advisor tools. Any idea why this should happen?
- Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nevermind, for some reason I had to add the library location to additional dependencies and it worked fine.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page