[mpich-discuss] Running one MPI program from another

Jayesh Krishna jayesh at mcs.anl.gov
Wed Apr 22 09:40:27 CDT 2009


Hi,
 Did you try MPI_Comm_spawn() ?
 
Regards,
Jayesh

  _____  

From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Rod Cook
Sent: Wednesday, April 22, 2009 7:50 AM
To: mpich-discuss at mcs.anl.gov
Subject: [mpich-discuss] Running one MPI program from another


Hi,
 
I am trying to run an MPI program (prog) from another MPI program (test)
using CreateProcess under Windows XP.  I am using MPICH2 v1.08. 
 
Source for test
#include "stdafx.h"
#include <afx.h>
#include "mpi.h"
int run_program( char * program )
{
   STARTUPINFO si;
   PROCESS_INFORMATION pi;
   ZeroMemory( &si, sizeof(si) );
   si.cb = sizeof(si);
   ZeroMemory( &pi, sizeof(pi) );
   if( !CreateProcess( NULL, program, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi )  ) 
   {
      return -1;
   }
   WaitForSingleObject( pi.hProcess, INFINITE );
   CloseHandle( pi.hProcess );
   CloseHandle( pi.hThread );
   return 0;
}
int main(int argc, char* argv[])
{
   MPI_Init(NULL,NULL);
   run_program("prog");
   MPI_Finalize();
 return 0;
}

Source for prog
#include "stdafx.h"
#include "mpi.h"
int main(int argc, char* argv[])
{
   MPI_Init( NULL, NULL );
   MPI_Finalize();
   return 0;
}

I get the following error when I run test:
 
>mpiexec -n 1 test
MPIDU_Sock_post_connect failed.
[0] PMI_ConnectToHost failed: unable to post a connect to Yellowtail
yellowtail
                 :2057, error: Unknown error class, error stack:
MPIDU_Sock_post_connect(1228): unable to connect to Yellowtail yellowtail 
 on port 2057, exhausted all endpoints (errno -1)
MPIDU_Sock_post_connect(1275): unable to connect to                  on
port 2057,
 No connection could be made because the target machine actively refused
it. (er
rno 10061)
MPIDU_Sock_post_connect(1275): unable to connect to yellowtail on port
2057, No
connection could be made because the target machine actively refused it.
(errno
10061)
MPIDU_Sock_post_connect(1275): unable to connect to Yellowtail on port
2057, No
connection could be made because the target machine actively refused it.
(errno
10061)
uPMI_ConnectToHost returning PMI_FAIL
[0] PMI_Init failed.
Fatal error in MPI_Init: Other MPI error, error stack:
MPIR_Init_thread(294): Initialization failed
MPID_Init(83)........: channel initialization failed
MPID_Init(334).......: PMI_Init returned -1
>
 
In my actual application prog is either a standalone MPI program which I
can't change or a non MPI program (in which case test works) . 
 
 
I'd be gratefull for any help.
 
 
Thanks
 
Rod Cook
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20090422/5e48468e/attachment.htm>


More information about the mpich-discuss mailing list