Salome HOME
e6e5936e76fe3ef36c45a13c509aa9439193f020
[modules/kernel.git] / src / LifeCycleCORBA / SALOME_LifeCycleCORBA.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
23 //  File   : SALOME_LifeCycleCORBA.cxx
24 //  Author : Paul RASCLE, EDF
25 //  Module : SALOME
26 //  $Header$
27 //
28 #include <iostream>
29 #include <fstream>
30 #include <sstream>
31 #include <iomanip>
32
33 #include <time.h>
34 #ifndef WIN32
35   #include <sys/time.h>
36 #endif
37
38 #include "Basics_Utils.hxx"
39 #include "utilities.h"
40
41 #include <ServiceUnreachable.hxx>
42
43 #include "SALOME_LifeCycleCORBA.hxx"
44 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
45 #include CORBA_CLIENT_HEADER(SALOME_Session)
46 #include CORBA_CLIENT_HEADER(DSC_Engines)
47 #include CORBA_CLIENT_HEADER(SALOME_Registry)
48 #include CORBA_CLIENT_HEADER(SALOMEDS)
49 #include CORBA_CLIENT_HEADER(Logger)
50
51 #include "SALOME_ContainerManager.hxx"
52 #include "SALOME_Component_i.hxx"
53 #include "SALOME_NamingService.hxx"
54
55 using namespace std;
56
57 IncompatibleComponent::IncompatibleComponent( void ):
58   SALOME_Exception( "IncompatibleComponent" )
59 {
60 }
61
62 IncompatibleComponent::IncompatibleComponent(const IncompatibleComponent &ex):
63   SALOME_Exception( ex ) 
64 {
65 }
66
67 //=============================================================================
68 /*! 
69  *  Constructor
70  */
71 //=============================================================================
72
73 SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
74 {
75   // be sure to have an instance of traceCollector, when used via SWIG
76   // in a Python module
77   int argc = 0;
78   char *xargv = (char*)"";
79   char **argv = &xargv;
80   CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
81   //  LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
82   if (!ns)
83     {
84       _NS = new SALOME_NamingService(orb);
85     }
86   else _NS = ns;
87   //add try catch
88   _NS->Change_Directory("/"); // mpv 250105: current directory may be not root 
89                               // (in SALOMEDS for an example)
90   // not enough: set a current directory in naming service is not thread safe
91   // if naming service instance is shared among several threads...
92   // ==> allways use absolute path and dot rely on current directory!
93
94   CORBA::Object_var obj =
95     _NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
96   ASSERT( !CORBA::is_nil(obj));
97   _ContManager=Engines::ContainerManager::_narrow(obj);
98
99   obj = _NS->Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
100   ASSERT( !CORBA::is_nil(obj));
101   _ResManager=Engines::ResourcesManager::_narrow(obj);
102 }
103
104 //=============================================================================
105 /*! 
106  *  Destructor
107  */
108 //=============================================================================
109
110 SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
111 {
112 }
113
114 //=============================================================================
115 /*! Public - 
116  *  Find and aready existing and registered component instance.
117  *  \param params         machine parameters like type or name...
118  *  \param componentName  the name of component class
119  *  \param studyId        default = 0  : multistudy instance
120  *  \return a CORBA reference of the component instance, or _nil if not found
121  */
122 //=============================================================================
123
124 Engines::Component_ptr
125 SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params,
126                                      const char *componentName,
127                                      int studyId)
128 {
129   if (! isKnownComponentClass(componentName))
130     return Engines::Component::_nil();
131
132   Engines::CompoList clist;
133   clist.length(1);
134   clist[0] = componentName;
135   Engines::MachineList_var listOfMachines =
136     _ResManager->GetFittingResources(params, clist);
137
138   Engines::Component_var compo = _FindComponent(params,
139                                                 componentName,
140                                                 studyId,
141                                                 listOfMachines);
142
143   return compo._retn();
144 }
145
146 //=============================================================================
147 /*! Public - 
148  *  Load a component instance on a container defined by machine parameters
149  *  \param params         machine parameters like type or name...
150  *  \param componentName  the name of component class
151  *  \param studyId        default = 0  : multistudy instance
152  *  \return a CORBA reference of the component instance, or _nil if problem
153  */
154 //=============================================================================
155
156 Engines::Component_ptr
157 SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params,
158                                      const char *componentName,
159                                      int studyId)
160 {
161   // --- Check if Component Name is known in ModuleCatalog
162
163   if (! isKnownComponentClass(componentName))
164     return Engines::Component::_nil();
165
166   Engines::CompoList clist;
167   clist.length(1);
168   clist[0] = componentName;
169   Engines::MachineList_var listOfMachines =
170     _ResManager->GetFittingResources(params, clist);
171
172   Engines::Component_var compo = _LoadComponent(params,
173                                                 componentName,
174                                                 studyId,
175                                                 listOfMachines);
176
177   return compo._retn();
178 }
179
180 //=============================================================================
181 /*! Public - 
182  *  Find and aready existing and registered component instance or load a new
183  *  component instance on a container defined by machine parameters.
184  *  \param params         machine parameters like type or name...
185  *  \param componentName  the name of component class
186  *  \param studyId        default = 0  : multistudy instance
187  *  \return a CORBA reference of the component instance, or _nil if problem
188  */
189 //=============================================================================
190
191 Engines::Component_ptr
192 SALOME_LifeCycleCORBA::
193 FindOrLoad_Component(const Engines::MachineParameters& params,
194                      const char *componentName,
195                      int studyId)
196 {
197   // --- Check if Component Name is known in ModuleCatalog
198
199   if (! isKnownComponentClass(componentName))
200     return Engines::Component::_nil();
201
202   Engines::CompoList clist;
203   clist.length(1);
204   clist[0] = componentName;
205   Engines::MachineList_var listOfMachines =
206     _ResManager->GetFittingResources(params,clist);
207
208   Engines::Component_var compo = _FindComponent(params,
209                                                 componentName,
210                                                 studyId,
211                                                 listOfMachines);
212
213   if(CORBA::is_nil(compo))
214     compo = _LoadComponent(params,
215                            componentName,
216                            studyId,
217                            listOfMachines);
218
219   return compo._retn();
220 }
221
222 //=============================================================================
223 /*! Public - 
224  *  Find and aready existing and registered component instance or load a new
225  *  component instance on a container defined by name
226  *  \param containerName  the name of container, under one of the forms
227  *           - 1 aContainer (local container)
228  *           - 2 machine/aContainer (container on hostname = machine)
229  *  \param componentName  the name of component class
230  *  \return a CORBA reference of the component instance, or _nil if problem
231  */
232 //=============================================================================
233
234 Engines::Component_ptr
235 SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName,
236                                             const char *componentName)
237 {
238   char *valenv=getenv("SALOME_BATCH");
239   if(valenv)
240     if (strcmp(valenv,"1")==0)
241       {
242         MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component BATCH " << containerName << " " << componentName ) ;
243         _NS->Change_Directory("/Containers");
244         CORBA::Object_ptr obj=_NS->Resolve(containerName);
245         Engines::Container_var cont=Engines::Container::_narrow(obj);
246         bool isLoadable = cont->load_component_Library(componentName);
247         if (!isLoadable) return Engines::Component::_nil();
248         
249         Engines::Component_ptr myInstance =
250           cont->create_component_instance(componentName, 0);
251         return myInstance;
252       }
253   MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component INTERACTIF " << containerName << " " << componentName ) ;
254   //#if 0
255   // --- Check if Component Name is known in ModuleCatalog
256
257   if (! isKnownComponentClass(componentName))
258     return Engines::Component::_nil();
259
260   // --- Check if containerName contains machine name (if yes: rg>0)
261
262   char *stContainer=strdup(containerName);
263   string st2Container(stContainer);
264   int rg=st2Container.find("/");
265
266   Engines::MachineParameters_var params=new Engines::MachineParameters;
267   preSet(params);
268   if (rg<0)
269     {
270       // containerName doesn't contain "/" => Local container
271       params->container_name=CORBA::string_dup(stContainer);
272       params->hostname=CORBA::string_dup(Kernel_Utils::GetHostname().c_str());
273     }
274   else 
275     {
276       stContainer[rg]='\0';
277       params->container_name=CORBA::string_dup(stContainer+rg+1);
278       params->hostname=CORBA::string_dup(stContainer);
279     }
280   params->isMPI = false;
281   SCRUTE(params->container_name);
282 //   SCRUTE(params->hostname);
283 //   SCRUTE(params->OS);
284 //   SCRUTE(params->mem_mb);
285 //   SCRUTE(params->cpu_clock);
286 //   SCRUTE(params->nb_proc_per_node);
287 //   SCRUTE(params->nb_node);
288 //   SCRUTE(params->isMPI);
289   free(stContainer);
290   return FindOrLoad_Component(params,componentName);
291   //#endif  
292 }
293
294 //=============================================================================
295 /*! Public -
296  *  Check if the component class is known in module catalog
297  *  \param componentName  the name of component class
298  *  \return true if found, false otherwise
299  */
300 //=============================================================================
301
302 bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName)
303 {
304
305   try
306     {
307       CORBA::Object_var obj = _NS->Resolve("/Kernel/ModulCatalog");
308       SALOME_ModuleCatalog::ModuleCatalog_var Catalog = 
309         SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
310       ASSERT(! CORBA::is_nil(Catalog));
311       SALOME_ModuleCatalog::Acomponent_var compoInfo = 
312         Catalog->GetComponent(componentName);
313       if (CORBA::is_nil (compoInfo)) 
314         {
315           INFOS("Catalog Error: Component not found in the catalog" );
316           INFOS( componentName );         
317           return false;
318         }
319       else return true;
320     }
321   catch (ServiceUnreachable&)
322     {
323       INFOS("Caught exception: Naming Service Unreachable");
324     }
325   catch (...)
326     {
327       INFOS("Caught unknown exception.");
328     }
329   return false;
330 }
331
332 //=============================================================================
333 /*! Public -
334  *  Not so complex... useful ?
335  */
336 //=============================================================================
337
338 bool 
339 SALOME_LifeCycleCORBA::isMpiContainer(const Engines::MachineParameters& params)
340   throw(IncompatibleComponent)
341 {
342   if( params.isMPI )
343     return true;
344   else
345     return false;
346 }
347
348
349 //=============================================================================
350 /*! Public -
351  *  Pre initialisation of a given Engines::MachineParameters with default
352  *  values.
353  *  - container_name = ""  : not relevant
354  *  - hostname = ""        : not relevant
355  *  - OS = ""              : not relevant
356  *  - mem_mb = 0           : not relevant
357  *  - cpu_clock = 0        : not relevant
358  *  - nb_proc_per_node = 0 : not relevant
359  *  - nb_node = 0          : not relevant
360  *  - isMPI = false        : standard components
361  */
362 //=============================================================================
363
364 void SALOME_LifeCycleCORBA::preSet( Engines::MachineParameters& params)
365 {
366   params.container_name = "";
367   params.hostname = "";
368   params.OS = "";
369   params.mem_mb = 0;
370   params.cpu_clock = 0;
371   params.nb_proc_per_node = 0;
372   params.nb_node = 0;
373   params.isMPI = false;
374
375   params.parallelLib = "";
376   params.nb_component_nodes = 0;
377 }
378
379 //=============================================================================
380 /*! Public -
381  *  \return a number of processors not 0, only for MPI containers
382  */
383 //=============================================================================
384
385 int SALOME_LifeCycleCORBA::NbProc(const Engines::MachineParameters& params)
386 {
387   if( !isMpiContainer(params) )
388     return 0;
389   else if( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
390     return 1;
391   else if( params.nb_node == 0 )
392     return params.nb_proc_per_node;
393   else if( params.nb_proc_per_node == 0 )
394     return params.nb_node;
395   else
396     return params.nb_node * params.nb_proc_per_node;
397 }
398
399 //=============================================================================
400 /*! Public -
401  *  \return the container Manager
402  */
403 //=============================================================================
404
405 Engines::ContainerManager_ptr SALOME_LifeCycleCORBA::getContainerManager()
406 {
407  Engines::ContainerManager_var contManager =
408    Engines::ContainerManager::_duplicate(_ContManager);
409  return contManager._retn();
410 }
411
412 //=============================================================================
413 /*! Public -
414  *  \return the container Manager
415  */
416 //=============================================================================
417
418 Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager()
419 {
420  Engines::ResourcesManager_var resManager =
421    Engines::ResourcesManager::_duplicate(_ResManager);
422  return resManager._retn();
423 }
424
425 //=============================================================================
426 /*! Public -
427  *  shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd
428  */
429 //=============================================================================
430
431 void SALOME_LifeCycleCORBA::shutdownServers()
432 {
433   // get each Container from NamingService => shutdown it
434   // (the order is inverse to the order of servers initialization)
435   
436   SALOME::Session_var session = SALOME::Session::_nil();
437   CORBA::Long pid = 0;
438   CORBA::Object_var objS = _NS->Resolve("/Kernel/Session");
439   if (!CORBA::is_nil(objS))
440     {
441       session = SALOME::Session::_narrow(objS);
442       if (!CORBA::is_nil(session))
443         {
444           pid = session->getPID();
445           session->ping();
446         }
447     }
448
449   string hostname = Kernel_Utils::GetHostname();
450   
451   // 1) SalomeLauncher
452   CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
453   Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL);
454   if (!CORBA::is_nil(launcher) && (pid != launcher->getPID()))
455     launcher->Shutdown();
456   
457   // 2) ConnectionManager
458   CORBA::Object_var objCnM=_NS->Resolve("/ConnectionManager");
459   Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM);
460   if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) )
461     connMan->ShutdownWithExit();
462   
463   // 3) SALOMEDS
464   CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager");
465   SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
466   if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) )
467     studyManager->Shutdown();
468   
469   // 4) ModuleCatalog
470   CORBA::Object_var objMC=_NS->Resolve("/Kernel/ModulCatalog");
471   SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC);
472   if ( !CORBA::is_nil(catalog) && ( pid != catalog->getPID() ) )
473     catalog->shutdown();
474   
475   // 5) Registry
476   CORBA::Object_var objR = _NS->Resolve("/Registry");
477   Registry::Components_var registry = Registry::Components::_narrow(objR);
478   if ( !CORBA::is_nil(registry) && ( pid != registry->getPID() ) )
479       registry->Shutdown();
480
481   // 6) Logger
482   int argc = 0;
483   char *xargv = (char*)"";
484   char **argv = &xargv;
485   CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
486
487   CORBA::Object_var objLog = CORBA::Object::_nil();
488   CosNaming::NamingContext_var inc;
489   CORBA::Object_var theObj = CORBA::Object::_nil();
490   std::string stdname = "Logger";
491   CosNaming::Name name;
492   name.length(1);
493   name[0].id = CORBA::string_dup(stdname.c_str());
494   try
495     { 
496       if(!CORBA::is_nil(orb)) 
497         theObj = orb->resolve_initial_references("NameService");
498       if (!CORBA::is_nil(theObj))
499         inc = CosNaming::NamingContext::_narrow(theObj);
500     }
501   catch(...)
502     {
503     }
504   if(!CORBA::is_nil(inc)) {
505     try
506       {
507         objLog = inc->resolve(name);
508         SALOME_Logger::Logger_var logger = SALOME_Logger::Logger::_narrow(objLog);
509         if ( !CORBA::is_nil(logger) )
510           logger->shutdown();
511       }
512     catch(...)
513       {
514       }
515   }
516 }
517
518 //=============================================================================
519 /*! Public -
520  *  shutdown  omniNames and notifd
521  */
522 //=============================================================================
523
524 void SALOME_LifeCycleCORBA::killOmniNames()
525 {
526   string portNumber (::getenv ("NSPORT") );
527   if ( !portNumber.empty() ) 
528     {
529       string cmd ;
530       cmd = string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*")
531         + portNumber
532         + string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" );
533       MESSAGE(cmd);
534       try {
535         system ( cmd.c_str() );
536       }
537       catch ( ... ) {
538       }
539     }
540   
541   // NPAL 18309  (Kill Notifd)
542   if ( !portNumber.empty() ) 
543     {
544       string cmd = ("from killSalomeWithPort import killNotifdAndClean; ");
545       cmd += string("killNotifdAndClean(") + portNumber + "); ";
546       cmd  = string("python -c \"") + cmd +"\" >& /dev/null";
547       MESSAGE(cmd);
548       system( cmd.c_str() );
549     }
550 }
551
552 //=============================================================================
553 /*! Protected -
554  *  Find and aready existing and registered component instance.
555  *  \param params         machine parameters like type or name...
556  *  \param componentName  the name of component class
557  *  \param studyId        default = 0  : multistudy instance
558  *  \param listOfMachines list of machine address
559  *  \return a CORBA reference of the component instance, or _nil if not found
560  * - build a list of machines on which an instance of the component is running,
561  * - find the best machine among the list
562  */
563 //=============================================================================
564
565 Engines::Component_ptr
566 SALOME_LifeCycleCORBA::
567 _FindComponent(const Engines::MachineParameters& params,
568                const char *componentName,
569                int studyId,
570                const Engines::MachineList& listOfMachines)
571 {
572   // --- build the list of machines on which the component is already running
573
574   const char *containerName = params.container_name;
575   int nbproc = NbProc(params);
576 //   MESSAGE("_FindComponent, required " << containerName <<
577 //        " " << componentName << " " << nbproc);
578
579   Engines::MachineList_var machinesOK = new Engines::MachineList;
580
581   unsigned int lghtOfmachinesOK = 0;
582   machinesOK->length(listOfMachines.length());
583
584   for(unsigned int i=0; i<listOfMachines.length(); i++)
585     {
586       const char *currentMachine=listOfMachines[i];
587 //       MESSAGE("_FindComponent, look at " << currentMachine);
588       CORBA::Object_var obj = _NS->ResolveComponent(currentMachine,
589                                                     containerName,
590                                                     componentName,
591                                                     nbproc);
592       if (!CORBA::is_nil(obj))
593         machinesOK[lghtOfmachinesOK++] = CORBA::string_dup(currentMachine);
594     }
595
596   // --- find the best machine among the list
597
598   if(lghtOfmachinesOK != 0)
599     {
600       machinesOK->length(lghtOfmachinesOK);
601       CORBA::String_var bestMachine = _ResManager->FindFirst(machinesOK);
602       CORBA::Object_var obj = _NS->ResolveComponent(bestMachine,
603                                                     containerName,
604                                                     componentName,
605                                                     nbproc);
606       return Engines::Component::_narrow(obj);
607     }
608   else
609     return Engines::Component::_nil();
610 }
611
612 //=============================================================================
613 /*! Protected -
614  *  Load a component instance.
615  *  \param params         machine parameters like type or name...
616  *  \param componentName  the name of component class
617  *  \param studyId        default = 0  : multistudy instance
618  *  \param listOfMachines list of machine address
619  *  \return a CORBA reference of the component instance, or _nil if problem
620  *  - Finds a container in the list of machine or start one.
621  *  - Try to load the component library in the container,
622  *  - then create an instance of the component.
623  */
624 //=============================================================================
625
626 Engines::Component_ptr 
627 SALOME_LifeCycleCORBA::
628 _LoadComponent(const Engines::MachineParameters& params, 
629               const char *componentName,
630               int studyId,
631               const Engines::MachineList& listOfMachines)
632 {
633   MESSAGE("_LoadComponent, required " << params.container_name <<
634           " " << componentName << " " << NbProc(params));
635
636   Engines::Container_var cont =
637     _ContManager->FindOrStartContainer(params,
638                                        listOfMachines);
639   if (CORBA::is_nil(cont)) return Engines::Component::_nil();
640
641   bool isLoadable = cont->load_component_Library(componentName);
642   if (!isLoadable) return Engines::Component::_nil();
643
644   Engines::Component_var myInstance =
645     cont->create_component_instance(componentName, studyId);
646   return myInstance._retn();
647 }
648
649 Engines::Component_ptr
650 SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::MachineParameters& params,
651                                               const char *componentName,
652                                               int studyId)
653 {
654   MESSAGE("Entering LoadParallelComponent");
655
656 /*MESSAGE("Parameters : ");
657   MESSAGE("Container name : " << params.container_name);
658   MESSAGE("Number of component nodes : " << params.nb_component_nodes);
659   MESSAGE("Component Name : " << componentName);*/
660
661   Engines::CompoList clist;
662   clist.length(1);
663   clist[0] = componentName;
664   MESSAGE("Building a list of machines");
665   Engines::MachineList_var listOfMachines = _ResManager->GetFittingResources(params, clist);
666   if (listOfMachines->length() == 0)
667   {
668     INFOS("No matching machines founded !");
669     return Engines::Component::_nil();
670   }
671
672   MESSAGE("Starting Parallel Container");
673   Engines::Container_var cont = _ContManager->FindOrStartParallelContainer(params, listOfMachines);
674   if (CORBA::is_nil(cont)) {
675     INFOS("FindOrStartParallelContainer() returns a NULL container !");
676     return Engines::Component::_nil();
677   }
678
679   MESSAGE("Loading component library");
680   bool isLoadable = cont->load_component_Library(componentName);
681   if (!isLoadable) {
682     INFOS(componentName <<" library is not loadable !");
683     return Engines::Component::_nil();
684   }
685
686   MESSAGE("Creating component instance");
687   // @PARALLEL@ permits to identify that the component requested
688   // is a parallel component.
689   string name = string(componentName) + string("@PARALLEL@");
690   Engines::Component_var myInstance = cont->create_component_instance(name.c_str(), studyId);
691   if (CORBA::is_nil(myInstance))
692     INFOS("create_component_instance returns a NULL component !");
693   return myInstance._retn();
694 }
695