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
status = system(command.c_str());
if( status == 0 ){
std::ifstream fp(tmpFile.c_str(),std::ios::in);
- fp >> zeronode;
+ while(fp >> zeronode);
}
RmTmpFile(tmpFile);
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");
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");
#ifdef WITH_LIBBATCH
#include <Batch/Batch_Date.hxx>
-#include <Batch/Batch_FactBatchManager_eLSF.hxx>
-#include <Batch/Batch_FactBatchManager_ePBS.hxx>
+#include <Batch/Batch_BatchManagerCatalog.hxx>
+#include <Batch/Batch_FactBatchManager_eClient.hxx>
#include <Batch/Batch_BatchManager_eClient.hxx>
-#include <Batch/Batch_FactBatchManager_eSGE.hxx>
-#include <Batch/Batch_FactBatchManager_eSSH.hxx>
#endif
#include "Basics_Utils.hxx"
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<Batch::FactBatchManager_eClient*>(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);
}
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
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 '<!DOCTYPE ResourcesCatalog>' > $CATALOG_FILE" << std::endl;
launch_script_stream << "echo '<resources>' >> $CATALOG_FILE" << std::endl;
{
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() );
}
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();
}
resource.Batch = sge;
else if (aBatch == "ssh_batch")
resource.Batch = ssh_batch;
+ else if (aBatch == "ccc")
+ resource.Batch = ccc;
else
resource.Batch = none;
}
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;
return "lsf";
else if (Batch == sge)
return "sge";
+ else if (Batch == ccc)
+ return "ccc";
else
return "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};
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";
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 == "")