Version: 8.3.0
Engines::SalomeLauncher Interface Reference

Interface of the salome launcher. More...

import "SALOME_Launcher.idl";

Public Member Functions

long createJob (in Engines::JobParameters job_parameters) raises (SALOME::SALOME_Exception)
 Create a job and set its parameters, without launching it. More...
 
void launchJob (in long job_id) raises (SALOME::SALOME_Exception)
 Launch an already created job (job's state should be "CREATED"). More...
 
string getJobState (in long job_id) raises (SALOME::SALOME_Exception)
 Get the execution state of the job. More...
 
string getAssignedHostnames (in long job_id) raises (SALOME::SALOME_Exception)
 Get names or ids of hosts assigned to the job. More...
 
void getJobResults (in long job_id, in string directory) raises (SALOME::SALOME_Exception)
 Copy the result files from the work directory of the job to a local directory. More...
 
boolean getJobDumpState (in long job_id, in string directory) raises (SALOME::SALOME_Exception)
 Try to copy the files named "dumpState*.xml" from the working directory. More...
 
boolean getJobWorkFile (in long job_id, in string work_file, in string directory) raises (SALOME::SALOME_Exception)
 Retrieve one sigle file from the working directory. More...
 
void stopJob (in long job_id) raises (SALOME::SALOME_Exception)
 Kill the job and set its state to "FAILED". More...
 
void removeJob (in long job_id) raises (SALOME::SALOME_Exception)
 Kill the job and remove it from the jobs list. More...
 
long createJobWithFile (in string xmlJobFile, in string clusterName) raises (SALOME::SALOME_Exception)
 
boolean testBatch (in ResourceParameters params) raises (SALOME::SALOME_Exception)
 
void Shutdown ()
 Shutdow SalomeLauncher server. More...
 
long getPID ()
 Get the PID of the current process. More...
 
void addObserver (in Engines::SalomeLauncherObserver observer)
 Add an observer to be notified of the jobs list modifications. More...
 
void removeObserver (in Engines::SalomeLauncherObserver observer)
 
Engines::JobsList getJobsList ()
 
Engines::JobParameters getJobParameters (in long job_id) raises (SALOME::SALOME_Exception)
 
void loadJobs (in string jobs_file) raises (SALOME::SALOME_Exception)
 Add to the current jobs list the jobs previously saved in an xml file. More...
 
void saveJobs (in string jobs_file) raises (SALOME::SALOME_Exception)
 Save the current list of jobs in an xml file. More...
 

Detailed Description

Interface of the salome launcher.

This interface is used for interaction with the unique instance of SalomeLauncher. The utilisation of this interface is explained in the YACS documentation, article "Starting a SALOME application in a batch manager". Other examples of use can be found in the modules JOBMANAGER, PARAMETRIC and SMESH (PADDER tool).

Member Function Documentation

void Engines::SalomeLauncher::addObserver ( in Engines::SalomeLauncherObserver  observer)

Add an observer to be notified of the jobs list modifications.

long Engines::SalomeLauncher::createJob ( in Engines::JobParameters  job_parameters) raises (SALOME::SALOME_Exception)

Create a job and set its parameters, without launching it.

Its state becomes "CREATED".

Returns
job id
long Engines::SalomeLauncher::createJobWithFile ( in string  xmlJobFile,
in string  clusterName 
) raises (SALOME::SALOME_Exception)
string Engines::SalomeLauncher::getAssignedHostnames ( in long  job_id) raises (SALOME::SALOME_Exception)

Get names or ids of hosts assigned to the job.

boolean Engines::SalomeLauncher::getJobDumpState ( in long  job_id,
in string  directory 
) raises (SALOME::SALOME_Exception)

Try to copy the files named "dumpState*.xml" from the working directory.

The file "dumpState_name.xml" can be produced by the execution of a YACS schema and it contains the execution state of the schema. You can activate the creation of this file by adding the parameter "EnableDumpYACS" in JobParameters::specific_parameters when the job is created.

Parameters
job_idJob id returned by createJob().
directoryLocal directory where to copy the file. If this value is an empty string (""), the file will be copied to the directory given by JobParameters::result_directory.
Returns
1 if the copy succeeds.
See Also
JobParameters::specific_parameters
Engines::JobParameters Engines::SalomeLauncher::getJobParameters ( in long  job_id) raises (SALOME::SALOME_Exception)
void Engines::SalomeLauncher::getJobResults ( in long  job_id,
in string  directory 
) raises (SALOME::SALOME_Exception)

Copy the result files from the work directory of the job to a local directory.

The list of result files is given by the JobParameters::out_files parameter. If a result "file" is a directory, the copy is recursive. The "logs" directory contains the standard and the error outputs of the job.

Parameters
job_idJob id returned by createJob().
directoryLocal directory where to copy the results. If this value is an empty string (""), files will be copied to the directory given by JobParameters::result_directory.
See Also
JobParameters
createJob
Engines::JobsList Engines::SalomeLauncher::getJobsList ( )
string Engines::SalomeLauncher::getJobState ( in long  job_id) raises (SALOME::SALOME_Exception)

Get the execution state of the job.

Returns
"CREATED", "IN_PROCESS", "QUEUED", "RUNNING", "PAUSED", "FINISHED" or "FAILED"
See Also
LIBBATCH/src/core/Constants.hxx
boolean Engines::SalomeLauncher::getJobWorkFile ( in long  job_id,
in string  work_file,
in string  directory 
) raises (SALOME::SALOME_Exception)

Retrieve one sigle file from the working directory.

Use this method if you don't want to copy all the results of the job, for instance if you want to obtain a file which contains the computing progress while the job is running.

Parameters
job_idJob id returned by createJob().
work_filePath to the file to be copied, relative to the working directory of the job. If it is a directory, it will be copied recursively.
directoryLocal directory where to copy the file. If this value is an empty string (""), the file will be copied to the directory given by JobParameters::result_directory.
Returns
1 if the copy succeeds.
long Engines::SalomeLauncher::getPID ( )

Get the PID of the current process.

void Engines::SalomeLauncher::launchJob ( in long  job_id) raises (SALOME::SALOME_Exception)

Launch an already created job (job's state should be "CREATED").

Launching the job consists of:

  • create the working directory on the remote file system
  • copy the input files into the working directory
  • submit the job to the batch manager
void Engines::SalomeLauncher::loadJobs ( in string  jobs_file) raises (SALOME::SALOME_Exception)

Add to the current jobs list the jobs previously saved in an xml file.

void Engines::SalomeLauncher::removeJob ( in long  job_id) raises (SALOME::SALOME_Exception)

Kill the job and remove it from the jobs list.

void Engines::SalomeLauncher::removeObserver ( in Engines::SalomeLauncherObserver  observer)
void Engines::SalomeLauncher::saveJobs ( in string  jobs_file) raises (SALOME::SALOME_Exception)

Save the current list of jobs in an xml file.

void Engines::SalomeLauncher::Shutdown ( )

Shutdow SalomeLauncher server.

void Engines::SalomeLauncher::stopJob ( in long  job_id) raises (SALOME::SALOME_Exception)

Kill the job and set its state to "FAILED".

boolean Engines::SalomeLauncher::testBatch ( in ResourceParameters  params) raises (SALOME::SALOME_Exception)