1 // Copyright (C) 2011-2021 EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Authors : Guillaume Boulant (EDF) - 01/03/2011
29 #include "MeshJobManager_i.hxx"
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SALOME_Exception)
35 #include "Basics_Utils.hxx" // For standard logging
37 #include "SALOME_KernelServices.hxx" // For CORBA logging
43 // ====================================================================
44 // General purpose helper functions (to put elsewhere at least)
45 // ====================================================================
49 * This function must be used to associate a datetime tag to a job
53 static long timetag() {
56 long tag = tv.tv_usec + tv.tv_sec*1000000;
62 * This function returns true if the string text starts with the string
65 static bool myStartsWith(const std::string& text,const std::string& token){
66 if(text.length() < token.length())
68 return (text.compare(0, token.length(), token) == 0);
72 * This function returns true if the file exists on the local file
77 static bool fexists(const char *filename)
79 std::ifstream ifile(filename);
80 if ((bool)ifile && ifile.good()) {
86 Engines::EngineComponent_var RetrievePadderMeshJobManagerInstance()
92 // ====================================================================
93 // Constructor/Destructor
94 // ====================================================================
96 MeshJobManager_i::MeshJobManager_i(CORBA::ORB_ptr orb,
97 PortableServer::POA_ptr poa,
98 PortableServer::ObjectId * contId,
99 const char *instanceName,
100 const char *interfaceName,
101 bool checkNS, bool regist)
102 : Engines_Component_i(orb, poa, contId, instanceName, interfaceName, checkNS, regist)
104 LOG("Activating MESHJOB::MeshJobManager object");
106 _id = _poa->activate_object(_thisObj);
108 _salomeLauncher = KERNEL::getSalomeLauncher();
109 if(CORBA::is_nil(_salomeLauncher)){
110 LOG("The SALOME launcher can't be reached ==> STOP");
111 throw KERNEL::createSalomeException("SALOME launcher can't be reached");
114 _resourcesManager = KERNEL::getResourcesManager();
115 if(CORBA::is_nil(_resourcesManager)){
116 LOG("The SALOME resource manager can't be reached ==> STOP");
117 throw KERNEL::createSalomeException("The SALOME resource manager can't be reached");
120 _lastErrorMessage = "";
123 MeshJobManager_i::~MeshJobManager_i() {
124 LOG("MeshJobManager_i::~MeshJobManager_i()");
128 // ====================================================================
129 // Helper functions to deals with the local and remote file systems
130 // ====================================================================
132 #include <fstream> // to get the file streams
134 #include <stdlib.h> // to get _splitpath
135 #include <direct.h> // to get _mkdir
137 #include <unistd.h> // to get basename
138 #include <libgen.h> // to get basename - as per posix
139 #include <sys/stat.h> // to get mkdir
140 #include <sys/types.h> // to get mkdir options
143 #include <stdlib.h> // to get system and getenv
145 static std::string OUTPUTFILE("output.med");
146 static std::string DATAFILE("data.txt");
147 static std::string SCRIPTFILE("padder.sh");
148 static std::string SEPARATOR(" ");
151 static std::string USER(getenv("USERNAME"));
153 static std::string USER(getenv("USER"));
156 static std::string LOCAL_INPUTDIR("/tmp/spadder.local.inputdir."+USER);
157 static std::string LOCAL_RESULTDIR("/tmp/spadder.local.resultdir."+USER);
158 static std::string REMOTE_WORKDIR("/tmp/spadder.remote.workdir."+USER);
161 * This function creates the padder text input file containing the
162 * input data (list of filenames and groupnames) and returns the path
163 * of the created file. This function is the one that knows the format
164 * of the padder input file. If the input file format changes, then
165 * this function (and only this one) should be updated. The file
166 * format is the following ([] means that the variable is optional):
168 * [<concreteMeshFile> <concreteGroupName>]
169 * nbSteelBarMeshes <N>
170 * <steelBarMeshFile_1> <steelBarGroupName_1>
171 * <steelBarMeshFile_2> <steelBarGroupName_2>
173 * <steelBarMeshFile_N> <steelBarGroupName_N>
176 const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
177 std::vector<MESHJOB::MeshJobFile> listSteelBarMesh,
178 const MESHJOB::MeshJobParameterList & meshJobParameterList) {
180 _mkdir(LOCAL_INPUTDIR.c_str());
182 mkdir(LOCAL_INPUTDIR.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
185 // Make it static so that it's allocated once (constant name)
186 static std::string * dataFilename = new std::string(LOCAL_INPUTDIR+"/"+DATAFILE);
187 std::ofstream dataFile(dataFilename->c_str());
189 // Note that we use here the basename of the files because the files
190 // are supposed to be copied in the REMOTE_WORKDIR for execution.
193 // We first specify the concrete mesh data (filename and groupname)
194 if ( listConcreteMesh.size() > 0 ) {
196 char fname[ _MAX_FNAME ];
197 _splitpath( listConcreteMesh[0].file_name, NULL, NULL, fname, NULL );
198 char* bname = &fname[0];
200 char* bname = basename(listConcreteMesh[0].file_name);
202 line = std::string(bname) + " " + std::string(listConcreteMesh[0].group_name);
203 dataFile << line.c_str() << std::endl;
205 // Then, we can specify the steelbar mesh data, starting by the
207 int nbSteelBarMeshes=listSteelBarMesh.size();
208 line = std::string("nbSteelBarMeshes") + SEPARATOR + ToString(nbSteelBarMeshes);
209 dataFile << line.c_str() << std::endl;
210 for (int i=0; i<nbSteelBarMeshes; i++) {
212 char fname[ _MAX_FNAME ];
213 _splitpath( listSteelBarMesh[i].file_name, NULL, NULL, fname, NULL );
214 char* bname = &fname[0];
216 char* bname = basename(listSteelBarMesh[i].file_name);
218 line = std::string(bname) + " " + std::string(listSteelBarMesh[i].group_name);
219 dataFile << line.c_str() << std::endl;
222 // We conclude the list of files with the name of the output file
224 dataFile << line.c_str() << std::endl;
226 // We put the numerical parameters at the end of the data file
227 for(CORBA::ULong i=0; i<meshJobParameterList.length(); i++) {
228 MESHJOB::MeshJobParameter param = meshJobParameterList[i];
229 line = std::string(param.name) + " " + std::string(param.value);
230 dataFile << line.c_str() << std::endl;
234 return dataFilename->c_str();
238 * This function creates a shell script that runs padder with the
239 * specified data file, and returns the path of the created script
240 * file. The config id is used to retrieve the path to the binary file
241 * and other required files.
243 const char* MeshJobManager_i::_writeScriptFile(const char * dataFileName, const char * configId) {
245 _mkdir(LOCAL_INPUTDIR.c_str());
247 mkdir(LOCAL_INPUTDIR.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
250 // Make it static so that it's allocated once (constant name)
251 static std::string * scriptFilename = new std::string(LOCAL_INPUTDIR+"/"+SCRIPTFILE);
253 char * binpath = _configMap[configId].binpath;
254 char * envpath = _configMap[configId].envpath;
257 char fname[ _MAX_FNAME ];
258 _splitpath( dataFileName, NULL, NULL, fname, NULL );
259 const char* bname = &fname[0];
261 const char* bname = basename(const_cast<char *>(dataFileName));
265 std::ofstream script(scriptFilename->c_str());
266 script << "#!/bin/sh" << std::endl;
267 script << "here=$(dirname $0)" << std::endl;
268 script << ". " << envpath << std::endl;
269 script << binpath << " $here/" << bname << std::endl;
270 // Note that we use the basename of the datafile because all data
271 // files are supposed to have been copied in the REMOTE_WORKDIR.
273 return scriptFilename->c_str();
277 // ====================================================================
278 // Functions to initialize and supervise the mesh computation job
279 // ====================================================================
281 bool MeshJobManager_i::configure(const char *configId,
282 const MESHJOB::ConfigParameter & configParameter)
284 beginService("MeshJobManager_i::configure");
286 _configMap[configId] = configParameter;
288 LOG("Adding configuration for " << configId);
289 LOG("- binpath = " << _configMap[configId].binpath);
290 LOG("- envpath = " << _configMap[configId].envpath);
292 endService("MeshJobManager_i::configure");
296 long MeshJobManager_i::JOBID_UNDEFINED = -1;
298 /*! Initialize a smesh computation job and return the job identifier */
299 CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJobFileList,
300 const MESHJOB::MeshJobParameterList & meshJobParameterList,
301 const char * configId)
303 beginService("MeshJobManager_i::initialize");
305 // We first analyse the CORBA sequence to store data in C++ vectors
307 std::vector<MESHJOB::MeshJobFile> listConcreteMesh;
308 std::vector<MESHJOB::MeshJobFile> listSteelBarMesh;
309 for(CORBA::ULong i=0; i<meshJobFileList.length(); i++) {
310 MESHJOB::MeshJobFile currentMesh = meshJobFileList[i];
311 switch ( currentMesh.file_type ) {
312 case MESHJOB::MED_CONCRETE:
313 listConcreteMesh.push_back(currentMesh);
315 case MESHJOB::MED_STEELBAR:
316 listSteelBarMesh.push_back(currentMesh);
320 std::string("The type of the file ")+
321 std::string(currentMesh.file_name)+
322 std::string(" is not recognized");
323 LOG(_lastErrorMessage);
324 return JOBID_UNDEFINED;
328 // It is not possible to specify more than one concrete
329 // file. Converselly, it is possible to specify no concrete file.
330 if ( listConcreteMesh.size() > 1 ) {
331 // Not consistent with the specification
332 _lastErrorMessage = std::string("You specify more than one concrete mesh (not authorized)");
333 LOG(_lastErrorMessage);
334 return JOBID_UNDEFINED;
337 LOG("Nb. concrete mesh = " << listConcreteMesh.size());
338 LOG("Nb. steelbar mesh = " << listSteelBarMesh.size());
340 // We initiate here a datetime to tag the files and folder
341 // associated to this job.
343 DWORD jobDatetimeTag = timeGetTime();
345 long jobDatetimeTag = timetag();
347 // And a MESHJOB::MeshJobPaths structure to hold the directories
348 // where to find data
349 MESHJOB::MeshJobPaths * jobPaths = new MESHJOB::MeshJobPaths();
350 jobPaths->local_inputdir = LOCAL_INPUTDIR.c_str();
351 jobPaths->local_resultdir = (LOCAL_RESULTDIR + "." + ToString(jobDatetimeTag)).c_str();
352 jobPaths->remote_workdir = (REMOTE_WORKDIR + "." + ToString(jobDatetimeTag)).c_str();
355 // Then, we have to create the padder input data file. This input
356 // data is a text file containing the list of file names and group
359 const char * dataFilename = this->_writeDataFile(listConcreteMesh, listSteelBarMesh, meshJobParameterList);
360 LOG("dataFilename = " << dataFilename);
361 const char * scriptFilename = this->_writeScriptFile(dataFilename, configId);
362 LOG("scriptFilename = " << scriptFilename);
365 // Then, the following instructions consists in preparing the job
366 // parameters to request the SALOME launcher for creating a new
369 Engines::JobParameters_var jobParameters = new Engines::JobParameters;
370 jobParameters->job_type = CORBA::string_dup("command");
371 // CAUTION: the job_file must be a single filename specifying a
372 // self-consistent script to be executed without any argument on the
374 jobParameters->job_file = CORBA::string_dup(scriptFilename);
377 // Specification of the working spaces:
379 // - local_directory: can be used to specify where to find the input
380 // files on the local resource. It's optional if you specify the
381 // absolute path name of input files.
383 // - result_directory: must be used to specify where to download the
384 // output files on the local resources
386 // - work_directory: must be used to specify the remote directory
387 // where to put all the stuff to run the job. Note that the job
388 // will be executed from within this directory, i.e. a change
389 // directory toward this working directory is done by the batch
390 // system before running the specified job script.
392 jobParameters->local_directory = CORBA::string_dup("");
393 jobParameters->result_directory = CORBA::string_dup(jobPaths->local_resultdir);
394 jobParameters->work_directory = CORBA::string_dup(jobPaths->remote_workdir);
396 // We specify the input files that are required to execute the
397 // job_file. If basenames are specified, then the files are supposed
398 // to be located in local_directory.
399 int nbcmesh = listConcreteMesh.size();
400 int nbsmesh = listSteelBarMesh.size();
401 int nbFiles = nbsmesh+nbcmesh+1;
402 // The number of input file is:
403 // (nb. of steelbar meshfile)
404 // + (1 or 0 concrete meshfile)
405 // + (1 padder input file)
406 jobParameters->in_files.length(nbFiles);
407 for (int i=0; i<nbcmesh; i++) {
408 jobParameters->in_files[i] = CORBA::string_dup(listConcreteMesh[i].file_name);
410 for (int i=0; i<nbsmesh; i++) {
411 jobParameters->in_files[nbcmesh+i] = CORBA::string_dup(listSteelBarMesh[i].file_name);
413 jobParameters->in_files[nbcmesh+nbsmesh] = CORBA::string_dup(dataFilename);
414 // Note that all these input files will be copied in the
415 // REMOTE_WORKDIR on the remote host. At this step, they should
416 // all exist, so we can check their presence on the local
418 for (int i=0; i<nbFiles; i++) {
419 if ( fexists(jobParameters->in_files[i]) != true ) {
420 _lastErrorMessage = std::string("The input file ") + std::string(jobParameters->in_files[i]);
421 _lastErrorMessage+= std::string(" does not exists. Can't initialize the job");
422 LOG(_lastErrorMessage);
423 return JOBID_UNDEFINED;
427 // Then, we have to specify the existence of an output filename. The
428 // path is supposed to be a path on the remote resource, i.e. where
429 // the job is executed.
430 jobParameters->out_files.length(1);
431 std::string outputfile_name = std::string(jobPaths->remote_workdir)+"/"+OUTPUTFILE;
432 jobParameters->out_files[0] = CORBA::string_dup(outputfile_name.c_str());
434 // CAUTION: the maximum duration has to be set with a format like "hh:mm"
435 //jobParameters->maximum_duration = CORBA::string_dup("01:00");
436 jobParameters->queue = CORBA::string_dup("");
438 // Setting resource and additional properties (if needed)
439 // The resource parameters can be initiated from scratch, for
440 // example by specifying the values in hard coding:
442 //jobParameters->resource_required.name = CORBA::string_dup("localhost");
443 //jobParameters->resource_required.hostname = CORBA::string_dup("localhost");
444 //jobParameters->resource_required.mem_mb = 1024 * 10;
445 //jobParameters->resource_required.nb_proc = 1;
447 // But it's better to initiate these parameters from a resource
448 // definition known by the resource manager. This ensures that the
449 // resource will be available:
450 //const char * resourceName = "localhost";
451 //const char * resourceName = "boulant@claui2p1";
452 //const char * resourceName = "nepal@nepal";
453 const char * resourceName = _configMap[configId].resname;
455 Engines::ResourceDefinition * resourceDefinition;
457 resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
459 catch (const CORBA::SystemException& ex) {
460 _lastErrorMessage = std::string("We can not access the resource ") + std::string(resourceName);
461 _lastErrorMessage+= std::string("(check the file CatalogResource.xml)");
462 LOG(_lastErrorMessage);
463 return JOBID_UNDEFINED;
465 // CAUTION: This resource should have been defined in the
466 // CatalogResource.xml associated to the SALOME application.
468 // Then, the values can be used to initiate the resource parameters
470 jobParameters->resource_required.name = CORBA::string_dup(resourceDefinition->name.in());
471 // CAUTION: the additional two following parameters MUST be
472 // specified explicitly, because they are not provided by the
473 // resource definition:
474 jobParameters->resource_required.mem_mb = resourceDefinition->mem_mb;
475 jobParameters->resource_required.nb_proc = resourceDefinition->nb_proc_per_node;
476 // CAUTION: the parameter mem_mb specifies the maximum memory value
477 // that could be allocated for executing the job. This takes into
478 // account not only the data that could be loaded by the batch
479 // process but also the linked dynamic library.
481 // A possible problem, for example in the case where you use the ssh
482 // emulation of a batch system, is to get an error message as below
483 // when libBatch try to run the ssh command:
485 // ## /usr/bin/ssh: error while loading shared libraries: libcrypto.so.0.9.8: failed
486 // ## to map segment from shared object: Cannot allocate memory
488 // In this example, the mem_mb was set to 1MB, value that is not
489 // sufficient to load the dynamic libraries linked to the ssh
490 // executable (libcrypto.so in the error message).
492 // So, even in the case of a simple test shell script, you should
493 // set this value at least to a standard threshold as 500MB
494 int jobId = JOBID_UNDEFINED;
496 jobId = _salomeLauncher->createJob(jobParameters);
497 // We register the datetime tag of this job
498 _jobDateTimeMap[jobId]=jobDatetimeTag;
499 _jobPathsMap[jobId] = jobPaths;
501 catch (const SALOME::SALOME_Exception & ex) {
502 LOG("SALOME Exception at initialization step !" <<ex.details.text.in());
503 _lastErrorMessage = ex.details.text.in();
504 return JOBID_UNDEFINED;
506 catch (const CORBA::SystemException& ex) {
507 LOG("Receive SALOME System Exception: "<<ex);
508 LOG("Check SALOME servers...");
509 _lastErrorMessage = "Check the SALOME servers (or try to restart SALOME)";
510 return JOBID_UNDEFINED;
513 endService("MeshJobManager_i::initialize");
517 /*! Submit the job execution and return true if submission is OK */
518 bool MeshJobManager_i::start(CORBA::Long jobId) {
519 beginService("MeshJobManager_i::start");
522 _salomeLauncher->launchJob(jobId);
524 catch (const SALOME::SALOME_Exception & ex) {
525 LOG("SALOME Exception in launchjob !" <<ex.details.text.in());
526 _lastErrorMessage = ex.details.text.in();
529 catch (const CORBA::SystemException& ex) {
530 LOG("Receive SALOME System Exception: "<<ex);
531 LOG("Check SALOME servers...");
532 _lastErrorMessage = "Check the SALOME servers (or try to restart SALOME)";
536 endService("MeshJobManager_i::initialize");
540 /*! Request the launch manager for the state of the specified job */
541 char* MeshJobManager_i::getState(CORBA::Long jobId) {
542 beginService("MeshJobManager_i::getState");
547 state = _salomeLauncher->getJobState(jobId);
549 catch (const SALOME::SALOME_Exception & ex)
551 LOG("SALOME Exception in getJobState !");
552 _lastErrorMessage = ex.details.text.in();
553 state = ex.details.text;
555 catch (const CORBA::SystemException& ex)
557 LOG("Receive SALOME System Exception: " << ex);
558 state="SALOME System Exception - see logs";
560 LOG("jobId="<<ToString(jobId)<<" state="<<state);
561 endService("MeshJobManager_i::getState");
562 return CORBA::string_dup(state.c_str());
565 MESHJOB::MeshJobPaths * MeshJobManager_i::getPaths(CORBA::Long jobId) {
567 MESHJOB::MeshJobPaths * jobPaths = _jobPathsMap[jobId];
568 if ( jobPaths == NULL ) {
569 LOG("You request the working paths for an undefined job (jobId="<<ToString(jobId)<<")");
570 return NULL; // Maybe raise an exception?
576 MESHJOB::MeshJobResults * MeshJobManager_i::finalize(CORBA::Long jobId) {
577 beginService("MeshJobManager_i::getResults");
578 MESHJOB::MeshJobResults * result = new MESHJOB::MeshJobResults();
580 MESHJOB::MeshJobPaths * jobPaths = this->getPaths(jobId);
581 std::string local_resultdir(jobPaths->local_resultdir);
582 result->results_dirname = local_resultdir.c_str();
585 _salomeLauncher->getJobResults(jobId, local_resultdir.c_str());
587 // __BUG__: to prevent from a bug of the MED driver (SALOME
588 // 5.1.5), we change the basename of the output file to force the
589 // complete reloading of data by the med driver.
590 long jobDatetimeTag = _jobDateTimeMap[jobId];
591 std::string outputFileName = "output"+ToString(jobDatetimeTag)+".med";
592 rename((local_resultdir+"/"+OUTPUTFILE).c_str(), (local_resultdir+"/"+outputFileName).c_str());
594 result->outputmesh_filename = outputFileName.c_str();
596 if ( fexists( (local_resultdir+"/"+outputFileName).c_str() ) != true ) {
597 _lastErrorMessage = std::string("The result file ")+
598 std::string((local_resultdir+"/"+outputFileName).c_str())+
599 std::string(" has not been created.");
600 result->status = false;
603 result->status = true;
606 catch (const SALOME::SALOME_Exception & ex)
608 _lastErrorMessage = ex.details.text.in();
609 LOG(_lastErrorMessage);
610 result->status = false;
612 catch (const CORBA::SystemException& ex)
614 _lastErrorMessage = "The SALOME launcher can not retrieve the result data";
615 LOG(_lastErrorMessage);
616 result->status = false;
618 endService("MeshJobManager_i::getResults");
623 /*! Clean all data associated to this job and remove the job from the launch manager */
624 bool MeshJobManager_i::clean(CORBA::Long jobId) {
625 beginService("MeshJobManager_i::clean");
627 // __GBO__ WORK IN PROGRESS: we just clean the temporary local
628 // directories. The remote working directories are tag with the
629 // execution datetime and the we prevent the task from conflict
630 // with files of another task.
631 MESHJOB::MeshJobPaths * jobPaths = this->getPaths(jobId);
632 if ( jobPaths == NULL ) return false;
635 // For safety reason (and prevent from bug that could erase the
636 // filesystem), we cancel the operation in the case where the
637 // directories to delete are not in the /tmp folder.
638 std::string shell_command("rm -rf ");
639 std::string inputdir(jobPaths->local_inputdir);
640 std::string resultdir(jobPaths->local_resultdir);
641 if ( !myStartsWith(inputdir,"/tmp/") ) {
642 LOG("WRN: The directory "<<inputdir<<" is not in /tmp. NO DELETE is done");
644 shell_command+=inputdir+" ";
646 if ( !myStartsWith(resultdir,"/tmp/")) {
647 LOG("WRN: The directory "<<resultdir<<" is not in /tmp. NO DELETE is done");
649 shell_command+=resultdir;
652 LOG("DBG: clean shell command = "<<shell_command);
654 bool cleanOk = false;
655 int error = system(shell_command.c_str());
656 if (error == 0) cleanOk = true;
658 endService("MeshJobManager_i::clean");
663 std::vector<std::string> * MeshJobManager_i::_getResourceNames() {
666 // These part is just to control the available resources
668 Engines::ResourceParameters params;
669 KERNEL::getLifeCycleCORBA()->preSet(params);
671 Engines::ResourceList * resourceList = _resourcesManager->GetFittingResources(params);
672 Engines::ResourceDefinition * resourceDefinition = NULL;
673 LOG("### resource list:");
674 std::vector<std::string>* resourceNames = new std::vector<std::string>();
676 for ( size_t i = 0; i < resourceList->length(); i++) {
677 const char* aResourceName = (*resourceList)[i];
678 resourceNames->push_back(std::string(aResourceName));
679 LOG("resource["<<i<<"] = "<<aResourceName);
680 resourceDefinition = _resourcesManager->GetResourceDefinition(aResourceName);
681 LOG("protocol["<<i<<"] = "<<resourceDefinition->protocol);
682 (void)resourceDefinition; // unused in release mode
686 // Note: a ResourceDefinition is used to create a batch configuration
687 // in the Launcher. This operation is done at Launcher startup from
688 // the configuration file CatalogResources.xml provided by the
689 // SALOME application.
690 // In the code instructions, you just have to choose a resource
691 // configuration by its name and then define the ResourceParameters
692 // that specify additional properties for a specific job submission
693 // (use the attribute resource_required of the JobParameters).
695 return resourceNames;
698 char* MeshJobManager_i::getLastErrorMessage() {
699 beginService("MeshJobManager_i::getState");
700 endService("MeshJobManager_i::getState");
701 return CORBA::string_dup(_lastErrorMessage.c_str());
705 // ==========================================================================
707 // ==========================================================================
711 MESHJOBMANAGERENGINE_EXPORT
712 PortableServer::ObjectId * MeshJobManagerEngine_factory( CORBA::ORB_ptr orb,
713 PortableServer::POA_ptr poa,
714 PortableServer::ObjectId * contId,
715 const char *instanceName,
716 const char *interfaceName)
718 LOG("PortableServer::ObjectId * MeshJobManagerEngine_factory()");
719 MeshJobManager_i * myEngine = new MeshJobManager_i(orb, poa, contId, instanceName, interfaceName);
720 return myEngine->getId() ;