Hi Damien,

Sorry for late reply, I was trying to dig inside the code and got some information.

First of all, in your example, it's not correct to define the MPI_Info as an pointer, it will cause the initialization violation at run time. The message "LOCAL DAEMON SPAWN IS CURRENTLY UNSUPPORTED" is just a warning which won't block the execution. In order to make the master-slave work, you have to disable the CCP support, it seems to have conflicts with comm_spawn operation, I'm still checking it.

To disable CCP in Open MPI 1.4.1, you have to exclude the source files manually, i.e. excluding ccp files in orte/mca/plm/ccp and orte/mca/ras/ccp, then also remove the ccp related lines in orte/mca/plm/base/static-components.h and orte/mca/ras/base/static-components.h. There is an option to do so in the trunk version, but not for 1.4.1. Sorry for the inconvenience.

For the "singleton" run with master.exe, it's still not working under Windows.


Best Regards,
Shiqing


Damien Hocking wrote:
Hi all,

I'm playing around with MPI_Comm_spawn, trying to do something simple with a master-slave example. I get a LOCAL DAEMON SPAWN IS CURRENTLY UNSUPPORTED error when it tries to spawn the slave. This is on Windows, OpenMPI version 1.4.1, r22421.

Here's the master code:

int main(int argc, char* argv[])
{
  int myid, ierr;
  MPI_Comm maincomm;
  ierr = MPI_Init(&argc, &argv);
  ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myid);
if (myid == 0)
  {
     std::cout << "\n Hello from the boss " << myid;
     std::cout.flush();
  }
MPI_Info* spawninfo;
  MPI_Info_create(spawninfo);
  MPI_Info_set(*spawninfo, "add-host", "127.0.0.1");
if (myid == 0)
  {
     std::cout << "\n About to MPI_Comm_spawn." << myid;
     std::cout.flush();
  }
MPI_Comm_spawn("slave.exe", MPI_ARGV_NULL, 1, *spawninfo, 0, MPI_COMM_SELF, &maincomm, MPI_ERRCODES_IGNORE);
  if (myid == 0)
  {
     std::cout << "\n MPI_Comm_spawn successful." << myid;
     std::cout.flush();
  }
  ierr = MPI_Finalize();
  return 0;
}

Here's the slave code:

int main(int argc, char* argv[])
{
  int myid, ierr;
MPI_Comm parent; ierr = MPI_Init(&argc, &argv);
  MPI_Comm_get_parent(&parent);
if (parent == MPI_COMM_NULL)
  {
     std::cout << "\n No parent.";
  }
  ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myid);
std::cout << "\n Hello from a worker " << myid; std::cout.flush(); ierr = MPI_Finalize(); return 0;
}

Also, this only starts up correctly if I kick it off with orterun. Ideally I'd like to run it as "master.exe" and have it initialise the MPI environment from there. Can anyone tell me what setup I need to do that?
Thanks in advance,

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



--
--------------------------------------------------------------
Shiqing Fan                          http://www.hlrs.de/people/fan
High Performance Computing           Tel.: +49 711 685 87234
 Center Stuttgart (HLRS)            Fax.: +49 711 685 65832
Address:Allmandring 30 email: f...@hlrs.de 70569 Stuttgart

Reply via email to