-// Copyright (C) 2009-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
std::list<std::string>
-BL::SALOMEServices::getResourceList()
+BL::SALOMEServices::getResourceList(bool batch_only)
{
std::list<std::string> resource_list;
{
Engines::ResourceParameters params;
_lcc->preSet(params);
+ params.can_launch_batch_jobs = batch_only;
Engines::ResourceList * resourceList = NULL;
try
{
resource_descr.batch = resource_definition->batch.in();
resource_descr.mpiImpl = resource_definition->mpiImpl.in();
resource_descr.iprotocol = resource_definition->iprotocol.in();
- resource_descr.is_cluster_head = resource_definition->is_cluster_head;
+ resource_descr.can_launch_batch_jobs = resource_definition->can_launch_batch_jobs;
+ resource_descr.can_run_containers = resource_definition->can_run_containers;
resource_descr.working_directory = resource_definition->working_directory.in();
delete resource_definition;
resource_definition->name = CORBA::string_dup(new_resource.name.c_str());
resource_definition->hostname = CORBA::string_dup(new_resource.hostname.c_str());
+ if (new_resource.batch == "ssh_batch")
+ resource_definition->type = CORBA::string_dup("single_machine");
+ else
+ resource_definition->type = CORBA::string_dup("cluster");
resource_definition->protocol = CORBA::string_dup(new_resource.protocol.c_str());
resource_definition->username = CORBA::string_dup(new_resource.username.c_str());
resource_definition->applipath = CORBA::string_dup(new_resource.applipath.c_str());
resource_definition->batch = CORBA::string_dup(new_resource.batch.c_str());
resource_definition->mpiImpl = CORBA::string_dup(new_resource.mpiImpl.c_str());
resource_definition->iprotocol = CORBA::string_dup(new_resource.iprotocol.c_str());
- resource_definition->is_cluster_head = new_resource.is_cluster_head;
+ resource_definition->can_launch_batch_jobs = new_resource.can_launch_batch_jobs;
+ resource_definition->can_run_containers = new_resource.can_run_containers;
resource_definition->working_directory = CORBA::string_dup(new_resource.working_directory.c_str());
try
catch (const SALOME::SALOME_Exception & ex)
{
DEBMSG("SALOME Exception in addResource ! " << ex.details.text.in());
+ throw(BL::Exception(ex.details.text.in()));
}
catch (const CORBA::SystemException& ex)
{
DEBMSG("Receive SALOME System Exception: " << ex);
DEBMSG("Check SALOME servers...");
+ throw(BL::Exception("SALOME System Exception"));
}
}
memory = memory * 1024;
job_parameters->resource_required.mem_mb = memory;
+ // Parameters for COORM
+ job_parameters->launcher_file = CORBA::string_dup(cpp_batch_params.launcher_file.c_str());
+ job_parameters->launcher_args = CORBA::string_dup(cpp_batch_params.launcher_args.c_str());
+
// Create Job
try
{
return ret;
}
+// Get names or ids of hosts assigned to the job
+std::string
+BL::SALOMEServices::get_assigned_hostnames(BL::Job * job)
+{
+ std::string ret = "";
+
+ try
+ {
+ CORBA::String_var result = _salome_launcher->getAssignedHostnames(job->getSalomeLauncherId());
+ ret = result.in();
+ }
+ catch (const SALOME::SALOME_Exception & ex)
+ {
+ DEBMSG("SALOME Exception in get_assigned_hostnames !");
+ ret = ex.details.text.in();
+ }
+ catch (const CORBA::SystemException& ex)
+ {
+ DEBMSG("Receive SALOME System Exception: " << ex);
+ DEBMSG("Check SALOME servers...");
+ ret = "SALOME System Exception - see logs";
+ }
+ return ret;
+}
+
std::string
BL::SALOMEServices::save_jobs(const std::string & file_name)
{
std::ostringstream mem_stream;
mem_stream << job_parameters->resource_required.mem_mb << "mb";
batch_param.expected_memory = mem_stream.str();
+
+ // Parameters for COORM
+ batch_param.launcher_file = job_parameters->launcher_file.in();
+ batch_param.launcher_args = job_parameters->launcher_args.in();
+
job_return->setBatchParameters(batch_param);
job_return->setResource(job_parameters->resource_required.name.in());