Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jinliang_w_
Beginner
120 Views

nested MPI application

Hi there,

I have a MPI application, say p1.exe, compiled with command,

mpiifort p1.f90 /Od /Qopenmp /link

The program receives a parameter from command line in runtime, p1.exe SRN:n. When n=1, the MPI is initiated by

CALL MPI_INIT(I)

CALL MPI_COMM_RANK(MPI_COMM_WORLD, ThreadID, I)

CALL MPI_COMM_SIZE(MPI_COMM_WORLD, NumThreads, I)

Otherwise,  MPI is NOT initiated and NOT used.

Now I have a 2nd MPI application which always initiates and uses MPI. The line of code in p2.f90 that calls p1.exe is

call system("p1.exe SRN:0")

However, this does not work. When I run p2.exe, I got the error messages

PMI_ConnectToHost failed: unable to post a connect to ...

MPIDU_Sock_post_connect(1200): unable to connect to...

It seems to me that MPI is still invoked in P1.exe and therefore there is a clash of MPI between P1 and P2. This is weird as no MPI is initiated at runtime when n is set to 0.

When P1.f90 is compiled without MPI (e.g. ifort p1.f90), then it works.

Any help?

0 Kudos
5 Replies
Michael_S
Employee
120 Views

Hello,

I am not sure if this scenario is covered by the MPI standard, therefore I will check this and get back to you.

In the meantime you might want to try linking the p1 application statically and see if you observe any different behaviour.

Best regards,

Michael

jinliang_w_
Beginner
120 Views

Thank you for the looking into this, Michael!

I have tried linking the P1 application statically, it still does not work (with the same error message).

Michael_S
Employee
120 Views

Hello,

It seems that the launch of another application via system commands are not supported, since the child- program won't see the MPI environment of the parent application. If you need to implement such functionality, please look into the dynamic process support of the MPI standard.

Best regards,

Michael

jinliang_w_
Beginner
120 Views

Thank you, Michael! That means I have to rewrite the code. 

Michael_S
Employee
120 Views

Unfortunately - yes

Reply