From: caremoli Date: Fri, 18 Jun 2010 07:15:51 +0000 (+0000) Subject: CCAR:synchronize with V5_1_main head X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=72c015f201efdfaf07e3c732be2c2a173973ea49;p=modules%2Fkernel.git CCAR:synchronize with V5_1_main head --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 8245fe50b..8412d2f91 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 @@ -1065,7 +1063,7 @@ std::string SALOME_ContainerManager::GetMPIZeroNode(const std::string machine, c status = system(command.c_str()); if( status == 0 ){ std::ifstream fp(tmpFile.c_str(),std::ios::in); - fp >> zeronode; + while(fp >> zeronode); } RmTmpFile(tmpFile); 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..e5d8e9dc8 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -22,11 +22,9 @@ #ifdef WITH_LIBBATCH #include -#include -#include +#include +#include #include -#include -#include #endif #include "Basics_Utils.hxx" @@ -394,30 +392,35 @@ Launcher_cpp::FactoryBatchManager(ParserResourcesType& params) mpi = "nompi"; } - std::string message = "Instanciation of batch manager of type: "; + const char * bmType; switch( params.Batch ) { case pbs: - message += "ePBS"; - fact = new Batch::FactBatchManager_ePBS; + bmType = "ePBS"; break; case lsf: - message += "eLSF"; - fact = new Batch::FactBatchManager_eLSF; + bmType = "eLSF"; break; case sge: - message += "eSGE"; - fact = new Batch::FactBatchManager_eSGE; + bmType = "eSGE"; + break; + case ccc: + bmType = "eCCC"; break; case ssh_batch: - message += "eSSH"; - fact = new Batch::FactBatchManager_eSSH; + bmType = "eSSH"; break; default: LAUNCHER_MESSAGE("Bad batch description of the resource: Batch = " << params.Batch); throw LauncherException("No batchmanager for that cluster - Bad batch description of the resource"); } - LAUNCHER_MESSAGE(message); + Batch::BatchManagerCatalog & cata = Batch::BatchManagerCatalog::getInstance(); + fact = dynamic_cast(cata(bmType)); + if (fact == NULL) { + LAUNCHER_MESSAGE("Cannot find batch manager factory for " << bmType << ". Check your version of libBatch."); + throw LauncherException("Cannot find batch manager factory"); + } + LAUNCHER_MESSAGE("Instanciation of batch manager of type: " << bmType); return (*fact)(hostname.c_str(), protocol, mpi.c_str(), nb_proc_per_node); } 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/Launcher/Launcher_Job_SALOME.cxx b/src/Launcher/Launcher_Job_SALOME.cxx index 5d0e16b2d..d11057b51 100644 --- a/src/Launcher/Launcher_Job_SALOME.cxx +++ b/src/Launcher/Launcher_Job_SALOME.cxx @@ -77,7 +77,7 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params) resource_protocol = "rsh"; launch_script_stream << "if [ \"x$LIBBATCH_NODEFILE\" != \"x\" ]; then " << std::endl; - launch_script_stream << "CATALOG_FILE=" << work_directory << "/CatalogResources_" << _launch_date << ".xml" << std::endl; + launch_script_stream << "CATALOG_FILE=" << "CatalogResources_" << _launch_date << ".xml" << std::endl; launch_script_stream << "export USER_CATALOG_RESOURCES_FILE=" << "$CATALOG_FILE" << std::endl; launch_script_stream << "echo '' > $CATALOG_FILE" << std::endl; launch_script_stream << "echo '' >> $CATALOG_FILE" << std::endl; 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 e1ca6cc6b..627f398be 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -87,6 +87,7 @@ void Engines_MPIContainer_i::Shutdown() MESSAGE("[" << _numproc << "] shutdown of MPI Corba Server"); if( _numproc == 0 ){ _NS->Destroy_FullDirectory(_containerName.c_str()); + _NS->Destroy_Name(_containerName.c_str()); for(ip= 1;ip<_nbproc;ip++) (Engines::MPIContainer::_narrow((*_tior)[ip]))->Shutdown(); } 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 == "")