[MPICH] Crash While Spawning Process

Jason Surratt jsurratt at spadac.com
Mon Oct 17 08:27:34 CDT 2005


Hello,

I am new to MPI, but I am very happy with the initial success I've had 
parallelizing my application with MPICH2.

The problem I'm having is when I spawn a process with the MPI_Comm_spawn 
function. To keep things simple I have modified the icpi.c example to 
include the following code snippet after line 35:

...
  MPI_Comm parentComm;
  MPI_Comm_get_parent(&parentComm);
  printf("Parent com: %X\n", parentComm);

  if (myid == 0 && parentComm == MPI_COMM_NULL)
  {
    int universeSize, *universeSizep;
    int flag;
    MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &universeSizep, 
&flag);
    if (!flag)
    {
      printf("Error: This MPI Implementation doesn't support universe 
size.\n"); fflush(stdout);
      universeSize = 2;
    }
    else
    {
      universeSize = *universeSizep;
    }

    int result;
    MPI_Comm everyone;

    printf("Spawning...\n"); fflush(stdout);

    printf("%s\n", argv[0]); fflush(stdout);
    result = MPI_Comm_spawn(argv[0], MPI_ARGV_NULL, universeSize,
      MPI_INFO_NULL, 0, MPI_COMM_SELF, &everyone, MPI_ERRCODES_IGNORE); 

    printf("Spawned.\n"); fflush(stdout);

    MPI_Finalize();
    return 0;
  }
...

I then launch this application with:
mpiexec -exitcodes -n 1 \\jsurratt-laptop\simple_mpi\simple_mpi

My intent is to launch universeSize processes without requiring the user 
to type the size at the command line.

If I run this code with my local machine as the only host the universe 
size is not returned (flag == 0), but the application spawns two 
processes and runs fine.

If I add another similarly configured machine to my host list the 
universe size is not returned (flag == 0) and I get the standard Windows 
crash prompt 'Process launcher for MPICH2 applications has encountered a 
problem and needs to close.  We are sorry for the inconvenience.' when 
the MPI_Comm_spawn function is called.

I'm hoping that I'm just doing something silly, but if need be I can 
bring it up in the debugger and post more information.

I'm using the following configuration on all machines:
Windows XP SP2
MPICH2 v1.0.2-1 (ia32)

Running the unmodified version of icpi.c with multiple hosts works fine.

Thanks in advance,

-Jason





More information about the mpich-discuss mailing list