+++ /dev/null
-// 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
-
+++ /dev/null
-// 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<Object> IORTab;
- interface MPIObject
- {
- attribute IORTab tior;
- } ;
-} ;
-
-#endif
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)
--- /dev/null
+// 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
+
--- /dev/null
+// 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<Object> IORTab;
+ interface MPIObject
+ {
+ attribute IORTab tior;
+ } ;
+} ;
+
+#endif
--- /dev/null
+//=============================================================================
+// 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);
+ };
+
+};
+++ /dev/null
-// 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<double> DoubleVec ;
- typedef sequence<long> IntVec;
-
- typedef struct CSR {
- unsigned long nbpos;
- unsigned long nbval;
- IntVec pos;
- IntVec col;
- DoubleVec data;
- } CSRMatStruct;
-
-} ;
-
-#endif
-
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)
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 "
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
}
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 ;
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 += " " ;
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 {
}
_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);
}
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)
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:
#-------------------------------------------------------------------------
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
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 )
}
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 ;
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 ) {
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 {
}
_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);
}
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() ;
}
// 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
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"
SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA() :
SALOME_LifeCycleCORBA()
{
+ _MPIFactoryServer = NULL;
}
SALOME_MPILifeCycleCORBA::SALOME_MPILifeCycleCORBA(SALOME_NamingService *ns) :
SALOME_LifeCycleCORBA(ns)
{
+ _MPIFactoryServer = NULL;
}
SALOME_MPILifeCycleCORBA::~SALOME_MPILifeCycleCORBA()
}
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 +" -" ;
}
}
}
}
- //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" ) ) {