From b6e5e19c2eafc24f1549f4c0912bb3e1422cc642 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 10 Jun 2010 07:47:15 +0000 Subject: [PATCH] Merge from V5_1_main 10/06/2010 --- salome_adm/cmake_files/FindMPI.cmake | 121 ++++++++++++++++++ salome_adm/cmake_files/FindPLATFORM.cmake | 3 - salome_adm/cmake_files/Makefile.am | 1 + salome_adm/cmake_files/am2cmake.py | 82 +++++++++--- src/Container/SALOME_ContainerManager.cxx | 2 - src/Launcher/BatchTest.cxx | 13 ++ src/Launcher/Launcher.cxx | 5 + src/Launcher/Launcher_Job.cxx | 5 +- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 2 +- src/MPIContainer/MPIContainer_i.cxx | 25 ++-- src/MPIContainer/MPIContainer_i.hxx | 5 +- src/MPIContainer/MPIObject_i.cxx | 7 - src/MPIContainer/MPIObject_i.hxx | 1 - src/MPIContainer/SALOME_MPIContainer.cxx | 2 +- .../SALOME_ResourcesCatalog_Handler.cxx | 5 + .../SALOME_ResourcesCatalog_Parser.cxx | 2 + .../SALOME_ResourcesCatalog_Parser.hxx | 2 +- .../SALOME_ResourcesManager.cxx | 4 + .../SALOMEDSImpl_ScalarVariable.cxx | 29 ++++- .../SALOMEDSImpl_StudyBuilder.cxx | 6 + .../SALOMEDSImpl_StudyManager.cxx | 7 + .../TestMPIComponentEngine.cxx | 13 +- .../TestMPIComponentEngine.hxx | 3 +- 23 files changed, 277 insertions(+), 68 deletions(-) create mode 100644 salome_adm/cmake_files/FindMPI.cmake diff --git a/salome_adm/cmake_files/FindMPI.cmake b/salome_adm/cmake_files/FindMPI.cmake new file mode 100644 index 000000000..548b01b77 --- /dev/null +++ b/salome_adm/cmake_files/FindMPI.cmake @@ -0,0 +1,121 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# ------ +# +MESSAGE(STATUS "Check for MPI ...") + +# ------ + +SET(MPI_STATUS 1) + +IF(WITH_MPI) + SET(MPI_ROOT_USER ${WITH_MPI}) +ELSE(WITH_MPI) + SET(MPI_ROOT_USER $ENV{MPI_ROOT}) +ENDIF(WITH_MPI) + +IF(NOT MPI_ROOT_USER) + FIND_PROGRAM(MPICC mpicc) + IF(MPICC) + MESSAGE(STATUS "mpicc found: ${MPICC}") + SET(MPI_ROOT ${MPICC}) + GET_FILENAME_COMPONENT(MPI_ROOT ${MPI_ROOT} PATH) + GET_FILENAME_COMPONENT(MPI_ROOT ${MPI_ROOT} PATH) + IF(MPICC STREQUAL /usr/bin/mpicc) + ELSE(MPICC STREQUAL /usr/bin/mpicc) + SET(MPI_ROOT_USER ${MPI_ROOT}) + ENDIF(MPICC STREQUAL /usr/bin/mpicc) + ENDIF(MPICC) +ELSE(NOT MPI_ROOT_USER) + SET(MPI_ROOT ${MPI_ROOT_USER}) +ENDIF(NOT MPI_ROOT_USER) + +# ------ + +IF(NOT MPI_ROOT) + MESSAGE(STATUS "MPI not found, try to use WITH_MPI option or MPI_ROOT environment variable.") + SET(MPI_STATUS 0) +ENDIF(NOT MPI_ROOT) + +# ------ + +IF(MPI_STATUS) + MESSAGE(STATUS "Check MPI in ${MPI_ROOT}") + + SET(MPI_INCLUDE_TO_FIND mpi.h) + + IF(MPI_ROOT_USER) + SET(MPI_ROOT ${MPI_ROOT_USER}) + SET(MPI_INCLUDE_PATHS ${MPI_ROOT} ${MPI_ROOT}/include) + FIND_PATH(MPI_INCLUDES ${MPI_INCLUDE_TO_FIND} PATHS ${MPI_INCLUDE_PATHS} NO_DEFAULT_PATH) + IF(NOT MPI_INCLUDES) + MESSAGE(STATUS "MPI include ${MPI_INCLUDE_TO_FIND} not found in ${MPI_INCLUDE_PATHS}, check your MPI installation.") + SET(MPI_STATUS 0) + ENDIF(NOT MPI_INCLUDES) + ELSE(MPI_ROOT_USER) + FIND_PATH(MPI_INCLUDES ${MPI_INCLUDE_TO_FIND}) + IF(NOT MPI_INCLUDES) + MESSAGE(STATUS "MPI include ${MPI_INCLUDE_TO_FIND} not found on system, try to use WITH_MPI option or MPI_ROOT environment variable.") + SET(MPI_STATUS 0) + ENDIF(NOT MPI_INCLUDES) + GET_FILENAME_COMPONENT(MPI_ROOT ${MPI_INCLUDES} PATH) + ENDIF(MPI_ROOT_USER) + + MESSAGE(STATUS "MPI include ${MPI_INCLUDE_TO_FIND} found in ${MPI_INCLUDES}") + + SET(MPI_INCLUDES -I${MPI_INCLUDES}) + + # ------ + + IF(WINDOWS) + FIND_LIBRARY(MPI_LIB_THREAD libboost_thread-vc90-mt-gd-1_35 ${MPI_ROOT}/lib) + FIND_LIBRARY(MPI_LIB_DATE_TIME libboost_date_time-vc90-mt-gd-1_35 ${MPI_ROOT}/lib) + ELSE(WINDOWS) + FOREACH(lib mpi_cxx mpi mpich) + FIND_LIBRARY(MPI_LIB ${lib} ${MPI_ROOT}/lib) + IF(MPI_LIB) + IF(lib STREQUAL mpich) + SET(MPI_INCLUDES ${MPI_INCLUDES} -DMPICH_IGNORE_CXX_SEEK) + ENDIF(lib STREQUAL mpich) + ENDIF(MPI_LIB) + ENDFOREACH(lib mpi_cxx mpi mpich) + IF(NOT MPI_LIB) + MESSAGE(STATUS "MPI lib not found, check your MPI installation.") + SET(MPI_STATUS 0) + ENDIF(NOT MPI_LIB) + MESSAGE(STATUS "MPI lib : ${MPI_LIB}") + ENDIF(WINDOWS) + + SET(MPI_LIBS ${MPI_LIB}) + + MESSAGE(STATUS "MPI libs: ${MPI_LIBS}") +ENDIF(MPI_STATUS) + +# ------ + +IF(MPI_STATUS) + SET(MPI_IS_OK ON) +ELSE(MPI_STATUS) + IF(MPI_IS_MANDATORY) + MESSAGE(FATAL_ERROR "MPI not found but mandatory") + ELSE(MPI_IS_MANDATORY) + MESSAGE(STATUS "MPI not found. Build procedure depending of mpi will be disable") + ENDIF(MPI_IS_MANDATORY) +ENDIF(MPI_STATUS) diff --git a/salome_adm/cmake_files/FindPLATFORM.cmake b/salome_adm/cmake_files/FindPLATFORM.cmake index 7f39eede8..01f1e1512 100644 --- a/salome_adm/cmake_files/FindPLATFORM.cmake +++ b/salome_adm/cmake_files/FindPLATFORM.cmake @@ -1,8 +1,5 @@ # Copyright (C) 2007-2010 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 -# # 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 diff --git a/salome_adm/cmake_files/Makefile.am b/salome_adm/cmake_files/Makefile.am index e7852c175..2c2772d47 100644 --- a/salome_adm/cmake_files/Makefile.am +++ b/salome_adm/cmake_files/Makefile.am @@ -30,6 +30,7 @@ FindDOXYGEN.cmake \ FindHDF5.cmake \ FindKERNEL.cmake \ FindLIBXML2.cmake \ +FindMPI.cmake \ FindOMNIORB.cmake \ FindPLATFORM.cmake \ FindPTHREADS.cmake \ diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 63f1d3502..8e0774b15 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -1,9 +1,6 @@ # -*- coding: iso-8859-1 -*- # Copyright (C) 2007-2010 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 -# # 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 @@ -442,23 +439,48 @@ class CMakeFile(object): INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindSWIG.cmake) INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) + INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindMPI.cmake) """) pass else: - newlines.append(""" - SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR}) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake) - """) + if self.module == "med": + newlines.append(""" + SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR}) + IF(KERNEL_ROOT_DIR) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake) + ELSE(KERNEL_ROOT_DIR) + INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPLATFORM.cmake) + INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMPI.cmake) + ENDIF(KERNEL_ROOT_DIR) + """) + else: + newlines.append(""" + SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR}) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake) + INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake) + """) + pass if self.module == "gui": newlines.append(""" INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCAS.cmake) @@ -471,6 +493,7 @@ class CMakeFile(object): else: newlines.append(""" SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR}) + IF(GUI_ROOT_DIR) INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindCAS.cmake) INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQT4.cmake) INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindOPENGL.cmake) @@ -478,6 +501,7 @@ class CMakeFile(object): INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQWT.cmake) INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake) INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindGUI.cmake) + ENDIF(GUI_ROOT_DIR) """) if self.module == "med": newlines.append(""" @@ -592,7 +616,9 @@ class CMakeFile(object): pass elif self.module == "geom": newlines.append(""" + IF(GUI_ROOT_DIR) SET(GEOM_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "medfile": @@ -608,41 +634,57 @@ class CMakeFile(object): pass elif self.module == "med": newlines.append(""" + IF(KERNEL_ROOT_DIR) SET(MED_ENABLE_KERNEL ON) IF(NOT WINDOWS) SET(MED_ENABLE_SPLITTER ON) ENDIF(NOT WINDOWS) + ENDIF(KERNEL_ROOT_DIR) + IF(GUI_ROOT_DIR) SET(MED_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "smesh": newlines.append(""" + IF(GUI_ROOT_DIR) SET(SMESH_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "netgenplugin": newlines.append(""" + IF(GUI_ROOT_DIR) SET(NETGENPLUGIN_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "blsurfplugin": newlines.append(""" + IF(GUI_ROOT_DIR) SET(BLSURFPLUGIN_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "ghs3dplugin": newlines.append(""" + IF(GUI_ROOT_DIR) SET(GHS3DPLUGIN_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "hexoticplugin": newlines.append(""" + IF(GUI_ROOT_DIR) SET(HEXOTICPLUGIN_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "ghs3dprlplugin": newlines.append(""" + IF(GUI_ROOT_DIR) SET(GHS3DPRLPLUGIN_ENABLE_GUI ON) + ENDIF(GUI_ROOT_DIR) """) pass elif self.module == "yacs": @@ -671,8 +713,10 @@ class CMakeFile(object): else: if self.module not in ["yacs"]: newlines.append(r''' + IF(KERNEL_ROOT_DIR) SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) + ENDIF(KERNEL_ROOT_DIR) ''') pass pass @@ -1831,9 +1875,13 @@ if __name__ == "__main__": pass pass # -- + from sys import stdout for f in files: if f in ["Makefile.am", "Makefile.am.cmake"]: + stdout.write("Scanning %s %s ..."%(root, f)) + stdout.flush() convertAmFile(the_root, root, dirs, files, f, module) + stdout.write(" done.\n") pass pass pass diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 8245fe50b..497e0c1ed 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -420,11 +420,9 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param logFilename += "/"; #endif logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ; -#ifdef WNT std::ostringstream tmp; tmp << "_" << getpid(); logFilename += tmp.str(); -#endif logFilename += ".log" ; command += " > " + logFilename + " 2>&1"; #ifdef WNT diff --git a/src/Launcher/BatchTest.cxx b/src/Launcher/BatchTest.cxx index b9a9a5d62..80f59953e 100644 --- a/src/Launcher/BatchTest.cxx +++ b/src/Launcher/BatchTest.cxx @@ -298,6 +298,12 @@ BatchTest::test_jobsubmit_simple() result = "OK"; return result; } + if (batch_type == "ccc") + { + INFOS("test_jobsubmit_simple not yet implemented for ccc... return OK"); + result = "OK"; + return result; + } if (batch_type == "sge") { INFOS("test_jobsubmit_simple not yet implemented for sge... return OK"); @@ -482,6 +488,13 @@ BatchTest::test_jobsubmit_mpi() return result; } + if (batch_type == "ccc") + { + INFOS("test_jobsubmit_simple not yet implemented for ccc... return OK"); + result = "OK"; + return result; + } + if (batch_type == "sge") { INFOS("test_jobsubmit_simple not yet implemented for sge... return OK"); diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 0af54436c..8489de9b2 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -22,6 +22,7 @@ #ifdef WITH_LIBBATCH #include +#include #include #include #include @@ -409,6 +410,10 @@ Launcher_cpp::FactoryBatchManager(ParserResourcesType& params) message += "eSGE"; fact = new Batch::FactBatchManager_eSGE; break; + case ccc: + message += "eCCC"; + fact = new Batch::FactBatchManager_eCCC; + break; case ssh_batch: message += "eSSH"; fact = new Batch::FactBatchManager_eSSH; diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index b2c61375c..53b3c0e33 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -412,11 +412,10 @@ Launcher::Job::common_job_params() params[Batch::USER] = _resource_definition.UserName; params[Batch::NBPROC] = _resource_required_params.nb_proc; - // Memory + // Memory in megabytes if (_resource_required_params.mem_mb > 0) { - // Memory is in kilobytes - params[Batch::MAXRAMSIZE] = _resource_required_params.mem_mb * 1024; + params[Batch::MAXRAMSIZE] = _resource_required_params.mem_mb; } // We define a default directory based on user time diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index aec99bcfe..4c5c24360 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -718,7 +718,7 @@ void SALOME_LifeCycleCORBA::killOmniNames() { std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; "); cmd += std::string("killNotifdAndClean(") + portNumber + "); "; - cmd = std::string("python -c \"") + cmd +"\" >& /dev/null"; + cmd = std::string("python -c \"") + cmd +"\" > /dev/null 2> /dev/null"; MESSAGE(cmd); system( cmd.c_str() ); } diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index a4b8acdc4..e1ca6cc6b 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -41,12 +41,11 @@ #include "Container_init_python.hxx" // L'appel au registry SALOME ne se fait que pour le process 0 -Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, - CORBA::ORB_ptr orb, +Engines_MPIContainer_i::Engines_MPIContainer_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char * containerName, int argc, char *argv[]) - : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc) + : Engines_Container_i(orb,poa,containerName,argc,argv,false) { _id = _poa->activate_object(this); @@ -54,7 +53,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, Engines::Container_var pCont = Engines::Container::_narrow(obj); _remove_ref(); - if(numproc==0){ + if(_numproc==0){ _NS = new SALOME_NamingService(); _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ; @@ -71,8 +70,8 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, BCastIOR(_orb,pobj,true); } -Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc) - : Engines_Container_i(), MPIObject_i(nbproc,numproc) +Engines_MPIContainer_i::Engines_MPIContainer_i() + : Engines_Container_i() { } @@ -326,8 +325,7 @@ Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName, std::string factory_name = aGenRegisterName + std::string("Engine_factory"); typedef PortableServer::ObjectId * (*MPIFACTORY_FUNCTION) - (int,int, - CORBA::ORB_ptr, + (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, @@ -365,8 +363,7 @@ Engines_MPIContainer_i::createMPIInstance(std::string genericRegisterName, // --- Instanciate required CORBA object PortableServer::ObjectId *id ; //not owner, do not delete (nore use var) - id = (MPIComponent_factory) ( _nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), - aGenRegisterName.c_str() ) ; + id = (MPIComponent_factory) ( _orb, _poa, _id, instanceName.c_str(), aGenRegisterName.c_str() ) ; // --- get reference & servant from id @@ -468,14 +465,12 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ; dlerror(); - PortableServer::ObjectId * (*MPIComponent_factory) (int,int, - CORBA::ORB_ptr, + PortableServer::ObjectId * (*MPIComponent_factory) (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, const char *) = - (PortableServer::ObjectId * (*) (int,int, - CORBA::ORB_ptr, + (PortableServer::ObjectId * (*) (CORBA::ORB_ptr, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, @@ -494,7 +489,7 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( // Instanciation du composant parallele MESSAGE("[" << _numproc << "] Try to load a parallel component"); PortableServer::ObjectId * id = (MPIComponent_factory) - (_nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), _nameToRegister.c_str()); + (_orb, _poa, _id, instanceName.c_str(), _nameToRegister.c_str()); // get reference from id CORBA::Object_var o = _poa->id_to_reference(*id); pobj = Engines::MPIObject::_narrow(o) ; diff --git a/src/MPIContainer/MPIContainer_i.hxx b/src/MPIContainer/MPIContainer_i.hxx index 6b5c6eefb..88b29e4d1 100644 --- a/src/MPIContainer/MPIContainer_i.hxx +++ b/src/MPIContainer/MPIContainer_i.hxx @@ -54,12 +54,11 @@ class Engines_MPIContainer_i : public POA_Engines::MPIContainer, public: // Constructor - Engines_MPIContainer_i( int nbproc, int numproc, - CORBA::ORB_ptr orb, + Engines_MPIContainer_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char * containerName, int argc, char *argv[]); - Engines_MPIContainer_i(int nbproc, int numproc); + Engines_MPIContainer_i(); // Destructor ~Engines_MPIContainer_i(); diff --git a/src/MPIContainer/MPIObject_i.cxx b/src/MPIContainer/MPIObject_i.cxx index fa5907612..fd04587e1 100644 --- a/src/MPIContainer/MPIObject_i.cxx +++ b/src/MPIContainer/MPIObject_i.cxx @@ -37,13 +37,6 @@ MPIObject_i::MPIObject_i() _tior=NULL; } -MPIObject_i::MPIObject_i(int nbproc, int numproc) -{ - _nbproc = nbproc; - _numproc = numproc; - _tior=NULL; -} - MPIObject_i::~MPIObject_i() { if(_tior) delete _tior; diff --git a/src/MPIContainer/MPIObject_i.hxx b/src/MPIContainer/MPIObject_i.hxx index 049021c66..a00768929 100644 --- a/src/MPIContainer/MPIObject_i.hxx +++ b/src/MPIContainer/MPIObject_i.hxx @@ -36,7 +36,6 @@ class MPIObject_i: public virtual POA_Engines::MPIObject { public: MPIObject_i(); - MPIObject_i(int nbproc, int numproc); ~MPIObject_i(); Engines::IORTab* tior(); diff --git a/src/MPIContainer/SALOME_MPIContainer.cxx b/src/MPIContainer/SALOME_MPIContainer.cxx index c42a995fe..fa5d54a17 100644 --- a/src/MPIContainer/SALOME_MPIContainer.cxx +++ b/src/MPIContainer/SALOME_MPIContainer.cxx @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) } MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant"); - new Engines_MPIContainer_i(nbproc,numproc,orb,root_poa, containerName,argc,argv); + new Engines_MPIContainer_i(orb,root_poa, containerName,argc,argv); pman->activate(); diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index f7ac8ba75..ac6341bb6 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -534,6 +534,8 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser resource.Batch = sge; else if (aBatch == "ssh_batch") resource.Batch = ssh_batch; + else if (aBatch == "ccc") + resource.Batch = ccc; else resource.Batch = none; } @@ -726,6 +728,9 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc) case sge: xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "sge"); break; + case ccc: + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ccc"); + break; case ssh_batch: xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch"); break; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 8bd177c4e..f84d26b2c 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -205,6 +205,8 @@ ParserResourcesType::PrintBatchType() const return "lsf"; else if (Batch == sge) return "sge"; + else if (Batch == ccc) + return "ccc"; else return "ssh"; } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx index a867f96aa..d376e5545 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx @@ -45,7 +45,7 @@ enum AccessProtocolType {rsh, ssh}; enum AccessModeType {interactive, batch}; -enum BatchType {none, pbs, lsf, sge, ssh_batch}; +enum BatchType {none, pbs, lsf, sge, ssh_batch, ccc}; enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm, prun}; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index b03d51fcb..acdfe259d 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -252,6 +252,8 @@ SALOME_ResourcesManager::GetResourceDefinition(const char * name) p_ptr->batch = "lsf"; else if( resource.Batch == sge ) p_ptr->batch = "sge"; + else if( resource.Batch == ccc ) + p_ptr->batch = "ccc"; else if( resource.Batch == ssh_batch ) p_ptr->batch = "ssh"; @@ -281,6 +283,8 @@ SALOME_ResourcesManager::AddResource(const Engines::ResourceDefinition& new_reso resource.Batch = lsf; else if (aBatch == "sge") resource.Batch = sge; + else if (aBatch == "ccc") + resource.Batch = ccc; else if (aBatch == "ssh_batch") resource.Batch = ssh_batch; else if (aBatch == "") diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index 0bc795290..e6bb38616 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -23,10 +23,13 @@ // #include "SALOMEDSImpl_ScalarVariable.hxx" #include "SALOMEDSImpl_GenericVariable.hxx" +#include "Basics_Utils.hxx" #include #include #include +#define OLDSTUDY_COMPATIBILITY + //============================================================================ /*! Function : SALOMEDSImpl_ScalarVariable * Purpose : @@ -101,6 +104,8 @@ std::string SALOMEDSImpl_ScalarVariable::getStringValue() const */ //============================================================================ std::string SALOMEDSImpl_ScalarVariable::Save() const{ + Kernel_Utils::Localizer loc; + char buffer[255]; switch(Type()) { @@ -132,6 +137,8 @@ std::string SALOMEDSImpl_ScalarVariable::Save() const{ //============================================================================ std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const { + Kernel_Utils::Localizer loc; + char buffer[255]; switch(Type()) { @@ -147,10 +154,7 @@ std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const } case SALOMEDSImpl_GenericVariable::BOOLEAN_VAR: { - if((bool)myValue) - sprintf(buffer, "%s", "True"); - else - sprintf(buffer, "%s", "False"); + sprintf(buffer, "%s", ((bool)myValue) ? "True" : "False"); break; } case SALOMEDSImpl_GenericVariable::STRING_VAR: @@ -181,6 +185,19 @@ std::string SALOMEDSImpl_ScalarVariable::SaveType() const{ //============================================================================ void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue) { - double aValue = atof(theStrValue.c_str()); - setValue(aValue); + Kernel_Utils::Localizer loc; + + if ( Type() == SALOMEDSImpl_GenericVariable::STRING_VAR ) { + setStringValue( theStrValue ); + } + else { + std::string strCopy = theStrValue; +#ifdef OLDSTUDY_COMPATIBILITY + int dotpos = strCopy.find(','); + if (dotpos != std::string::npos) + strCopy.replace(dotpos, 1, "."); +#endif // OLDSTUDY_COMPATIBILITY + double aValue = atof(strCopy.c_str()); + setValue(aValue); + } } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index b1020d2e8..b42685c3f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -320,6 +320,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, char aMultifileState[2]; char ASCIIfileState[2]; + bool hasModuleData = false; try { std::string scoid = anSCO.GetID(); hdf_file->OpenOnDisk(HDF_RDONLY); @@ -327,6 +328,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, hdf_group->OpenOnDisk(); HDFgroup *hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group); hdf_sco_group->OpenOnDisk(); + hasModuleData = true; unsigned char* aStreamFile = NULL; int aStreamSize = 0; @@ -397,6 +399,10 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, } if (aLocked) _study->GetProperties()->SetLocked(true); + + if (!hasModuleData) + return true; + _errorCode = "No persistent file"; return false; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 6070173cc..62f4e169a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -28,6 +28,7 @@ #include "DF_ChildIterator.hxx" #include "HDFexplorer.hxx" +#include "Basics_Utils.hxx" #include "SALOMEDSImpl_Attributes.hxx" #include "SALOMEDSImpl_Tool.hxx" @@ -120,6 +121,9 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::NewStudy(const std::string& study //============================================================================ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const std::string& aUrl) { + // Set "C" locale temporarily to avoid possible localization problems + Kernel_Utils::Localizer loc; + _errorCode = ""; // open the HDFFile @@ -460,6 +464,9 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl, bool theMultiFile, bool theASCII) { + // Set "C" locale temporarily to avoid possible localization problems + Kernel_Utils::Localizer loc; + // HDF File will be composed of differents part : // * For each ComponentDataType, all data created by the component // Informations in data group hdf_group_datacomponent diff --git a/src/TestMPIContainer/TestMPIComponentEngine.cxx b/src/TestMPIContainer/TestMPIComponentEngine.cxx index 443f04cd0..0e7602056 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.cxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.cxx @@ -32,21 +32,20 @@ #include "utilities.h" #include "TestMPIComponentEngine.hxx" -TestMPIComponentEngine::TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, +TestMPIComponentEngine::TestMPIComponentEngine(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, bool regist) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist), MPIObject_i(nbproc,numproc) + Engines_Component_i(orb, poa, contId, instanceName, interfaceName,true,regist) { MESSAGE("activate object") _thisObj = this ; _id = _poa->reference_to_id(_thisObj->_this()); } -TestMPIComponentEngine::TestMPIComponentEngine(): Engines_Component_i(), MPIObject_i() +TestMPIComponentEngine::TestMPIComponentEngine() { } @@ -73,24 +72,26 @@ void TestMPIComponentEngine::SPCoucou(CORBA::Long L) extern "C" { PortableServer::ObjectId * TestMPIComponentEngine_factory( - int nbproc, int numproc, CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) { + int numproc; bool regist; TestMPIComponentEngine * myTestMPIComponent; + MESSAGE("[" << numproc << "] PortableServer::ObjectId * TestMPIComponentEngine_factory()"); SCRUTE(interfaceName); + MPI_Comm_rank( MPI_COMM_WORLD, &numproc ); if(numproc==0) regist = true; else regist = false; myTestMPIComponent - = new TestMPIComponentEngine(nbproc,numproc,orb, poa, contId, instanceName, interfaceName,regist); + = new TestMPIComponentEngine(orb, poa, contId, instanceName, interfaceName,regist); return myTestMPIComponent->getId() ; } } diff --git a/src/TestMPIContainer/TestMPIComponentEngine.hxx b/src/TestMPIContainer/TestMPIComponentEngine.hxx index ea422bce3..df161dffa 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.hxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.hxx @@ -43,8 +43,7 @@ class TestMPIComponentEngine: { public: TestMPIComponentEngine(); - TestMPIComponentEngine(int nbproc, int numproc, - CORBA::ORB_ptr orb, + TestMPIComponentEngine(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, -- 2.39.2