Reputation: 1110
I have two programs Main and Aux, each of which uses MPI for parallel processing. I am keeping Main as the main code and modifying Aux as a subroutine which is being called by Main.
The problem arises when both codes initiate the MPI process and then each have their own parallel structure, which leads the code to crash.
Any suggestions on how to start fixing this?
PS: When connecting the two codes, I decided to call Aux by Main rather than running the Aux as executable by Main to have a more optimized and robust setting and also avoid the overhead.
PS2: Code Main is written in c++ and code Aux is written in Fortran.
Upvotes: 1
Views: 73
Reputation: 51
It’s hard to tell for certain without looking at the code, but I believe you want to use two different MPI communicators, one for each of the programs, see http://mpitutorial.com/tutorials/introduction-to-groups-and-communicators/
Upvotes: 1