From: secher Date: Fri, 24 Oct 2003 14:25:25 +0000 (+0000) Subject: mise a jour containers paralleles X-Git-Tag: BSEC_br1_20040202~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a8ee53bb2e2e4c2312ff063430b887c734927d25;p=modules%2Fkernel.git mise a jour containers paralleles --- diff --git a/idl/MPIContainer.idl b/idl/MPIContainer.idl deleted file mode 100644 index 6aab3355d..000000000 --- a/idl/MPIContainer.idl +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : MPIContainer.idl - -#ifndef _SALOME_MPICONTAINER_IDL_ -#define _SALOME_MPICONTAINER_IDL_ - -#include "SALOME_Component.idl" -#include "MPIObject.idl" - -module Engines -{ - interface MPIContainer:Container,MPIObject - { - } ; -} ; - -#endif - diff --git a/idl/MPIObject.idl b/idl/MPIObject.idl deleted file mode 100644 index a480f51f1..000000000 --- a/idl/MPIObject.idl +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : MPIObject.idl - -#ifndef _SALOME_MPIOBJECT_IDL_ -#define _SALOME_MPIOBJECT_IDL_ - -module Engines -{ - typedef sequence IORTab; - interface MPIObject - { - attribute IORTab tior; - } ; -} ; - -#endif diff --git a/idl/Makefile.in b/idl/Makefile.in index cda494641..811fdc1ff 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -21,9 +21,9 @@ IDL_FILES = \ SALOME_Component.idl \ SALOME_TestComponent.idl \ SALOME_Registry.idl \ - TypeData.idl \ - MPIObject.idl \ - MPIContainer.idl \ + SALOME_MPIObject.idl \ + SALOME_MPIContainer.idl \ + SALOME_TestMPIComponent.idl \ Logger.idl PY_CLIENT_IDL = $(IDL_FILES) diff --git a/idl/SALOME_MPIContainer.idl b/idl/SALOME_MPIContainer.idl new file mode 100644 index 000000000..8265c7380 --- /dev/null +++ b/idl/SALOME_MPIContainer.idl @@ -0,0 +1,45 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SALOME_MPIContainer.idl + +#ifndef _SALOME_MPICONTAINER_IDL_ +#define _SALOME_MPICONTAINER_IDL_ + +#include "SALOME_Component.idl" +#include "SALOME_MPIObject.idl" + +module Engines +{ + interface MPIContainer:Container,MPIObject + { + // start MPI container executable + MPIContainer start_MPIimpl( in string ContainerName, in short nbproc ); + + // asynchronous version to load and remove parallel component in parallel + oneway void SPload_impl(in string nameToRegister, in string componentName); + oneway void SPremove_impl(in Component component_i); + oneway void SPfinalize_removal(); + }; +} ; + +#endif + diff --git a/idl/SALOME_MPIObject.idl b/idl/SALOME_MPIObject.idl new file mode 100644 index 000000000..a480f51f1 --- /dev/null +++ b/idl/SALOME_MPIObject.idl @@ -0,0 +1,36 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : MPIObject.idl + +#ifndef _SALOME_MPIOBJECT_IDL_ +#define _SALOME_MPIOBJECT_IDL_ + +module Engines +{ + typedef sequence IORTab; + interface MPIObject + { + attribute IORTab tior; + } ; +} ; + +#endif diff --git a/idl/SALOME_TestMPIComponent.idl b/idl/SALOME_TestMPIComponent.idl new file mode 100644 index 000000000..ad8623f35 --- /dev/null +++ b/idl/SALOME_TestMPIComponent.idl @@ -0,0 +1,24 @@ +//============================================================================= +// File : SALOME_MPITestComponent.idl +// Created : mer jui 04 12:08:17 CEST 2003 +// Author : Bernard SECHER, CEA +// Project : SALOME +// Copyright : CEA 2003 +// $Header$ +//============================================================================= + +#include "SALOME_Component.idl" +#include "SALOME_MPIObject.idl" + +module Engines +{ + + interface TestMPIComponent : Component, MPIObject + { + // version synchrone (process 0) + void Coucou(in long L); + // version asynchrone (autres process) + oneway void SPCoucou(in long L); + }; + +}; diff --git a/idl/TypeData.idl b/idl/TypeData.idl deleted file mode 100644 index c3d99e29f..000000000 --- a/idl/TypeData.idl +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : TypeData.idl - -#ifndef _SALOME_TYPEDATA_IDL_ -#define _SALOME_TYPEDATA_IDL_ - -module Engines -{ - - typedef sequence DoubleVec ; - typedef sequence IntVec; - - typedef struct CSR { - unsigned long nbpos; - unsigned long nbval; - IntVec pos; - IntVec col; - DoubleVec data; - } CSRMatStruct; - -} ; - -#endif - diff --git a/salome_adm/unix/config_files/check_mpich.m4 b/salome_adm/unix/config_files/check_mpich.m4 index cb4af5388..c68a72757 100644 --- a/salome_adm/unix/config_files/check_mpich.m4 +++ b/salome_adm/unix/config_files/check_mpich.m4 @@ -52,13 +52,15 @@ if test "$WITHMPICH" = yes; then if test "$WITHMPICH" = "yes";then LDFLAGS_old="$LDFLAGS" LDFLAGS="$MPICH_LIBS $LDFLAGS" - AC_CHECK_LIB(mpich,MPI_Init, - AC_CHECK_LIB(pmpich, PMPI_Init,WITHMPICH="yes",WITHMPICH="no"), - WITHMPICH="no") + AC_CHECK_LIB(mpich,MPI_Init,WITHMPICH="yes",WITHMPICH="no") LDFLAGS="$LDFLAGS_old" fi - MPICH_LIBS="$MPICH_LIBS -lpmpich -lmpich" + if test "$WITHMPICH" = "yes";then + mpich_ok=yes + MPICH_LIBS="$MPICH_LIBS -lmpich" + fi + fi AC_SUBST(MPICH_INCLUDES) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 099376b5f..aa3e364d2 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -149,6 +149,7 @@ void Engines_Container_i::ping() MESSAGE("Engines_Container_i::ping() pid "<< getpid()); } + // Kill current container bool Engines_Container_i::Kill_impl() { MESSAGE("Engines_Container_i::Kill() pid "<< getpid() << " containerName " << _containerName.c_str() << " machineName " @@ -156,6 +157,7 @@ bool Engines_Container_i::Kill_impl() { exit( 0 ) ; } +// Launch a new container from the current container Engines::Container_ptr Engines_Container_i::start_impl( const char* ContainerName ) { MESSAGE("start_impl argc " << _argc << " ContainerName " << ContainerName @@ -186,7 +188,7 @@ Engines::Container_ptr Engines_Container_i::start_impl( } if ( !nilvar ) { _numInstanceMutex.unlock() ; - MESSAGE("start_impl container found without runSession") ; + MESSAGE("start_impl container found without new launch") ; return Engines::Container::_narrow(obj); } int i = 0 ; @@ -194,12 +196,8 @@ Engines::Container_ptr Engines_Container_i::start_impl( MESSAGE(" argv" << i << " " << _argv[ i ]) ; i++ ; } -// string shstr( "rsh -n " ) ; -// shstr += machineName() ; -// shstr += " " ; -// shstr += _argv[ 0 ] ; -// string shstr( _argv[ 0 ] ) ; - string shstr( "./runSession SALOME_Container " ) ; + string shstr = string(getenv("KERNEL_ROOT_DIR")) + "/bin/salome/SALOME_Container "; +// string shstr( "./runSession SALOME_Container " ) ; shstr += ContainerName ; if ( _argc == 4 ) { shstr += " " ; @@ -213,38 +211,37 @@ Engines::Container_ptr Engines_Container_i::start_impl( MESSAGE("system(" << shstr << ")") ; int status = system( shstr.c_str() ) ; if (status == -1) { - INFOS("Engines_Container_i::start_impl runSession(SALOME_Container) failed (system command status -1)") ; + INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status -1)") ; } else if (status == 217) { - INFOS("Engines_Container_i::start_impl runSession(SALOME_Container) failed (system command status 217)") ; + INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status 217)") ; } - INFOS(machineName() << " Engines_Container_i::start_impl runSession(SALOME_Container) done"); -#if 0 - pid_t pid = fork() ; - if ( pid == 0 ) { - string anExe( _argv[ 0 ] ) ; - anExe += "runSession" ; - char * args[ 6 ] ; - args[ 0 ] = "runSession" ; - args[ 1 ] = "SALOME_Container" ; - args[ 2 ] = strdup( ContainerName ) ; - args[ 3 ] = strdup( _argv[ 2 ] ) ; - args[ 4 ] = strdup( _argv[ 3 ] ) ; - args[ 5 ] = NULL ; - MESSAGE("execl(" << anExe.c_str() << " , " << args[ 0 ] << " , " - << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ] - << " , " << args[ 4 ] << ")") ; - int status = execv( anExe.c_str() , args ) ; - if (status == -1) { - INFOS("Engines_Container_i::start_impl execl failed (system command status -1)") ; - perror( "Engines_Container_i::start_impl execl error ") ; - } - else { - INFOS(machineName() << " Engines_Container_i::start_impl execl done"); - } - exit(0) ; - } -#endif + INFOS(machineName() << " Engines_Container_i::start_impl SALOME_Container launch done"); + +// pid_t pid = fork() ; +// if ( pid == 0 ) { +// string anExe( _argv[ 0 ] ) ; +// anExe += "runSession" ; +// char * args[ 6 ] ; +// args[ 0 ] = "runSession" ; +// args[ 1 ] = "SALOME_Container" ; +// args[ 2 ] = strdup( ContainerName ) ; +// args[ 3 ] = strdup( _argv[ 2 ] ) ; +// args[ 4 ] = strdup( _argv[ 3 ] ) ; +// args[ 5 ] = NULL ; +// MESSAGE("execl(" << anExe.c_str() << " , " << args[ 0 ] << " , " +// << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ] +// << " , " << args[ 4 ] << ")") ; +// int status = execv( anExe.c_str() , args ) ; +// if (status == -1) { +// INFOS("Engines_Container_i::start_impl execl failed (system command status -1)") ; +// perror( "Engines_Container_i::start_impl execl error ") ; +// } +// else { +// INFOS(machineName() << " Engines_Container_i::start_impl execl done"); +// } +// exit(0) ; +// } obj = Engines::Container::_nil() ; try { @@ -266,7 +263,7 @@ Engines::Container_ptr Engines_Container_i::start_impl( } _numInstanceMutex.unlock() ; if ( !nilvar ) { - MESSAGE("start_impl container found after runSession(SALOME_Container)") ; + MESSAGE("start_impl container found after new launch of SALOME_Container") ; } return Engines::Container::_narrow(obj); } @@ -277,10 +274,11 @@ Engines::Container_ptr Engines_Container_i::start_impl( INFOS(machineName() << "Caught unknown exception."); } _numInstanceMutex.unlock() ; - MESSAGE("start_impl container not found after runSession(SALOME_Container)") ; + MESSAGE("start_impl container not found after new launch of SALOME_Container") ; return Engines::Container::_nil() ; } +// Load component in current container Engines::Component_ptr Engines_Container_i::load_impl (const char* nameToRegister, const char* componentName) diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index 413810c7f..2010bb047 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -55,17 +55,22 @@ public: bool activ = true); virtual ~Engines_Container_i(); - + // Launch a new container from the current container Engines::Container_ptr start_impl(const char* ContainerName); + // Load component in current container Engines::Component_ptr load_impl(const char* nameToRegister, const char* componentName); + + // Unload component from current container void remove_impl(Engines::Component_ptr component_i); void finalize_removal(); char* name(); char* machineName(); void ping(); + + // Kill current container bool Kill_impl() ; protected: diff --git a/src/LifeCycleCORBA/LifeCycleCORBA.py b/src/LifeCycleCORBA/LifeCycleCORBA.py index 9f2024e9c..550a88ff9 100644 --- a/src/LifeCycleCORBA/LifeCycleCORBA.py +++ b/src/LifeCycleCORBA/LifeCycleCORBA.py @@ -97,8 +97,13 @@ class LifeCycleCORBA: #------------------------------------------------------------------------- def ComputerPath(self, ComputerName ): + # Modification provisoire B. Secher en attendant + # le gestionnaire de ressources 21/10/2003 + # Le KERNEL_ROOT_DIR sera a lire dans le catalogue de machines + # en attendant on suppose qu'il est identique au KERNEL_ROOT_DIR local try: - path = self._catalog.GetPathPrefix( ComputerName ) + #path = self._catalog.GetPathPrefix( ComputerName ) + path = os.getenv("KERNEL_ROOT_DIR") + "/bin/salome/" except SALOME_ModuleCatalog.NotFound, ex: path = "" return path @@ -137,14 +142,14 @@ class LifeCycleCORBA: else : rshstr = "rsh -n " + theComputer + " " path = self.ComputerPath( theComputer ) - if path != "" : - rshstr = rshstr + path + "/../bin/" - else : - rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" +## if path != "" : +## rshstr = rshstr + path + "/../bin/" +## else : +## rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" if theContainer == "FactoryServer" : - rshstr = rshstr + "./runSession ./SALOME_Container " + rshstr = rshstr + path + "SALOME_Container " else : - rshstr = rshstr + "./runSession ./SALOME_ContainerPy.py '" + rshstr = rshstr + path + "SALOME_ContainerPy.py '" rshstr = rshstr + theContainer + " -" omniORBcfg = os.getenv( "OMNIORB_CONFIG" ) file = os.open( omniORBcfg , os.O_RDONLY ) diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index 0b42aecf5..3b531f02e 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -108,7 +108,7 @@ Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl( } if ( !nilvar ) { _numInstanceMutex.unlock() ; - MESSAGE("[" << _numproc << "] start_impl container found without runSession") ; + MESSAGE("[" << _numproc << "] start_impl container found without new launch") ; return Engines::MPIContainer::_narrow(obj); } int i = 0 ; @@ -116,12 +116,7 @@ Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl( MESSAGE("[" << _numproc << "] argv" << i << " " << _argv[ i ]) ; i++ ; } -// string shstr( "rsh -n " ) ; -// shstr += machineName() ; -// shstr += " " ; -// shstr += _argv[ 0 ] ; -// string shstr( _argv[ 0 ] ) ; - sprintf(nbp,"./runSession mpirun -np %d SALOME_MPIContainer ",nbproc); + sprintf(nbp,"mpirun -np %d SALOME_MPIContainer ",nbproc); string shstr(nbp); shstr += ContainerName ; if ( _argc == 4 ) { @@ -136,43 +131,12 @@ Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl( MESSAGE("system(" << shstr << ")") ; int status = system( shstr.c_str() ) ; if (status == -1) { - INFOS("[" << _numproc << "] Engines_MPIContainer_i::start_impl runSession(SALOME_MPIContainer) failed (system command status -1)") ; + INFOS("[" << _numproc << "] Engines_MPIContainer_i::start_impl SALOME_MPIContainer failed (system command status -1)") ; } else if (status == 217) { - INFOS("[" << _numproc << "] Engines_MPIContainer_i::start_impl runSession(SALOME_MPIContainer) failed (system command status 217)") ; + INFOS("[" << _numproc << "] Engines_MPIContainer_i::start_impl SALOME_MPIContainer failed (system command status 217)") ; } - INFOS("[" << _numproc << "] " << machineName() << " Engines_MPIContainer_i::start_impl runSession(SALOME_MPIContainer) done"); -#if 0 - pid_t pid = fork() ; - if ( pid == 0 ) { - string anExe( _argv[ 0 ] ) ; - anExe += "runSession" ; - char * args[ 9 ] ; - args[ 0 ] = "runSession" ; - args[ 1 ] = "mpirun" ; - args[ 2 ] = "-np" ; - args[ 3 ] = (char*)calloc(10,sizeof(char)); - sprintf(args[ 3 ],"%d",nbproc); - args[ 4 ] = "SALOME_MPIContainer" ; - args[ 5 ] = strdup( ContainerName ) ; - args[ 6 ] = strdup( _argv[ 2 ] ) ; - args[ 7 ] = strdup( _argv[ 3 ] ) ; - args[ 8 ] = NULL ; - MESSAGE("[" << _numproc << "] execl(" << anExe.c_str() << " , " << args[ 0 ] << " , " - << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ] - << " , " << args[ 4 ] << args[ 5 ] << args[ 6 ] - << args[ 7 ] << ")") ; - int status = execv( anExe.c_str() , args ) ; - if (status == -1) { - INFOS("[" << _numproc << "] Engines_MPIContainer_i::start_impl execl failed (system command status -1)") ; - perror( "Engines_MPIContainer_i::start_impl execl error ") ; - } - else { - INFOS("[" << _numproc << "] " << machineName() << " Engines_MPIContainer_i::start_impl execl done"); - } - exit(0) ; - } -#endif + INFOS("[" << _numproc << "] " << machineName() << " Engines_MPIContainer_i::start_impl SALOME_MPIContainer launch done"); obj = Engines::MPIContainer::_nil() ; try { @@ -194,7 +158,7 @@ Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl( } _numInstanceMutex.unlock() ; if ( !nilvar ) { - MESSAGE("[" << _numproc << "] start_impl container found after runSession(SALOME_MPIContainer)") ; + MESSAGE("[" << _numproc << "] start_impl container found after new launch of SALOME_MPIContainer") ; } return Engines::MPIContainer::_narrow(obj); } @@ -205,7 +169,7 @@ Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl( INFOS("[" << _numproc << "] " << machineName() << "Caught unknown exception."); } _numInstanceMutex.unlock() ; - MESSAGE("[" << _numproc << "] start_impl MPI container not found after runSession(SALOME_MPIContainer)") ; + MESSAGE("[" << _numproc << "] start_impl MPI container not found after new launch of SALOME_MPIContainer") ; return Engines::MPIContainer::_nil() ; } diff --git a/src/MPIContainer/MPIContainer_i.hxx b/src/MPIContainer/MPIContainer_i.hxx index 68d0dcd0e..01fe9f895 100644 --- a/src/MPIContainer/MPIContainer_i.hxx +++ b/src/MPIContainer/MPIContainer_i.hxx @@ -47,18 +47,18 @@ class Engines_MPIContainer_i : public POA_Engines::MPIContainer, // Destructor ~Engines_MPIContainer_i(); - // Start MPI Container + // Launch a new MPI container from the current container Engines::MPIContainer_ptr start_MPIimpl(const char* ContainerName, CORBA::Short nbproc); - // Load a component + // Load a component in current MPI container // synchronous version for process 0 Engines::Component_ptr load_impl(const char* nameToRegister, const char* componentName); // asynchronous version for other process void SPload_impl(const char* nameToRegister, const char* componentName); - // Unload a component + // Unload a component from current MPI container // synchronous version for process 0 void remove_impl(Engines::Component_ptr component_i); // asynchronous version for other process diff --git a/src/MPILifeCycleCORBA/MPILifeCycleCORBA.py b/src/MPILifeCycleCORBA/MPILifeCycleCORBA.py index a45ada3f9..eb255d862 100644 --- a/src/MPILifeCycleCORBA/MPILifeCycleCORBA.py +++ b/src/MPILifeCycleCORBA/MPILifeCycleCORBA.py @@ -29,15 +29,15 @@ class MPILifeCycleCORBA(LifeCycleCORBA): else : rshstr = "rsh -n " + theComputer + " " path = self.ComputerPath( theComputer ) - if path != "" : - rshstr = rshstr + path + "/../bin/" - else : - rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" +## if path != "" : +## rshstr = rshstr + path + "/../bin/salome/" +## else : +## rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" # rshstr = rshstr + os.getenv( "PWD" ) + "/" if theMPIContainerRoot == "MPIFactoryServer" : - rshstr = rshstr + "./runSession mpirun -np " + str(nbproc) + " ./SALOME_MPIContainer " + rshstr = rshstr + "mpirun -np " + str(nbproc) + " " + path + "SALOME_MPIContainer " else : - rshstr = rshstr + "./runSession ./SALOME_MPIContainerPy.py '" + rshstr = rshstr + path + "SALOME_MPIContainerPy.py '" rshstr = rshstr + theMPIContainer + " -" omniORBcfg = os.getenv( "OMNIORB_CONFIG" ) # omniORBcfg = os.getenv( "HOME" ) + "/.omniORB.cfg" diff --git a/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx b/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx index 3bf3b4eb5..cc88f04f1 100644 --- a/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx +++ b/src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx @@ -27,11 +27,13 @@ using namespace std; SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA() : SALOME_LifeCycleCORBA() { + _MPIFactoryServer = NULL; } SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA(SALOME_NamingService *ns) : SALOME_LifeCycleCORBA(ns) { + _MPIFactoryServer = NULL; } SALOME_MPILifeCycleCORBA::~SALOME_MPILifeCycleCORBA() @@ -91,18 +93,15 @@ Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer( } string path = ComputerPath( theComputer.c_str() ) ; SCRUTE( path ) ; - if ( strlen(path.c_str()) > 0 ) { - cout << "path de longueur: " << strlen(path.c_str()) << endl; - rsh += path ; - rsh += "/../bin/" ; - } - rsh += "runSession " ; + // rsh += "runSession " ; if ( pyCont ) { - rsh += "SALOME_MPIContainerPy.py " ; - rsh += "MPIFactoryServerPy -" ; + MESSAGE("MPI python container not implemented"); + return Engines::MPIContainer::_nil(); +// rsh += "SALOME_MPIContainerPy.py " ; +// rsh += "MPIFactoryServerPy -" ; } else { - sprintf(nbp,"mpirun -np %d SALOME_MPIContainer ",nbproc); + sprintf(nbp,"mpirun -np %d %sSALOME_MPIContainer ",nbproc,path.c_str()); rsh += nbp; rsh += theMPIContainer +" -" ; } @@ -155,7 +154,9 @@ Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer( } } } - //On a trouve le container generique: on renvoie une poigne dessus + // On a trouve le container generique distant: on se sert de lui + // pour lancer un nouveau container MPI + // a revoir... if ( !CORBA::is_nil( aMPIFactoryServer ) ) { if ( strcmp( theMPIContainer.c_str() , "MPIFactoryServer" ) || strcmp( theMPIContainer.c_str() , "MPIFactoryServerPy" ) ) {