This is a known limitation of the sm btl.

FWIW, the vader btl (available in Open MPI 1.8) has the same limitation,
thought i heard there are some works in progress to get rid of this limitation.

Cheers,

Gilles

On 5/14/2015 3:52 PM, Radoslaw Martyniszyn wrote:
Dear developers of Open MPI,

I've created two applications: parent and child. Parent spawns children using MPI_Comm_spawn. I would like to use shared memory when they communicate. However, applications do not start when I try using sm. Please comment on that issue. If this feature is not supported, are there any plans to add support? Also, are there any examples showing MPI_Comm_spawn and shared memory?

I am using Open MPI 1.6.5 on Ubuntu. Both applications are run locally on the same host.

// Works fine
mpirun --mca btl self,tcp ./parent

// Application terminates
mpirun --mca btl self,sm ./parent

"At least one pair of MPI processes are unable to reach each other for
MPI communications.  This means that no Open MPI device has indicated
that it can be used to communicate between these processes. This is
an error; Open MPI requires that all MPI processes be able to reach
each other.  This error can sometimes be the result of forgetting to
specify the "self" BTL."

Below are code snippets:

parent.cc:
#include <string>
#include <unistd.h>

int main(int argc, char** argv) {
  MPI_Init(NULL, NULL);

  std::string lProgram = "./child";
  MPI_Comm lIntercomm;
  int lRv;
lRv = MPI_Comm_spawn( const_cast< char* >(lProgram.c_str()), MPI_ARGV_NULL, 3,
                       MPI_INFO_NULL, 0, MPI_COMM_WORLD, &lIntercomm,
                       MPI_ERRCODES_IGNORE);

  if ( MPI_SUCCESS == lRv) {
      std::cout << "SPAWN SUCCESS" << std::endl;
      sleep(10);
  }
  else {
      std::cout << "SPAWN ERROR " << lRv << std::endl;
  }

  MPI_Finalize();
}

child.cc:
#include <mpi.h>
#include <iostream>
#include <unistd.h>

int main(int argc, char** argv) {
  // Initialize the MPI environment
  MPI_Init(NULL, NULL);

  std::cout << "CHILD" << std::endl;
  sleep(10);

  MPI_Finalize();
}

makefile (note, there are tabs not spaces preceding each target):
EXECS=child parent
MPICC?=mpic++

all: ${EXECS}

child: child.cc
    ${MPICC} -o child child.cc

parent: parent.cc
    ${MPICC} -o parent parent.cc

clean:
    rm -f ${EXECS}


Greetings to all of you,
Radek Martyniszyn





_______________________________________________
users mailing list
us...@open-mpi.org
Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users
Link to this post: 
http://www.open-mpi.org/community/lists/users/2015/05/26865.php

Reply via email to