Version: 9.12.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 exportInputFiles (in long job_id) raises (SALOME::SALOME_Exception)
 Copy all the in_files of the job to the work_directory. 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...
 
void clearJobWorkingDir (in long job_id) raises (SALOME::SALOME_Exception)
 Remove the working directory on the remote file system. More...
 
boolean getJobWorkFile (in long job_id, in string work_file, in string directory) raises (SALOME::SALOME_Exception)
 Retrieve one single 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...
 
string dumpJob (in long job_id) raises (SALOME::SALOME_Exception)
 Get the job's serialization string. More...
 
long restoreJob (in string dumpedJob) raises (SALOME::SALOME_Exception)
 Create a job from its serialization string. 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

◆ addObserver()

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

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

◆ clearJobWorkingDir()

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

Remove the working directory on the remote file system.

Parameters
job_idJob id returned by createJob().

◆ createJob()

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

◆ createJobWithFile()

long Engines::SalomeLauncher::createJobWithFile ( in string  xmlJobFile,
in string  clusterName 
)
raises (SALOME::SALOME_Exception
)

◆ dumpJob()

string Engines::SalomeLauncher::dumpJob ( in long  job_id)
raises (SALOME::SALOME_Exception
)

Get the job's serialization string.

◆ exportInputFiles()

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

Copy all the in_files of the job to the work_directory.

◆ getAssignedHostnames()

string Engines::SalomeLauncher::getAssignedHostnames ( in long  job_id)
raises (SALOME::SALOME_Exception
)

Get names or ids of hosts assigned to the job.

◆ getJobDumpState()

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

◆ getJobParameters()

Engines::JobParameters Engines::SalomeLauncher::getJobParameters ( in long  job_id)
raises (SALOME::SALOME_Exception
)

◆ getJobResults()

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

◆ getJobsList()

Engines::JobsList Engines::SalomeLauncher::getJobsList ( )

◆ getJobState()

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", "ERROR" or "FAILED"
See also
LIBBATCH/src/core/Constants.hxx

◆ getJobWorkFile()

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

Retrieve one single 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.

◆ getPID()

long Engines::SalomeLauncher::getPID ( )

Get the PID of the current process.

◆ launchJob()

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
  • launch the pre processing command if one is defined
  • submit the job to the batch manager

◆ loadJobs()

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.

◆ removeJob()

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

Kill the job and remove it from the jobs list.

◆ removeObserver()

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

◆ restoreJob()

long Engines::SalomeLauncher::restoreJob ( in string  dumpedJob)
raises (SALOME::SALOME_Exception
)

Create a job from its serialization string.

Parameters
dumpedJobSerialization string returned by dumpJob.
Returns
Job id

◆ saveJobs()

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

Save the current list of jobs in an xml file.

◆ Shutdown()

void Engines::SalomeLauncher::Shutdown ( )

Shutdow SalomeLauncher server.

◆ stopJob()

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

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

◆ testBatch()

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