- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to maintain same source code for normal execution and with MPI. Is there any compile or runtime variable that I can use it to identify whether its MPI or not?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Will the preprocessor directives, like #ifdef, do what you want? See the Fortran Developer Guide and Reference. Although those are for compile time...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Though I primarily look for runtime identification, compile time identification with preprocessor directive could work as well.
From the above reference, I don't see any option which can identify whether MPI is invoked or not during the compilation. Could you please be specific in how you think it can be done for MPI vs non-MPI compilation?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page