1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
24 // File : SALOME_LifeCycleCORBA.cxx
25 // Author : Paul RASCLE, EDF
40 #include "Basics_Utils.hxx"
41 #include "utilities.h"
43 #include <ServiceUnreachable.hxx>
45 #include "SALOME_LifeCycleCORBA.hxx"
46 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
47 #include CORBA_CLIENT_HEADER(SALOME_Session)
48 #include CORBA_CLIENT_HEADER(DSC_Engines)
49 #include CORBA_CLIENT_HEADER(SALOME_Registry)
50 #include CORBA_CLIENT_HEADER(SALOMEDS)
51 #include CORBA_CLIENT_HEADER(Logger)
53 #include "SALOME_ContainerManager.hxx"
54 #include "SALOME_Component_i.hxx"
55 #include "SALOME_NamingService.hxx"
56 #include "SALOME_FileTransferCORBA.hxx"
58 IncompatibleComponent::IncompatibleComponent( void ):
59 SALOME_Exception( "IncompatibleComponent" )
63 IncompatibleComponent::IncompatibleComponent(const IncompatibleComponent &ex):
64 SALOME_Exception( ex )
68 /*! \class SALOME_LifeCycleCORBA
69 \brief A class to manage life cycle of SALOME components.
73 //=============================================================================
77 //=============================================================================
79 SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
81 // be sure to have an instance of traceCollector, when used via SWIG
84 char *xargv = (char*)"";
86 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
87 // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
91 _NS = new SALOME_NamingService(orb);
96 _NS->Change_Directory("/"); // mpv 250105: current directory may be not root
97 // (in SALOMEDS for an example)
98 // not enough: set a current directory in naming service is not thread safe
99 // if naming service instance is shared among several threads...
100 // ==> allways use absolute path and dot rely on current directory!
102 CORBA::Object_var obj =
103 _NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
104 ASSERT( !CORBA::is_nil(obj));
105 _ContManager=Engines::ContainerManager::_narrow(obj);
107 obj = _NS->Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
108 ASSERT( !CORBA::is_nil(obj));
109 _ResManager=Engines::ResourcesManager::_narrow(obj);
112 //=============================================================================
116 //=============================================================================
118 SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
120 if(_NSnew)delete _NSnew;
123 //=============================================================================
124 /*! \brief Find an already existing and registered component instance.
126 * \param params machine parameters like type or name...
127 * \param componentName the name of component class
128 * \param studyId default = 0 : multistudy instance
129 * \return a CORBA reference of the component instance, or _nil if not found
131 //=============================================================================
132 Engines::Component_ptr
133 SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params,
134 const char *componentName,
137 if (! isKnownComponentClass(componentName))
138 return Engines::Component::_nil();
140 Engines::ContainerParameters new_params;
141 convert(params, new_params);
142 new_params.resource_params.componentList.length(1);
143 new_params.resource_params.componentList[0] = componentName;
144 Engines::ResourceList_var listOfResources;
147 listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
149 catch( const SALOME::SALOME_Exception& ex )
151 return Engines::Component::_nil();
154 Engines::Component_var compo = _FindComponent(new_params,
159 return compo._retn();
162 //=============================================================================
163 /*! \brief Load a component instance on a container defined by machine parameters
165 * \param params machine parameters like type or name...
166 * \param componentName the name of component class
167 * \param studyId default = 0 : multistudy instance
168 * \return a CORBA reference of the component instance, or _nil if problem
170 //=============================================================================
172 Engines::Component_ptr
173 SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params,
174 const char *componentName,
177 // --- Check if Component Name is known in ModuleCatalog
179 if (! isKnownComponentClass(componentName))
180 return Engines::Component::_nil();
182 Engines::ContainerParameters new_params;
183 convert(params, new_params);
184 new_params.resource_params.componentList.length(1);
185 new_params.resource_params.componentList[0] = componentName;
187 Engines::ResourceList_var listOfResources;
190 listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
192 catch( const SALOME::SALOME_Exception& ex )
194 return Engines::Component::_nil();
196 new_params.resource_params.resList = listOfResources;
198 Engines::Component_var compo = _LoadComponent(new_params,
202 return compo._retn();
205 //=============================================================================
206 /*! \brief Find an already existing and registered component instance or load a new
207 * component instance on a container defined by machine parameters.
209 * \param params machine parameters like type or name...
210 * \param componentName the name of component class
211 * \param studyId default = 0 : multistudy instance
212 * \return a CORBA reference of the component instance, or _nil if problem
214 //=============================================================================
216 Engines::Component_ptr
217 SALOME_LifeCycleCORBA::
218 FindOrLoad_Component(const Engines::MachineParameters& params,
219 const char *componentName,
222 // --- Check if Component Name is known in ModuleCatalog
224 if (! isKnownComponentClass(componentName))
225 return Engines::Component::_nil();
227 Engines::ContainerParameters new_params;
228 convert(params, new_params);
229 new_params.resource_params.componentList.length(1);
230 new_params.resource_params.componentList[0] = componentName;
232 // For Compatibility -> if hostname == localhost put name == hostname
233 if (std::string(new_params.resource_params.hostname.in()) == "localhost")
235 new_params.resource_params.hostname = CORBA::string_dup(Kernel_Utils::GetHostname().c_str());
236 new_params.resource_params.name = CORBA::string_dup(Kernel_Utils::GetHostname().c_str());
239 Engines::ResourceList_var listOfResources;
242 listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
244 catch( const SALOME::SALOME_Exception& ex )
246 return Engines::Component::_nil();
249 Engines::Component_var compo = _FindComponent(new_params,
254 if(CORBA::is_nil(compo))
256 new_params.resource_params.resList = listOfResources;
257 compo = _LoadComponent(new_params,
262 return compo._retn();
265 Engines::Component_ptr
266 SALOME_LifeCycleCORBA::
267 FindOrLoad_Component(const Engines::ContainerParameters& params,
268 const char *componentName,
271 // --- Check if Component Name is known in ModuleCatalog
273 if (! isKnownComponentClass(componentName))
274 return Engines::Component::_nil();
276 Engines::ContainerParameters new_params(params);
277 new_params.resource_params.componentList.length(1);
278 new_params.resource_params.componentList[0] = componentName;
280 Engines::ResourceList_var listOfResources;
283 listOfResources = _ResManager->GetFittingResources(new_params.resource_params);
285 catch( const SALOME::SALOME_Exception& ex )
287 return Engines::Component::_nil();
290 Engines::Component_var compo = _FindComponent(new_params,
295 if(CORBA::is_nil(compo))
297 new_params.resource_params.resList = listOfResources;
298 compo = _LoadComponent(new_params,
303 return compo._retn();
306 //=============================================================================
307 /*! \brief Find an already existing and registered component instance or load a new
308 * component instance on a container defined by name
310 * \param containerName the name of container, under one of the forms
311 * - 1 aContainer (local container)
312 * - 2 machine/aContainer (container on hostname = machine)
313 * \param componentName the name of component class
314 * \return a CORBA reference of the component instance, or _nil if problem
316 //=============================================================================
318 Engines::Component_ptr
319 SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName,
320 const char *componentName)
322 MESSAGE("SALOME_LifeCycleCORBA::FindOrLoad_Component INTERACTIF " << containerName << " " << componentName ) ;
324 // --- Check if Component Name is known in ModuleCatalog
325 if (! isKnownComponentClass(componentName))
326 return Engines::Component::_nil();
328 // --- Check if containerName contains machine name (if yes: rg>0)
329 char *stContainer=strdup(containerName);
330 std::string st2Container(stContainer);
331 int rg=st2Container.find("/");
333 Engines::MachineParameters_var params=new Engines::MachineParameters;
337 // containerName doesn't contain "/" => Local container
338 params->container_name=CORBA::string_dup(stContainer);
343 stContainer[rg]='\0';
344 params->container_name=CORBA::string_dup(stContainer+rg+1);
345 params->hostname=CORBA::string_dup(stContainer);
347 params->isMPI = false;
348 SCRUTE(params->container_name);
350 return FindOrLoad_Component(params, componentName);
353 //=============================================================================
354 /*! \brief Check if the component class is known in module catalog
356 * \param componentName the name of component class
357 * \return true if found, false otherwise
359 //=============================================================================
361 bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName)
365 CORBA::Object_var obj = _NS->Resolve("/Kernel/ModulCatalog");
366 SALOME_ModuleCatalog::ModuleCatalog_var Catalog =
367 SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj) ;
368 ASSERT(! CORBA::is_nil(Catalog));
369 SALOME_ModuleCatalog::Acomponent_var compoInfo =
370 Catalog->GetComponent(componentName);
371 if (CORBA::is_nil (compoInfo))
373 MESSAGE("Catalog Error: Component not found in the catalog " << componentName);
378 catch (ServiceUnreachable&)
380 INFOS("Caught exception: Naming Service Unreachable");
384 INFOS("Caught unknown exception.");
389 //=============================================================================
391 * Not so complex... useful ?
393 //=============================================================================
396 SALOME_LifeCycleCORBA::isMpiContainer(const Engines::ContainerParameters& params)
397 throw(IncompatibleComponent)
406 //=============================================================================
407 /*! \brief Initialisation of a given Engines::MachineParameters with default values.
409 * - container_name = "" : not relevant
410 * - hostname = "" : not relevant
411 * - OS = "" : not relevant
412 * - nb_proc = 0 : not relevant
413 * - mem_mb = 0 : not relevant
414 * - cpu_clock = 0 : not relevant
415 * - nb_proc_per_node = 0 : not relevant
416 * - nb_node = 0 : not relevant
417 * - isMPI = false : standard components
419 //=============================================================================
421 void SALOME_LifeCycleCORBA::preSet(Engines::MachineParameters& params)
423 params.container_name = "";
424 params.hostname = "";
427 params.cpu_clock = 0;
428 params.nb_proc_per_node = 0;
430 params.isMPI = false;
431 params.workingdir = "";
434 params.parallelLib = "";
435 params.nb_component_nodes = 0;
439 SALOME_LifeCycleCORBA::preSet(Engines::ResourceParameters& params)
442 params.hostname = "";
446 params.cpu_clock = 0;
448 params.nb_proc_per_node = 0;
452 void SALOME_LifeCycleCORBA::preSet( Engines::ContainerParameters& params)
454 params.container_name = "";
456 params.workingdir = "";
458 params.isMPI = false;
459 params.parallelLib = "";
460 SALOME_LifeCycleCORBA::preSet(params.resource_params);
464 SALOME_LifeCycleCORBA::convert(const Engines::MachineParameters& params_in,
465 Engines::ContainerParameters& params_out)
467 SALOME_LifeCycleCORBA::preSet(params_out);
470 params_out.container_name = params_in.container_name;
471 params_out.mode = params_in.mode;
472 params_out.workingdir = params_in.workingdir;
473 params_out.isMPI = params_in.isMPI;
474 params_out.parallelLib = params_in.parallelLib;
477 params_out.resource_params.hostname = params_in.hostname;
478 params_out.resource_params.OS = params_in.OS;
479 params_out.resource_params.mem_mb = params_in.mem_mb;
480 params_out.resource_params.cpu_clock = params_in.cpu_clock;
481 params_out.resource_params.nb_node = params_in.nb_node;
482 params_out.resource_params.nb_proc_per_node = params_in.nb_proc_per_node;
483 params_out.resource_params.policy = params_in.policy;
484 params_out.resource_params.componentList = params_in.componentList;
486 params_out.resource_params.resList.length(params_in.computerList.length());
487 for (CORBA::ULong i = 0; i < params_in.computerList.length(); i++)
488 params_out.resource_params.resList[i] = params_in.computerList[i];
491 //=============================================================================
493 * \return a number of processors not 0, only for MPI containers
495 //=============================================================================
497 int SALOME_LifeCycleCORBA::NbProc(const Engines::ContainerParameters& params)
499 if( !isMpiContainer(params) )
501 else if( params.nb_proc <= 0 )
504 return params.nb_proc;
507 //=============================================================================
508 /*! \brief Get the container manager
510 * \return the container Manager
512 //=============================================================================
514 Engines::ContainerManager_ptr SALOME_LifeCycleCORBA::getContainerManager()
516 Engines::ContainerManager_var contManager =
517 Engines::ContainerManager::_duplicate(_ContManager);
518 return contManager._retn();
521 //=============================================================================
522 /*! \brief Get the resources manager
524 * \return the container Manager
526 //=============================================================================
528 Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager()
530 Engines::ResourcesManager_var resManager =
531 Engines::ResourcesManager::_duplicate(_ResManager);
532 return resManager._retn();
535 //=============================================================================
536 /*! \brief shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd
538 //=============================================================================
540 void SALOME_LifeCycleCORBA::shutdownServers()
542 // get each Container from NamingService => shutdown it
543 // (the order is inverse to the order of servers initialization)
545 SALOME::Session_var session = SALOME::Session::_nil();
547 CORBA::Object_var objS = _NS->Resolve("/Kernel/Session");
548 if (!CORBA::is_nil(objS))
550 session = SALOME::Session::_narrow(objS);
551 if (!CORBA::is_nil(session))
553 pid = session->getPID();
558 std::string hostname = Kernel_Utils::GetHostname();
560 // 1) ConnectionManager
563 CORBA::Object_var objCnM=_NS->Resolve("/ConnectionManager");
564 Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM);
565 if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) )
566 connMan->ShutdownWithExit();
568 catch(const CORBA::Exception& e)
570 // ignore and continue
574 ts_req.tv_nsec=100000000;
577 //Wait some time so that ConnectionManager be completely shutdown
579 nanosleep(&ts_req,0);
585 CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager");
586 SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
587 if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) )
588 studyManager->Shutdown();
590 catch(const CORBA::Exception& e)
592 // ignore and continue
595 //Wait some time so that study be completely shutdown
597 nanosleep(&ts_req,0);
603 CORBA::Object_var objMC=_NS->Resolve("/Kernel/ModulCatalog");
604 SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC);
605 if ( !CORBA::is_nil(catalog) && ( pid != catalog->getPID() ) )
608 catch(const CORBA::Exception& e)
610 // ignore and continue
613 //Wait some time so that ModulCatalog be completely shutdown
615 nanosleep(&ts_req,0);
621 CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
622 Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL);
623 if (!CORBA::is_nil(launcher) && (pid != launcher->getPID()))
624 launcher->Shutdown();
626 catch(const CORBA::Exception& e)
628 // ignore and continue
631 //Wait some time so that launcher be completely shutdown
633 nanosleep(&ts_req,0);
639 CORBA::Object_var objR = _NS->Resolve("/Registry");
640 Registry::Components_var registry = Registry::Components::_narrow(objR);
641 if ( !CORBA::is_nil(registry) && ( pid != registry->getPID() ) )
642 registry->Shutdown();
644 catch(const CORBA::Exception& e)
646 // ignore and continue
651 char *xargv = (char*)"";
652 char **argv = &xargv;
653 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
655 CORBA::Object_var objLog = CORBA::Object::_nil();
656 CosNaming::NamingContext_var inc;
657 CORBA::Object_var theObj = CORBA::Object::_nil();
658 std::string stdname = "Logger";
659 CosNaming::Name name;
661 name[0].id = CORBA::string_dup(stdname.c_str());
664 if(!CORBA::is_nil(orb))
665 theObj = orb->resolve_initial_references("NameService");
666 if (!CORBA::is_nil(theObj))
667 inc = CosNaming::NamingContext::_narrow(theObj);
672 if(!CORBA::is_nil(inc))
676 objLog = inc->resolve(name);
677 SALOME_Logger::Logger_var logger = SALOME_Logger::Logger::_narrow(objLog);
678 if ( !CORBA::is_nil(logger) )
687 //=============================================================================
688 /*! \brief shutdown omniNames and notifd
690 //=============================================================================
692 void SALOME_LifeCycleCORBA::killOmniNames()
694 std::string portNumber (::getenv ("NSPORT") );
695 if ( !portNumber.empty() )
700 cmd = std::string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*")
702 + std::string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" );
705 system ( cmd.c_str() );
712 // NPAL 18309 (Kill Notifd)
713 if ( !portNumber.empty() )
715 std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; ");
716 cmd += std::string("killNotifdAndClean(") + portNumber + "); ";
717 cmd = std::string("python -c \"") + cmd +"\" > /dev/null 2> /dev/null";
719 system( cmd.c_str() );
723 //=============================================================================
724 /*! \brief Find an already existing and registered component instance.
726 * - build a list of machines on which an instance of the component is running,
727 * - find the best machine among the list
729 * \param params machine parameters like type or name...
730 * \param componentName the name of component class
731 * \param studyId default = 0 : multistudy instance
732 * \param listOfMachines list of machine address
733 * \return a CORBA reference of the component instance, or _nil if not found
735 //=============================================================================
737 Engines::Component_ptr
738 SALOME_LifeCycleCORBA::
739 _FindComponent(const Engines::ContainerParameters& params,
740 const char *componentName,
742 const Engines::ResourceList& listOfResources)
744 // --- build the list of machines on which the component is already running
745 const char *containerName = params.container_name;
746 int nbproc = NbProc(params);
748 Engines::ResourceList_var resourcesOK = new Engines::ResourceList;
750 unsigned int lghtOfresourcesOK = 0;
751 resourcesOK->length(listOfResources.length());
753 for(unsigned int i=0; i < listOfResources.length(); i++)
755 const char * currentResource = listOfResources[i];
756 CORBA::Object_var obj = _NS->ResolveComponent(currentResource,
760 if (!CORBA::is_nil(obj))
761 resourcesOK[lghtOfresourcesOK++] = CORBA::string_dup(currentResource);
764 // --- find the best machine among the list
765 if(lghtOfresourcesOK != 0)
767 resourcesOK->length(lghtOfresourcesOK);
768 CORBA::String_var bestResource = _ResManager->FindFirst(resourcesOK);
769 CORBA::Object_var obj = _NS->ResolveComponent(bestResource,
773 return Engines::Component::_narrow(obj);
776 return Engines::Component::_nil();
779 //=============================================================================
780 /*! \brief Load a component instance.
782 * - Finds a container in the list of machine or start one.
783 * - Try to load the component library in the container,
784 * - then create an instance of the component.
786 * \param params machine parameters like type or name...
787 * \param componentName the name of component class
788 * \param studyId default = 0 : multistudy instance
789 * \return a CORBA reference of the component instance, or _nil if problem
791 //=============================================================================
793 Engines::Component_ptr
794 SALOME_LifeCycleCORBA::
795 _LoadComponent(const Engines::ContainerParameters& params,
796 const char *componentName,
799 MESSAGE("_LoadComponent, required " << params.container_name <<
800 " " << componentName << " " << NbProc(params));
802 Engines::ContainerParameters local_params(params);
803 local_params.mode = CORBA::string_dup("findorstart");
804 Engines::Container_var cont = _ContManager->GiveContainer(local_params);
805 if (CORBA::is_nil(cont)) return Engines::Component::_nil();
808 bool isLoadable = cont->load_component_Library(componentName,reason);
811 //std::cerr << reason << std::endl;
812 CORBA::string_free(reason);
813 return Engines::Component::_nil();
815 CORBA::string_free(reason);
817 Engines::Component_var myInstance =
818 cont->create_component_instance(componentName, studyId);
819 return myInstance._retn();
822 //=============================================================================
823 /*! \brief Load a parallel component instance.
825 * \param params machine parameters like type or name...
826 * \param componentName the name of component class
827 * \param studyId default = 0 : multistudy instance
828 * \return a CORBA reference of the parallel component instance, or _nil if problem
830 //=============================================================================
831 Engines::Component_ptr
832 SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::ContainerParameters& params,
833 const char *componentName,
836 MESSAGE("Entering LoadParallelComponent");
838 /*MESSAGE("Parameters : ");
839 MESSAGE("Container name : " << params.container_name);
840 MESSAGE("Number of component nodes : " << params.nb_component_nodes);
841 MESSAGE("Component Name : " << componentName);*/
843 Engines::ContainerParameters parms(params);
844 parms.resource_params.componentList.length(1);
845 parms.resource_params.componentList[0] = componentName;
846 parms.mode = CORBA::string_dup("findorstart");
848 MESSAGE("Starting Parallel Container");
849 Engines::Container_var cont = _ContManager->GiveContainer(parms);
850 if (CORBA::is_nil(cont)) {
851 INFOS("FindOrStartParallelContainer() returns a NULL container !");
852 return Engines::Component::_nil();
855 MESSAGE("Loading component library");
857 bool isLoadable = cont->load_component_Library(componentName,reason);
859 INFOS(componentName <<" library is not loadable !");
860 //std::cerr << reason << std::endl;
861 CORBA::string_free(reason);
862 return Engines::Component::_nil();
864 CORBA::string_free(reason);
866 MESSAGE("Creating component instance");
867 // @PARALLEL@ permits to identify that the component requested
868 // is a parallel component.
869 std::string name = std::string(componentName);
870 Engines::Component_var myInstance = cont->create_component_instance(name.c_str(), studyId);
871 if (CORBA::is_nil(myInstance))
872 INFOS("create_component_instance returns a NULL component !");
873 return myInstance._retn();
876 /*! \brief copy a file from a source host to a destination host
877 * \param hostSrc the source host
878 * \param fileSrc the file to copy from the source host to the destination host
879 * \param hostDest the destination host
880 * \param fileDest the destination file
882 void SALOME_LifeCycleCORBA::copyFile(const char* hostSrc, const char* fileSrc, const char* hostDest, const char* fileDest)
884 if(strcmp(hostDest,"localhost") == 0)
886 //if localhost use a shortcut
887 SALOME_FileTransferCORBA transfer(hostSrc,fileSrc);
888 transfer.getLocalFile(fileDest);
892 Engines::ContainerManager_var contManager = getContainerManager();
894 Engines::ContainerParameters params;
897 params.resource_params.hostname = hostDest;
898 params.mode = CORBA::string_dup("findorstart");
899 Engines::Container_var containerDest = contManager->GiveContainer(params);
901 params.resource_params.hostname = hostSrc;
902 Engines::Container_var containerSrc = contManager->GiveContainer(params);
904 containerDest->copyFile(containerSrc,fileSrc,fileDest);
907 /*! \brief get the naming service used by the life cycle
909 * \return the naming service
911 SALOME_NamingService * SALOME_LifeCycleCORBA::namingService()
916 /*! \brief get the orb used by the life cycle
920 CORBA::ORB_ptr SALOME_LifeCycleCORBA::orb()