From 6f4bcf1579d0bd12adcf128a5487a23b8737d2e6 Mon Sep 17 00:00:00 2001 From: secher Date: Thu, 28 Jun 2007 14:45:11 +0000 Subject: [PATCH] improvement to use Salome application --- src/Container/Makefile.am | 3 ++- src/Container/SALOME_ContainerManager.cxx | 4 ++-- src/Container/SALOME_ContainerManager.hxx | 4 ++-- src/Makefile.am | 8 ++++---- .../SALOME_ResourcesManager.cxx | 19 +++++++++++-------- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index 3aa895380..aa958bdc1 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -148,6 +148,7 @@ SALOME_ContainerManagerServer_CPPFLAGS=\ SALOME_ContainerManagerServer_LDADD =\ libSalomeContainer.la \ $(COMMON_LIBS) \ - ../Basics/libSALOMEBasics.la + ../Basics/libSALOMEBasics.la \ ../Batch/libSalomeBatch.la + diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 0acec7e1c..ec4bef59f 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -327,10 +327,10 @@ GiveContainer(const Engines::MachineParameters& params, * \param params : Constraints for the choice of the batch cluster */ //============================================================================= -long SALOME_ContainerManager::batchSalomeJob( +CORBA::Long SALOME_ContainerManager::batchSalomeJob( const char * fileToExecute , const Engines::FilesToExportList& filesToExport , - const long NumberOfProcessors , + const CORBA::Long NumberOfProcessors , const Engines::MachineParameters& params) { BEGIN_OF("SALOME_ContainerManager::batchSalomeJob"); diff --git a/src/Container/SALOME_ContainerManager.hxx b/src/Container/SALOME_ContainerManager.hxx index 4bacf2c34..90ba170a7 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -72,9 +72,9 @@ public: Engines::ResPolicy policy, const Engines::CompoList& componentList); - long batchSalomeJob(const char * fileToExecute , + CORBA::Long batchSalomeJob(const char * fileToExecute , const Engines::FilesToExportList& filesToExport , - const long NumberOfProcessors , + const CORBA::Long NumberOfProcessors , const Engines::MachineParameters& params); Engines::MachineList * diff --git a/src/Makefile.am b/src/Makefile.am index 8d6b7fa89..010d8fcd6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -96,6 +96,10 @@ DIST_SUBDIRS = \ SUBDIRS = $(SUBDIR_BASE) +if WITH_BATCH + SUBDIRS += $(SUBDIR_BATCH) +endif + if CORBA_GEN SUBDIRS += $(SUBDIR_CORBA) endif @@ -104,10 +108,6 @@ if MPI_IS_OK SUBDIRS += $(SUBDIR_MPI) endif -if WITH_BATCH - SUBDIRS += $(SUBDIR_BATCH) -endif - if CPPUNIT_IS_OK if CORBA_GEN SUBDIRS += \ diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index fee097901..6e4b446db 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -617,26 +617,29 @@ std::string SALOME_ResourcesManager::BuildCmdrunSalomeBatch( const ParserResourcesType& resInfo = _resourcesList[machine]; resInfo.Print() ; tempOutputFile << "#! /bin/sh -f" << endl ; - tempOutputFile << "source " ; + tempOutputFile << "cd " ; tempOutputFile << resInfo.AppliPath << endl ; tempOutputFile << "export PYTHONPATH=" ; tempOutputFile << DirForTmpFiles ; tempOutputFile << ":$PYTHONPATH" << endl ; tempOutputFile << "if test $SLURM_PROCID = 0; then" << endl ; - tempOutputFile << " runSalome --terminal --batch --modules=" ; + tempOutputFile << " ./runAppli --terminal --batch --modules=" ; int i ; for ( i = 0 ; i < resInfo.ModulesList.size() ; i++ ) { tempOutputFile << resInfo.ModulesList[i] ; if ( i != resInfo.ModulesList.size()-1 ) tempOutputFile << "," ; } - tempOutputFile << " --standalone=registry,study,moduleCatalog --execute=" ; - tempOutputFile << FileNameToExecute ; - tempOutputFile << ",killall --killall" << endl ; + tempOutputFile << " --standalone=registry,study,moduleCatalog --killall &" << endl ; + tempOutputFile << " for ((ip=1; ip < ${SLURM_NPROCS} ; ip++))" << endl; + tempOutputFile << " do" << endl ; + tempOutputFile << " arglist=\"$arglist YACS_Server_\"$ip" << endl ; + tempOutputFile << " done" << endl ; + tempOutputFile << " ./runSession waitContainers.sh $arglist" << endl ; + tempOutputFile << " ./runSession python " << DirForTmpFiles << "/" << FileNameToExecute << ".py" << endl; tempOutputFile << "else" << endl ; - tempOutputFile << " sleep 10" << endl ; - tempOutputFile << " export SALOME_BATCH='1'" << endl ; - tempOutputFile << " SALOME_Container 'YACS_Server_'${SLURM_PROCID}" << endl ; + tempOutputFile << " ./runSession waitNS.py" << endl ; + tempOutputFile << " ./runSession SALOME_Container 'YACS_Server_'${SLURM_PROCID}" << endl ; tempOutputFile << "fi" << endl ; tempOutputFile.flush(); tempOutputFile.close(); -- 2.39.2