From 2b900d8a3cd172e349ea0750b4506b516edf179c Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Tue, 5 Jan 2016 15:29:27 +0100 Subject: [PATCH] MPI fixes. Flag -DHAVE_MPI2 is now detected properly.There was an issue when MPI_C_INCLUDE_PATH contained several paths. You can now use MPI containers on your local machine, with protocol "sh". --- salome_adm/cmake_files/FindSalomeMPI.cmake | 3 ++- src/Container/Component_i.cxx | 2 ++ src/Container/SALOME_ContainerManager.cxx | 10 ++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/salome_adm/cmake_files/FindSalomeMPI.cmake b/salome_adm/cmake_files/FindSalomeMPI.cmake index 9eee1cf0b..d9e6ec1c5 100644 --- a/salome_adm/cmake_files/FindSalomeMPI.cmake +++ b/salome_adm/cmake_files/FindSalomeMPI.cmake @@ -35,7 +35,8 @@ IF(MPI_FOUND) # otherwise take ours. include(CheckSymbolExists) SET(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBRARIES}) - CHECK_SYMBOL_EXISTS(MPI_Publish_name ${MPI_C_INCLUDE_PATH}/mpi.h MPI2_IS_OK) + SET(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH}) + CHECK_SYMBOL_EXISTS(MPI_Publish_name mpi.h MPI2_IS_OK) SET(MPI_DEFINITIONS "${MPI_CXX_COMPILE_FLAGS}") IF(MPI2_IS_OK) MESSAGE(STATUS "Your mpi implementation is compatible with mpi2 ... adding -DHAVE_MPI2") diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 5cd709ace..d45bd4ed8 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -167,7 +167,9 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, setContainerName(); const CORBA::String_var ior = _orb->object_to_string(_container); if(regist) + { _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str()); + } if(notif) _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif); diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 36b5df43e..98f03802a 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -390,7 +390,8 @@ Engines::Container_ptr SALOME_ContainerManager::GiveContainer(const Engines::Con return ret; } // A mpi parallel container register on zero node in NS - containerNameInNS = _NS->BuildContainerNameForNS(params, GetMPIZeroNode(hostname,machFile).c_str()); + std::string mpiZeroNode = GetMPIZeroNode(resource_selected,machFile).c_str(); + containerNameInNS = _NS->BuildContainerNameForNS(params, mpiZeroNode.c_str()); } else containerNameInNS = _NS->BuildContainerNameForNS(params, hostname.c_str()); @@ -1194,12 +1195,17 @@ std::string SALOME_ContainerManager::GetMPIZeroNode(const std::string machine, c std::string zeronode; std::string command; std::string tmpFile = BuildTemporaryFileName(); + const ParserResourcesType resInfo(_resManager->GetResourceDefinition(machine)); + + if(resInfo.Protocol == sh) + { + return resInfo.HostName; + } if( GetenvThreadSafe("LIBBATCH_NODEFILE") == NULL ) { if (_isAppliSalomeDefined) { - const ParserResourcesType resInfo(_resManager->GetResourceDefinition(machine)); if (resInfo.Protocol == rsh) command = "rsh "; -- 2.39.2