Salome HOME
add method NameChanged to update title name
[modules/kernel.git] / src / MPIContainer / MPIObject_i.cxx
index 94bba7b48614be5b5759e9e8b12b4b2c6a132897..fb75ad1509eff57a83cbff906d64c9ae90394391 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -139,6 +139,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service)
   int i;
   char port_name[MPI_MAX_PORT_NAME];
   char port_name_clt[MPI_MAX_PORT_NAME];
+  MPI_Info info;
   std::ostringstream msg;
 
   if( service.size() == 0 )
@@ -158,6 +159,8 @@ void MPIObject_i::remoteMPI2Connect(std::string service)
   MPI_Barrier(MPI_COMM_WORLD);
 
   MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+  MPI_Info_create(&info);
+  MPI_Info_set(info, "ompi_unique", "true");
   if( _numproc == 0 )
     { 
       /* rank 0 try to be a server. If service is already published, try to be a cient */
@@ -167,7 +170,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service)
           MESSAGE("[" << _numproc << "] I get the connection with " << service << " at " << port_name_clt << std::endl);
           MPI_Close_port( port_name );
         }
-      else if ( MPI_Publish_name((char*)service.c_str(), MPI_INFO_NULL, port_name) == MPI_SUCCESS )
+      else if ( MPI_Publish_name((char*)service.c_str(), info, port_name) == MPI_SUCCESS )
         {
           _srv[service] = true;
           _port_name[service] = port_name;