MPI_Comm_spawn has to build an intercommunicator with the child process that it spawns. Thus, you can not spawn a non-MPI job such as /bin/hostname, since the parent process waits for some messages from the child process(es) in order to set up the intercommunicator.

Thanks
Edgar

Prakash Velayutham wrote:
Hello,

Open MPI 1.2.4

I am trying to run a simple C program.

######################################################################################

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "mpi.h"

void
main(int argc, char **argv)
{

         int             tag = 0;
         int             my_rank;
         int             num_proc;
         char            message_0[] = "hello slave, i'm your master";
         char            message_1[50];
         char            master_data[] = "slaves to work";
         int             array_of_errcodes[10];
         int             num;
         MPI_Status      status;
         MPI_Comm        inter_comm;
         MPI_Info        info;
         int             arr[1];
         int             rc1;

         MPI_Init(&argc, &argv);
         MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
         MPI_Comm_size(MPI_COMM_WORLD, &num_proc);

         printf("MASTER : spawning a slave ... \n");
rc1 = MPI_Comm_spawn("/bin/hostname", MPI_ARGV_NULL, 1, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &inter_comm, arr);

         MPI_Finalize();
         exit(0);
}

######################################################################################


This program hangs as below:

prakash@bmi-xeon1-01:~/thesis/CS/Samples> ./master1
MASTER : spawning a slave ...
bmi-xeon1-01

Any ideas  why?

Thanks,
Prakash
_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

--
Edgar Gabriel
Assistant Professor
Parallel Software Technologies Lab      http://pstl.cs.uh.edu
Department of Computer Science          University of Houston
Philip G. Hoffman Hall, Room 524        Houston, TX-77204, USA
Tel: +1 (713) 743-3857                  Fax: +1 (713) 743-3335

Reply via email to