Version: 9.16.0
MeshJobManager_i Class Reference

#include <MeshJobManager_i.hxx>

Inheritance diagram for MeshJobManager_i:

Public Member Functions

 MeshJobManager_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId *contId, const char *instanceName, const char *interfaceName, bool checkNS=true, bool regist=true)
 
 ~MeshJobManager_i ()
 
bool configure (const char *configId, const MESHJOB::ConfigParameter &configParameter)
 
CORBA::Long initialize (const MESHJOB::MeshJobFileList &meshJobFileList, const MESHJOB::MeshJobParameterList &meshJobParameterList, const char *configId)
 Initialize a smesh computation job and return the job identifier. More...
 
bool start (CORBA::Long jobId)
 Submit the job execution and return true if submission is OK. More...
 
char * getState (CORBA::Long jobId)
 Request the launch manager for the state of the specified job. More...
 
MESHJOB::MeshJobResultsfinalize (CORBA::Long jobId)
 
MESHJOB::MeshJobPathsgetPaths (CORBA::Long jobId)
 
bool clean (CORBA::Long jobId)
 Clean all data associated to this job and remove the job from the launch manager. More...
 
char * getLastErrorMessage ()
 

Static Public Attributes

static long JOBID_UNDEFINED = -1
 

Private Member Functions

const char * _writeDataFile (std::vector< MESHJOB::MeshJobFile > listConcreteMesh, std::vector< MESHJOB::MeshJobFile > listSteelBarMesh, const MESHJOB::MeshJobParameterList &meshJobParameterList)
 This function creates the padder text input file containing the input data (list of filenames and groupnames) and returns the path of the created file. More...
 
const char * _writeScriptFile (const char *dataFileName, const char *configId)
 This function creates a shell script that runs padder with the specified data file, and returns the path of the created script file. More...
 
std::vector< std::string > * _getResourceNames ()
 

Private Attributes

Engines::SalomeLauncher_var _salomeLauncher
 
Engines::ResourcesManager_var _resourcesManager
 
std::map< std::string, MESHJOB::ConfigParameter_configMap
 
std::map< long, long > _jobDateTimeMap
 
std::map< long, MESHJOB::MeshJobPaths * > _jobPathsMap
 
std::string _lastErrorMessage
 

Constructor & Destructor Documentation

◆ MeshJobManager_i()

MeshJobManager_i::MeshJobManager_i ( CORBA::ORB_ptr  orb,
PortableServer::POA_ptr  poa,
PortableServer::ObjectId *  contId,
const char *  instanceName,
const char *  interfaceName,
bool  checkNS = true,
bool  regist = true 
)

◆ ~MeshJobManager_i()

MeshJobManager_i::~MeshJobManager_i ( )

References LOG.

Member Function Documentation

◆ _getResourceNames()

std::vector< std::string > * MeshJobManager_i::_getResourceNames ( )
private

References _resourcesManager, and LOG.

◆ _writeDataFile()

const char * MeshJobManager_i::_writeDataFile ( std::vector< MESHJOB::MeshJobFile listConcreteMesh,
std::vector< MESHJOB::MeshJobFile listSteelBarMesh,
const MESHJOB::MeshJobParameterList meshJobParameterList 
)
private

This function creates the padder text input file containing the input data (list of filenames and groupnames) and returns the path of the created file.

This function is the one that knows the format of the padder input file. If the input file format changes, then this function (and only this one) should be updated. The file format is the following ([] means that the variable is optional):

[<concreteMeshFile> <concreteGroupName>] nbSteelBarMeshes <N> <steelBarMeshFile_1> <steelBarGroupName_1> <steelBarMeshFile_2> <steelBarGroupName_2> ... <steelBarMeshFile_N> <steelBarGroupName_N> <outputMedFile>

References DATAFILE(), LOCAL_INPUTDIR(), MESHJOB::MeshJobParameter::name, OUTPUTFILE(), SEPARATOR(), and MESHJOB::MeshJobParameter::value.

Referenced by initialize().

◆ _writeScriptFile()

const char * MeshJobManager_i::_writeScriptFile ( const char *  dataFileName,
const char *  configId 
)
private

This function creates a shell script that runs padder with the specified data file, and returns the path of the created script file.

The config id is used to retrieve the path to the binary file and other required files.

References _configMap, LOCAL_INPUTDIR(), and SCRIPTFILE().

Referenced by initialize().

◆ clean()

bool MeshJobManager_i::clean ( CORBA::Long  jobId)

Clean all data associated to this job and remove the job from the launch manager.

References getPaths(), MESHJOB::MeshJobPaths::local_inputdir, MESHJOB::MeshJobPaths::local_resultdir, LOG, and myStartsWith().

◆ configure()

bool MeshJobManager_i::configure ( const char *  configId,
const MESHJOB::ConfigParameter configParameter 
)

References _configMap, and LOG.

◆ finalize()

◆ getLastErrorMessage()

char * MeshJobManager_i::getLastErrorMessage ( )

References _lastErrorMessage.

◆ getPaths()

MESHJOB::MeshJobPaths * MeshJobManager_i::getPaths ( CORBA::Long  jobId)

References _jobPathsMap, and LOG.

Referenced by clean(), and finalize().

◆ getState()

char * MeshJobManager_i::getState ( CORBA::Long  jobId)

Request the launch manager for the state of the specified job.

References _lastErrorMessage, _salomeLauncher, and LOG.

◆ initialize()

◆ start()

bool MeshJobManager_i::start ( CORBA::Long  jobId)

Submit the job execution and return true if submission is OK.

References _lastErrorMessage, _salomeLauncher, and LOG.

Field Documentation

◆ _configMap

std::map<std::string, MESHJOB::ConfigParameter> MeshJobManager_i::_configMap
private

◆ _jobDateTimeMap

std::map<long, long> MeshJobManager_i::_jobDateTimeMap
private

Referenced by finalize(), and initialize().

◆ _jobPathsMap

std::map<long, MESHJOB::MeshJobPaths*> MeshJobManager_i::_jobPathsMap
private

Referenced by getPaths(), and initialize().

◆ _lastErrorMessage

std::string MeshJobManager_i::_lastErrorMessage
private

◆ _resourcesManager

Engines::ResourcesManager_var MeshJobManager_i::_resourcesManager
private

◆ _salomeLauncher

Engines::SalomeLauncher_var MeshJobManager_i::_salomeLauncher
private

◆ JOBID_UNDEFINED

long MeshJobManager_i::JOBID_UNDEFINED = -1
static

Referenced by initialize().