#
# Created from configure.in.base
#
-
+AS_SHELL_SANITIZES
AC_INIT(src)
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_CANONICAL_HOST
echo
echo
+dnl Modification B. Secher portage sur osf
+AC_CHECK_PROG(SHELL,sh)
+AC_SUBST(SHELL)
+
if test -z "$AR"; then
AC_CHECK_PROGS(AR,ar xar,:,$PATH)
fi
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
-AC_ENABLE_DEBUG(yes)
-AC_DISABLE_PRODUCTION
-
echo ---------------------------------------------
echo testing libtool
echo ---------------------------------------------
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
- INSTALL='\${top_srcdir}'/salome_adm/unix/config_files/install-sh
+ INSTALL="${ROOT_SRCDIR}/salome_adm/unix/config_files/install-sh -c"
;;
esac
dnl inutil car libtool
dnl AC_PROG_CC
AC_PROG_CXX
+AC_CXX_WARNINGS
+AC_CXX_TEMPLATE_OPTIONS
AC_DEPEND_FLAG
# AC_CC_WARNINGS([ansi])
cc_ok=yes
+AC_ENABLE_DEBUG(yes)
+AC_DISABLE_PRODUCTION
+
dnl Library libdl :
AC_CHECK_LIB(dl,dlopen)
+dnl Library librt : for alpha/osf
+AC_CHECK_LIB(rt,nanosleep)
+
dnl add library libm :
AC_CHECK_LIB(m,ceil)
-dnl
-dnl Well we use sstream which is not in gcc pre-2.95.3
-dnl We must test if it exists. If not, add it in include !
+AC_CXX_USE_STD_IOSTREAM
+AC_CXX_HAVE_SSTREAM
+
+dnl
+dnl ---------------------------------------------
+dnl testing linker
+dnl ---------------------------------------------
dnl
-AC_CXX_HAVE_SSTREAM
+AC_LINKER_OPTIONS
echo
echo ---------------------------------------------
SALOME_Component.idl \
SALOME_TestComponent.idl \
SALOME_Registry.idl \
- TypeData.idl \
- MPIObject.idl \
- MPIContainer.idl \
+ SALOME_MPIObject.idl \
+ SALOME_MPIContainer.idl \
Logger.idl \
SALOME_GenericObj.idl \
SALOME_TestModuleCatalog.idl
echo "conftest.o: conftest.c" > conftest.verif
echo "int main() { return 0; }" > conftest.c
+dnl Evolution portage sur CCRT/osf system
+ case $host_os in
+ osf*)
+dnl sur CCRT/osf pas d'equivalent de l'option -MG de gcc avec compilo natif
+dnl on utilise donc gnu pour generer les dependances.
+ DEPCC=gcc
+ DEPCXX=g++
+ DEPCXXFLAGS="-Wno-deprecated -funsigned-char"
+ DIFFFLAGS="-w"
+ ;;
+ *)
+ DEPCC=${CC-cc}
+ DEPCXX=${CXX-c++}
+ DEPCXXFLAGS="\${CXXFLAGS}"
+ DIFFFLAGS="-b -B"
+ ;;
+ esac
C_DEPEND_FLAG=
for ac_C_DEPEND_FLAG in -xM -MM -M ; do
rm -f conftest.d conftest.err
- ${CC-cc} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
+ ${DEPCC} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
if test -f conftest.u ; then
mv conftest.u conftest.d
fi
rm -f conftest
- diff -b -B conftest.d conftest.verif > conftest
+ diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
if test ! -s conftest ; then
C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
break
dnl use gcc option -MG : asume unknown file will be construct later
rm -f conftest.d conftest.err
- ${CC-cc} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
+ ${DEPCC} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
if test -f conftest.u ; then
mv conftest.u conftest.d
fi
rm -f conftest
- diff -b -B conftest.d conftest.verif > conftest
+ diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
if test ! -s conftest ; then
C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
fi
exit
fi
- echo -n " C : " ${C_DEPEND_FLAG}
+ printf " C : ${DEPCC} ${C_DEPEND_FLAG}"
AC_LANG_CPLUSPLUS
echo "conftest.o: conftest.cxx" > conftest.verif
for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
rm -f conftest.d conftest.err
- ${CXX-c++} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
+ ${DEPCXX} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
if test -f conftest.u ; then
mv conftest.u conftest.d
fi
rm -f conftest
- diff -b -B conftest.d conftest.verif > conftest
+ diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
if test ! -s conftest ; then
CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
break
dnl use g++ option -MG : asume unknown file will be construct later
rm -f conftest.d conftest.err
- ${CXX-c++} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
+ ${DEPCXX} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
if test -f conftest.u ; then
mv conftest.u conftest.d
fi
rm -f conftest
- diff -b -B conftest.d conftest.verif > conftest
+ diff ${DIFFFLAGS} conftest.d conftest.verif > conftest
if test ! -s conftest ; then
CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
fi
exit
fi
- echo -n " C++ : " ${CXX_DEPEND_FLAG}
+ printf " C++ : ${DEPCXX} ${CXX_DEPEND_FLAG}"
AC_LANG_RESTORE
+ AC_SUBST(DEPCC)
+ AC_SUBST(DEPCXX)
+ AC_SUBST(DEPCXXFLAGS)
AC_SUBST(C_DEPEND_FLAG)
AC_SUBST(CXX_DEPEND_FLAG)
])
AC_SUBST(CAS_OCAF)
AC_SUBST(CAS_DATAEXCHANGE)
AC_SUBST(CAS_LDFLAGS)
-
AC_SUBST(CAS_LDPATH)
OWN_CONFIG_H=no
occ_ok=no
own_config_h=no
-
dnl libraries directory location
case $host_os in
linux*)
irix6.*)
casdir=Linux
;;
- osf4.*)
+ osf*)
casdir=Linux
;;
solaris2.*)
;;
esac
+AC_MSG_CHECKING(for OpenCascade directories)
+if test -d ${CASROOT}/${casdir}/lib; then
+ CAS_LDPATH="-L$CASROOT/$casdir/lib "
+ AC_MSG_RESULT(yes)
+else
+ if test -d ${CASROOT}/lib; then
+ CAS_LDPATH="-L$CASROOT/lib "
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+
dnl were is OCC ?
if test -z $CASROOT; then
AC_MSG_WARN(You must provide CASROOT variable : see OCC installation manual)
if test "x$occ_ok" = "xyes"; then
+dnl test c++ compiler flag for unsigned character
+ for opt in -funsigned-char -unsigned ; do
+ AC_CXX_OPTION($opt,CXXFLAGS,flag=yes,flag=no)
+ if test "$flag" = "yes"; then
+ break
+ fi
+ done
+
dnl cascade headers
CPPFLAGS_old="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -I$CASROOT/inc -I$CASROOT -I$KERNEL_ROOT_DIR/include/salome -Wno-deprecated -DHAVE_WOK_CONFIG_H"
- CXXFLAGS_old="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -funsigned-char"
-
+ CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DHAVE_WOK_CONFIG_H -I$CASROOT/inc"
+ CPPFLAGS="$CPPFLAGS $CAS_CPPFLAGS"
echo
echo
OWN_CONFIG_H=yes
fi
- CPPFLAGS="$CPPFLAGS -I$ROOT_BUILDDIR/salome_adm/unix"
-
AC_CHECK_HEADER(Standard_Type.hxx,occ_ok=yes ,occ_ok=no)
- CPPFLAGS="$CPPFLAGS_old"
- CXXFLAGS="$CXXFLAGS_old"
fi
-AC_SUBST(OWN_CONFIG_H)
-
if test "x$occ_ok" = xyes ; then
- CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -I$CASROOT/inc -I$CASROOT -DHAVE_WOK_CONFIG_H"
- CAS_CXXFLAGS="-funsigned-char"
-
AC_MSG_CHECKING(for OpenCascade libraries)
- CPPFLAGS_old="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $CAS_CPPFLAGS -I$KERNEL_ROOT_DIR/include/salome -I$ROOT_BUILDDIR/salome_adm/unix -Wno-deprecated"
- CXXFLAGS_old="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $CAS_CXXFLAGS"
LIBS_old="$LIBS"
- LIBS="$LIBS -L$CASROOT/$casdir/lib -lTKernel"
+ LIBS="$LIBS $CAS_LDPATH -lTKernel"
+
AC_CACHE_VAL(salome_cv_lib_occ,[
AC_TRY_LINK(
-using namespace std;
#include <Standard_Type.hxx>
, size_t size;
const Standard_CString aName="toto";
])
occ_ok="$salome_cv_lib_occ"
- CPPFLAGS="$CPPFLAGS_old"
- CXXFLAGS="$CXXFLAGS_old"
- LIBS="$LIBS_old"
fi
+CPPFLAGS="$CPPFLAGS_old"
+LIBS="$LIBS_old"
if test "x$occ_ok" = xno ; then
AC_MSG_RESULT(no)
AC_MSG_WARN(Opencascade libraries not found)
else
AC_MSG_RESULT(yes)
- CAS_LDPATH="-L$CASROOT/$casdir/lib "
CAS_KERNEL="$CAS_LDPATH -lTKernel -lTKMath"
- CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin -lTKPAppStd -lTKCDF"
-dnl CAS_VIEWER="-L$CASROOT/$casdir/lib -lTKOpenGl -lTKV3d -lTKV2d -lTKService"
+
+ # E.A. compatibility version 4 and 5.x
+ CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin"
+ if test $OCC_VERSION_MAJOR -lt 5 ; then
+ CAS_OCAF="$CAS_OCAF -lTKPAppStd"
+ fi
+ CAS_OCAF="$CAS_OCAF -lTKCDF"
+
CAS_VIEWER="$CAS_LDPATH -lTKOpenGl -lTKV3d -lTKService"
-# CAS_MODELER="-L$CASROOT/$casdir/lib -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKFeat -lTKOffset"
CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKOffset"
-dnl CAS_DATAEXCHANGE="-L$CASROOT/$casdir/lib -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd -lTKSTL -lTKVRML "
- CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd"
+
+ # E.A. compatibility version 4 and 5.x
+ CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing"
+ if test $OCC_VERSION_MAJOR -lt 5 ; then
+ CAS_DATAEXCHANGE="$CAS_DATAEXCHANGE -lTKShHealingStd"
+ fi
+
+
CAS_LDFLAGS="$CAS_KERNEL $CAS_OCAF $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE"
-
-
+
fi
AC_LANG_RESTORE
if test "$WITHMPICH" = "yes";then
LDFLAGS_old="$LDFLAGS"
LDFLAGS="$MPI_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")
AC_CHECK_LIB(mpich,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
LDFLAGS="$LDFLAGS_old"
fi
if test "$WITHMPICH" = "yes";then
mpi_ok=yes
- MPI_LIBS="$MPI_LIBS -lpmpich -lmpich"
+ MPI_LIBS="$MPI_LIBS -lmpich"
else
mpi_ok=no
fi
dnl ----------------------------------------------------------------
dnl CHECK_PTHREADS
AC_DEFUN(CHECK_PTHREADS,[
-AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
-AC_CHECK_HEADER(pthread.h,AC_DEFINE(HAVE_PTHREAD_H))
-AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
-AC_CHECK_LIB(pthread,pthread_mutex_lock,
- LIBS_PTHREADS="-lpthread $LIBS_PTHREADS")
-AC_MSG_CHECKING([parameters for using pthreads])
-case $build_os in
- freebsd*)
- CFLAGS_PTHREADS="-pthread"
- CXXFLAGS_PTHREADS="-pthread"
- ;;
- *)
- ;;
-esac
-AC_MSG_RESULT(["flags: $CFLAGS_PTHREADS\;libs: $LIBS_PTHREADS"])
-threads_ok=yes
+AC_CXX_OPTION(-pthread,CPPFLAGS,flag=yes,flag=no)
+
+if test $flag = no; then
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+ AC_CHECK_HEADER(pthread.h,AC_DEFINE(HAVE_PTHREAD_H))
+ AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
+ AC_CHECK_LIB(pthread,pthread_mutex_lock,
+ LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="")
+fi
+
+if test $flag = no && x$LIBS_PTHREADS = x; then
+ threads_ok=no
+else
+ threads_ok=yes
+fi
])dnl
dnl
dnl
sip_vers=new ;;
3.5*)
sip_vers=new ;;
+ 3.6*)
+ sip_vers=new ;;
+ 3.7*)
+ sip_vers=new ;;
+ 3.8*)
+ sip_vers=new ;;
+ 3.9*)
+ sip_vers=new ;;
*)
sip_vers=no ;;
esac
-
sip_ok=no
if test "x$sip_vers" = "xold"
if test "x$sip_vers" = "xnew"
then
- if test -d ${SIPDIR}/include ; then
- sip_ok=yes
+ sip_ok=yes
+ if test -d ${SIPDIR}/include/python${PYTHON_VERSION} ; then
SIP_ROOT="$SIPDIR"
- SIP_INCLUDES="${PYTHON_INCLUDES} -I${SIPDIR}/include"
- SIP_LIBS="-L${SIPDIR}/lib -lsip"
+ SIP_INCLUDES="${PYTHON_INCLUDES} -I${SIPDIR}/include/python${PYTHON_VERSION}"
+ SIP_LIBS="-L${SIPDIR}/lib/python${PYTHON_VERSION}/site-packages -lsip"
else
sip_ok=yes
SIP_ROOT="$SIPDIR"
AC_MSG_WARN(vtk needs OpenGL correct configuration, check configure output)
fi
+if test "x$x_libraries" != "x"
+then
+ LXLIB="-L$x_libraries"
+else
+ LXLIB=""
+fi
LOCAL_INCLUDES="$OGL_INCLUDES"
-LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid $OGL_LIBS -L$x_libraries -lX11 -lXt"
-TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS -L$x_libraries -lX11 -lXt"
+LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid $OGL_LIBS $LXLIB -lX11 -lXt"
+TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS $LXLIB -lX11 -lXt"
if test -z $VTKHOME
then
dnl vtk headers
CPPFLAGS_old="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES -Wno-deprecated"
+CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no")
# LIBS="$LIBS $TRY_LINK_LIBS"
LIBS="$LIBS $LOCAL_LIBS"
CPPFLAGS_old="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $VTK_INCLUDES -Wno-deprecated"
+ CPPFLAGS="$CPPFLAGS $VTK_INCLUDES"
dnl VTKPY_MODULES="$VTKHOME/python"
esac],
enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
-CXXFLAGS="$CXXFLAGS -Wno-deprecated -Wparentheses -Wreturn-type -Wmissing-declarations -Wunused "
+# portage alpha/OSF
+# CXXFLAGS="$CXXFLAGS -Wno-deprecated -Wparentheses -Wreturn-type -Wmissing-declarations -Wunused "
+echo $CXX
+AC_CXX_OPTION(-Wparentheses,CXXFLAGS)
+AC_CXX_OPTION(-Wreturn-type,CXXFLAGS)
+AC_CXX_OPTION(-Wmissing-declarations,CXXFLAGS)
+AC_CXX_OPTION(-Wunused,CXXFLAGS)
-CXXVERSION=`$CXX --version`
-if test "X$CXXVERSION" != "X2.95.3"; then
- CXXFLAGS="${CXXFLAGS} -fmessage-length=0 "
-fi
+# supprimer car ne marche qu'avec compilo gnu
+# CXXVERSION=`$CXX --version`
+# if test "X$CXXVERSION" != "X2.95.3"; then
+# CXXFLAGS="${CXXFLAGS} -fmessage-length=0 "
+# fi
if test "X$enable_production" = "Xyes"; then
CFLAGS="$CFLAGS -O"
- CXXFLAGS="$CXXFLAGS -O -Wuninitialized "
+# CXXFLAGS="$CXXFLAGS -O -Wuninitialized "
+ AC_CXX_OPTION(-Wuninitialized,CXXFLAGS)
+ CXXFLAGS="$CXXFLAGS -O "
fi
])
AC_MSG_CHECKING([if we need libdb])
PY_NEEDOPENDB=`nm $PYTHON_LIBA | grep dbopen | grep U`
if test "x$PY_NEEDOPENDB" != "x"; then
- PYTHON_LIBS="$PYTHON_LIBS -ldb"
AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(db,dbopen,PYTHON_LIBS="$PYTHON_LIBS -ldb",db_ok=no)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if we need libdl])
PY_NEEDOPENDL=`nm $PYTHON_LIBA | grep dlopen | grep U`
if test "x$PY_NEEDOPENDL" != "x"; then
- PYTHON_LIBS="$PYTHON_LIBS -ldl"
AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(dl,dlopen,PYTHON_LIBS="$PYTHON_LIBS -ldl",dl_ok=no)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if we need libutil])
PY_NEEDOPENPTY=`nm $PYTHON_LIBA | grep openpty | grep U`
if test "x$PY_NEEDOPENPTY" != "x"; then
- PYTHON_LIBS="$PYTHON_LIBS -lutil"
AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(util,openpty,PYTHON_LIBS="$PYTHON_LIBS -lutil",openpty_ok=no)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([if we need tcltk])
PY_NEEDTCLTK=`nm $PYTHON_LIBA | grep Tcl_Init | grep U`
if test "x$PY_NEEDTCLTK" != "x"; then
- PYTHON_LIBS="$PYTHON_LIBS -ltcl -ltk"
AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(tcl,Tcl_Init,PYTHON_LIBS="$PYTHON_LIBS -ltcl -ltk",tclinit_ok=no)
else
AC_MSG_RESULT(no)
fi
inc_builddir=$(top_builddir)/include/salome
@SET_MAKE@
-SHELL=/bin/sh
+# Modifcation B. Secher portage sur osf
+SHELL=@SHELL@
# header missing
LIBS=@LIBS@
-LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome
+# LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker -L$(top_builddir)/lib/salome
+LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome
# add libstdc++ to link c++ library with libtool !
-LDFLAGS+= -lstdc++
+LDFLAGS+= @STDLIB@
CP=@CP@
std::map<std::string, void *> remove_map ;
omni_mutex _numInstanceMutex ; // if several threads on the same object
-private:
+ //private:
int _argc ;
char** _argv ;
SALOME_NamingService *_NS;
Engines::Container_var _FactoryServer ;
-private:
+ //private:
std::string ContainerName( const char * aComputerContainer ,
std::string * theComputer ,
std::string * theContainer ) ;
#include <dlfcn.h>
#include <stdio.h>
#include "MPIContainer_i.hxx"
+#include "SALOME_NamingService.hxx"
+#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
#include "utilities.h"
using namespace std;
-MPIContainer_i::MPIContainer_i(int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- char * containerName)
- : Engines_Container_i(orb,poa,containerName,0,0), MPIObject_i(nbproc,numproc)
+// L'appel au registry SALOME ne se fait que pour le process 0
+Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ char * containerName,
+ int argc, char *argv[])
+ : Engines_Container_i(orb,poa,containerName,argc,argv,false,false), MPIObject_i(nbproc,numproc)
{
+ MESSAGE("[" << numproc << "] activate object");
_id = _poa->activate_object(this);
- MESSAGE("[" << _numproc << "] containerName=" << _containerName);
- if( _numproc == 0 ){
+ if(numproc==0){
+
+ // _NS = new SALOME_NamingService(_orb);
_NS = SINGLETON_<SALOME_NamingService>::Instance() ;
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
_NS->init_orb( orb ) ;
Engines::Container_ptr pCont
= Engines::Container::_narrow(POA_Engines::MPIContainer::_this());
- _NS->Register(pCont, _containerName.c_str());
+ SCRUTE(_containerName);
+ _NS->Register(pCont, _containerName.c_str());
}
// Root recupere les ior des container des autre process
BCastIOR(_orb,pobj,true);
}
-MPIContainer_i::~MPIContainer_i(void)
+Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc)
+ : Engines_Container_i(), MPIObject_i(nbproc,numproc)
{
+}
+
+Engines_MPIContainer_i::~Engines_MPIContainer_i(void)
+{
+ MESSAGE("[" << _numproc << "] Engines_MPIContainer_i::~Engines_MPIContainer_i()");
if( !handle_map.empty() ){
- MESSAGE("[" << _numproc << "] MPIContainer_i::~MPIContainer_i: warning destroy a not empty container");
+ MESSAGE("[" << _numproc << "] Engines_MPIContainer_i::~Engines_MPIContainer_i: warning destroy a not empty container");
+ }
+}
+
+// Start MPI Container
+Engines::MPIContainer_ptr Engines_MPIContainer_i::start_MPIimpl(
+ const char* ContainerName,
+ CORBA::Short nbproc )
+{
+
+ char nbp[1024];
+
+ MESSAGE("[" << _numproc << "] start_impl argc " << _argc << " ContainerName " << ContainerName
+ << hex << this << dec) ;
+ _numInstanceMutex.lock() ; // lock on the instance number
+
+ CORBA::Object_var obj = Engines::MPIContainer::_nil() ;
+ bool nilvar = true ;
+ try {
+ string cont("/Containers/");
+ cont += machineName() ;
+ cont += "/" ;
+ cont += ContainerName;
+ INFOS("[" << _numproc << "] " << machineName() << " start_impl unknown container " << cont.c_str()
+ << " try to Resolve" );
+ obj = _NS->Resolve( cont.c_str() );
+ nilvar = CORBA::is_nil( obj ) ;
+ if ( nilvar ) {
+ INFOS("[" << _numproc << "] " << machineName() << " start_impl unknown container "
+ << ContainerName);
+ }
+ }
+ catch (ServiceUnreachable&) {
+ INFOS("[" << _numproc << "] " << machineName() << "Caught exception: Naming Service Unreachable");
+ }
+ catch (...) {
+ INFOS("[" << _numproc << "] " << machineName() << "Caught unknown exception.");
+ }
+ if ( !nilvar ) {
+ _numInstanceMutex.unlock() ;
+ MESSAGE("[" << _numproc << "] start_impl container found without new launch") ;
+ return Engines::MPIContainer::_narrow(obj);
+ }
+ int i = 0 ;
+ while ( _argv[ i ] ) {
+ MESSAGE("[" << _numproc << "] argv" << i << " " << _argv[ i ]) ;
+ i++ ;
+ }
+ sprintf(nbp,"mpirun -np %d SALOME_MPIContainer ",nbproc);
+ string shstr(nbp);
+ shstr += ContainerName ;
+ if ( _argc == 4 ) {
+ shstr += " " ;
+ shstr += _argv[ 2 ] ;
+ shstr += " " ;
+ shstr += _argv[ 3 ] ;
+ }
+ shstr += " > /tmp/" ;
+ shstr += ContainerName ;
+ shstr += ".log 2>&1 &" ;
+ MESSAGE("system(" << shstr << ")") ;
+ int status = system( shstr.c_str() ) ;
+ if (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 SALOME_MPIContainer failed (system command status 217)") ;
}
+ INFOS("[" << _numproc << "] " << machineName() << " Engines_MPIContainer_i::start_impl SALOME_MPIContainer launch done");
+
+ obj = Engines::MPIContainer::_nil() ;
+ try {
+ string cont("/Containers/");
+ cont += machineName() ;
+ cont += "/" ;
+ cont += ContainerName;
+ nilvar = true ;
+ int count = 20 ;
+ while ( nilvar && count >= 0) {
+ sleep( 1 ) ;
+ obj = _NS->Resolve(cont.c_str());
+ nilvar = CORBA::is_nil( obj ) ;
+ if ( nilvar ) {
+ INFOS("[" << _numproc << "] " << count << ". " << machineName()
+ << " start_impl unknown container " << cont.c_str());
+ count -= 1 ;
+ }
+ }
+ _numInstanceMutex.unlock() ;
+ if ( !nilvar ) {
+ MESSAGE("[" << _numproc << "] start_impl container found after new launch of SALOME_MPIContainer") ;
+ }
+ return Engines::MPIContainer::_narrow(obj);
+ }
+ catch (ServiceUnreachable&) {
+ INFOS("[" << _numproc << "] " << machineName() << "Caught exception: Naming Service Unreachable");
+ }
+ catch (...) {
+ INFOS("[" << _numproc << "] " << machineName() << "Caught unknown exception.");
+ }
+ _numInstanceMutex.unlock() ;
+ MESSAGE("[" << _numproc << "] start_impl MPI container not found after new launch of SALOME_MPIContainer") ;
+ return Engines::MPIContainer::_nil() ;
}
// Load component
-Engines::Component_ptr MPIContainer_i::load_impl(const char* nameToRegister,
+Engines::Component_ptr Engines_MPIContainer_i::load_impl(const char* nameToRegister,
const char* componentName)
{
int ip;
- Engines::Component_var iobject;
- Engines::MPIObject_var pobj;
- char cproc[4];
if( _numproc == 0 ){
// Invocation du chargement du composant dans les autres process
for(ip= 1;ip<_nbproc;ip++)
- (Engines::MPIContainer::_narrow((*_tior)[ip]))->load_impl(nameToRegister,
+ (Engines::MPIContainer::_narrow((*_tior)[ip]))->SPload_impl(nameToRegister,
componentName);
}
+ return Lload_impl(nameToRegister,componentName);
+
+}
+
+// Load component
+void Engines_MPIContainer_i::SPload_impl(const char* nameToRegister,
+ const char* componentName)
+{
+ Lload_impl(nameToRegister,componentName);
+}
+
+Engines::Component_ptr Engines_MPIContainer_i::Lload_impl(
+ const char* nameToRegister,
+ const char* componentName)
+{
+ Engines::Component_var iobject;
+ Engines::MPIObject_var pobj;
+ char cproc[4];
+
sprintf(cproc,"_%d",_numproc);
- BEGIN_OF("[" << _numproc << "] MPIContainer_i::load_impl");
+ BEGIN_OF("[" << _numproc << "] MPIContainer_i::Lload_impl");
_numInstanceMutex.lock() ; // lock on the instance number
_numInstance++ ;
char _aNumI[12];
sprintf(_aNumI,"%d",_numInstance) ;
- _numInstanceMutex.unlock() ;
string _impl_name = componentName;
- string instanceName = string(nameToRegister) + "_inst_" + _aNumI + cproc;
+ string _nameToRegister = nameToRegister;
+ string instanceName = _nameToRegister + "_inst_" + _aNumI + cproc;
+ MESSAGE("[" << _numproc << "] instanceName=" << instanceName);
string absolute_impl_name(_impl_name);
MESSAGE("[" << _numproc << "] absolute_impl_name=" << absolute_impl_name);
void * handle = dlopen(absolute_impl_name.c_str(), RTLD_LAZY);
if(!handle){
- MESSAGE("[" << _numproc << "] Can't load shared library : " << absolute_impl_name);
- MESSAGE("[" << _numproc << "] error dlopen: " << dlerror());
+ INFOS("[" << _numproc << "] Can't load shared library : " << absolute_impl_name);
+ INFOS("[" << _numproc << "] error dlopen: " << dlerror());
return Engines::Component::_nil() ;
}
- string factory_name = string(nameToRegister) + string("Engine_factory");
+ string factory_name = _nameToRegister + string("Engine_factory");
MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ;
PortableServer::ObjectId * (*MPIComponent_factory) (int,int,
if ((error = dlerror()) != NULL){
// Try to load a sequential component
MESSAGE("[" << _numproc << "] Try to load a sequential component");
+ _numInstanceMutex.unlock() ;
iobject = Engines_Container_i::load_impl(nameToRegister,componentName);
if( CORBA::is_nil(iobject) ) return Engines::Component::_duplicate(iobject);
}
// Instanciation du composant parallele
MESSAGE("[" << _numproc << "] Try to load a parallel component");
PortableServer::ObjectId * id = (MPIComponent_factory)
- (_nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), nameToRegister);
+ (_nbproc,_numproc,_orb, _poa, _id, instanceName.c_str(), _nameToRegister.c_str());
// get reference from id
CORBA::Object_var o = _poa->id_to_reference(*id);
pobj = Engines::MPIObject::_narrow(o) ;
- iobject = Engines::Component::_narrow(pobj) ;
+ iobject = Engines::Component::_narrow(o) ;
}
- // Root recupere les ior des composants des autre process
- BCastIOR(_orb,pobj,false);
-
if( _numproc == 0 ){
// utiliser + tard le registry ici :
// register the engine under the name containerName.dir/nameToRegister.object
- string component_registerName = _containerName + "/" + nameToRegister;
+ string component_registerName = _containerName + "/" + _nameToRegister;
_NS->Register(iobject, component_registerName.c_str()) ;
}
- _numInstanceMutex.lock() ; // lock on the add on handle_map (necessary ?)
handle_map[instanceName] = handle;
_numInstanceMutex.unlock() ;
- END_OF("[" <<_numproc << "] MPIContainer_i::load_impl");
+
+ // Root recupere les ior des composants des autre process
+ BCastIOR(_orb,pobj,false);
+
+ END_OF("[" <<_numproc << "] MPIContainer_i::Lload_impl");
return Engines::Component::_duplicate(iobject);
}
-void MPIContainer_i::remove_impl(Engines::Component_ptr component_i)
+void Engines_MPIContainer_i::remove_impl(Engines::Component_ptr component_i)
{
int ip;
Engines::Component_ptr cptr;
for(ip= 1;ip<_nbproc;ip++){
spcptr = Engines::MPIObject::_narrow((*(pcptr->tior()))[ip]);
cptr = (Engines::Component_ptr)spcptr;
- (Engines::MPIContainer::_narrow((*_tior)[ip]))->remove_impl(cptr);
+ (Engines::MPIContainer::_narrow((*_tior)[ip]))->SPremove_impl(cptr);
}
}
+ Lremove_impl(component_i);
+}
+
+void Engines_MPIContainer_i::SPremove_impl(Engines::Component_ptr component_i)
+{
+ Lremove_impl(component_i);
+}
+
+void Engines_MPIContainer_i::Lremove_impl(Engines::Component_ptr component_i)
+{
+ int ip;
+ Engines::Component_ptr cptr;
+ Engines::MPIObject_ptr pcptr;
+ Engines::MPIObject_ptr spcptr;
+
+ BEGIN_OF("[" << _numproc << "] MPIContainer_i::Lremove_impl");
+
+ ASSERT(! CORBA::is_nil(component_i));
+
string instanceName = component_i->instanceName() ;
MESSAGE("[" << _numproc << "] unload component " << instanceName);
component_i->destroy() ;
{
MESSAGE("[" << _numproc << "] stay " << (*im).first);
}
+
+ END_OF("[" << _numproc << "] MPIContainer_i::Lremove_impl");
+
}
-void MPIContainer_i::finalize_removal()
+void Engines_MPIContainer_i::finalize_removal()
{
int ip;
- MESSAGE("[" << _numproc << "] finalize unload : dlclose");
-
if( _numproc == 0 ){
// Invocation de la destruction du composant dans les autres process
for(ip= 1;ip<_nbproc;ip++)
- (Engines::MPIContainer::_narrow((*_tior)[ip]))->finalize_removal();
+ (Engines::MPIContainer::_narrow((*_tior)[ip]))->SPfinalize_removal();
}
+ Lfinalize_removal();
+}
+
+void Engines_MPIContainer_i::SPfinalize_removal()
+{
+ Lfinalize_removal();
+}
+
+void Engines_MPIContainer_i::Lfinalize_removal()
+{
+ BEGIN_OF("[" << _numproc << "] MPIContainer_i::Lfinalize_removal");
+
map<string, void *>::iterator im ;
- _numInstanceMutex.lock() ; // lock on the explore remove_map & dlclose
+ // lock on the explore remove_map & dlclose
+ _numInstanceMutex.lock() ;
for (im = remove_map.begin() ; im != remove_map.end() ; im ++)
{
void * handle = (*im).second ;
- dlclose(handle) ;
MESSAGE("[" << _numproc << "] dlclose " << (*im).first);
+ dlclose(handle) ;
}
+ MESSAGE("[" << _numproc << "] remove_map.clear()");
remove_map.clear() ;
_numInstanceMutex.unlock() ;
- MESSAGE("[" << _numproc << "] remove_map.clear()");
+
+ END_OF("[" << _numproc << "] MPIContainer_i::Lfinalize_removal");
}
#define _SALOME_PCONTAINER_
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(MPIContainer)
+#include CORBA_SERVER_HEADER(SALOME_MPIContainer)
#include "SALOME_Container_i.hxx"
-#include "SALOME_NamingService.hxx"
-#include "Utils_SINGLETON.hxx"
-#include "OpUtil.hxx"
#include "MPIObject_i.hxx"
-class MPIContainer_i : public POA_Engines::MPIContainer,
- public Engines_Container_i,
- public MPIObject_i
+class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
+ public Engines_Container_i,
+ public MPIObject_i
{
public:
// Constructor
- MPIContainer_i( int nbproc, int numproc,
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- char * containerName);
+ Engines_MPIContainer_i( int nbproc, int numproc,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ char * containerName,
+ int argc, char *argv[]);
+ Engines_MPIContainer_i(int nbproc, int numproc);
// Destructor
- ~MPIContainer_i();
+ ~Engines_MPIContainer_i();
- // Load a component
+ // Launch a new MPI container from the current container
+ Engines::MPIContainer_ptr start_MPIimpl(const char* ContainerName,
+ CORBA::Short nbproc);
+
+ // 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
+ void SPremove_impl(Engines::Component_ptr component_i);
+
+ // synchronous version for process 0
void finalize_removal();
+ // asynchronous version for other process
+ void SPfinalize_removal();
+
+ private:
+ // local version to not duplicate code
+ // called by synchronous and asynchronous version
+ Engines::Component_ptr Lload_impl(const char* nameToRegister,
+ const char* componentName);
+ void Lremove_impl(Engines::Component_ptr component_i);
+ void Lfinalize_removal();
};
#endif
MPIObject_i::MPIObject_i()
{
- _nbproc = 1;
- _numproc = 0;
+ MPI_Comm_size( MPI_COMM_WORLD, &_nbproc );
+ MPI_Comm_rank( MPI_COMM_WORLD, &_numproc );
_tior=NULL;
}
Engines::IORTab* MPIObject_i::tior()
{
- Engines::IORTab* tior = new Engines::IORTab;
+ Engines::IORTab_var tior = new Engines::IORTab;
tior->length(_tior->length());
for(unsigned int ip=0;ip<tior->length();ip++)
- (*tior)[ip] = (*_tior)[ip];
- return tior;
+ tior[ip] = (*_tior)[ip];
+ return tior._retn();
};
void MPIObject_i::tior(const Engines::IORTab& ior)
(*_tior)[ip] = ior[ip];
}
-void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_var pobj,
+void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj,
bool amiCont)
{
int err, ip, n;
char *ior;
MPI_Status status; /* status de reception de message MPI */
- // Conversion IOR vers string
- CORBA::String_var sior(orb->object_to_string(pobj));
-
if( _numproc == 0 ){
//Allocation du tableau des IOR
- Engines::IORTab *iort = new Engines::IORTab;
+ Engines::IORTab_var iort = new Engines::IORTab;
iort->length(_nbproc);
- (*iort)[0] = pobj;
+ iort[0] = pobj;
// Process 0 recupere les ior de l'object sur les autres process
for(ip=1;ip<_nbproc;ip++){
exit(1);
}
// Allocation de la chaine de longueur n
- ior = (char*)calloc(n,sizeof(char));
+ ior = new char[n];
err = MPI_Recv(ior,n,MPI_CHAR,ip,2*ip,MPI_COMM_WORLD,&status);
if(err){
MESSAGE("[" << _numproc << "] MPI_RECV error");
exit(1);
}
- (*iort)[ip] = Engines::MPIObject::_narrow(orb->string_to_object(ior));
- free(ior);
+ iort[ip] = orb->string_to_object(ior);
+ delete [] ior;
}
// On donne le tableau des ior a l'objet Corba du process 0
if( amiCont )
- tior(*iort);
+ tior(*(iort._retn()));
else
- pobj->tior(*iort);
+ pobj->tior(*(iort._retn()));
}
else{
+ // Conversion IOR vers string
+ ior = orb->object_to_string(pobj);
+ n = strlen(ior) + 1;
// On envoie l'IOR au process 0
- n = strlen((char*)sior);
err = MPI_Send(&n,1,MPI_INT,0,_numproc,MPI_COMM_WORLD);
if(err){
MESSAGE("[" << _numproc << "] MPI_SEND error");
exit(1);
}
- err = MPI_Send((char*)sior,n,MPI_CHAR,0,2*_numproc,MPI_COMM_WORLD);
+ err = MPI_Send(ior,n,MPI_CHAR,0,2*_numproc,MPI_COMM_WORLD);
if(err){
MESSAGE("[" << _numproc << "] MPI_SEND error");
exit(1);
}
+ CORBA::string_free(ior);
}
}
#define _SALOME_POBJECT_I_H_
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(MPIObject)
+#include CORBA_SERVER_HEADER(SALOME_MPIObject)
class MPIObject_i: public POA_Engines::MPIObject
{
// IOR des objets paralleles sur tous les process mpi
Engines::IORTab* _tior;
// Echange des IOR de l'objet entre process
- void BCastIOR(CORBA::ORB_ptr orb,Engines::MPIObject_var pobj,bool amiCont);
+ void BCastIOR(CORBA::ORB_ptr orb,Engines::MPIObject_ptr pobj,bool amiCont);
} ;
#endif
LIB = libSalomeMPIContainer.la
LIB_SRC = MPIObject_i.cxx MPIContainer_i.cxx
-LIB_SERVER_IDL = TypeData.idl MPIObject.idl MPIContainer.idl
+LIB_SERVER_IDL = SALOME_MPIObject.idl SALOME_MPIContainer.idl
# Executables targets
BIN = SALOME_MPIContainer
BIN_SRC =
-BIN_SERVER_IDL = TypeData.idl MPIObject.idl MPIContainer.idl
+BIN_SERVER_IDL = SALOME_MPIObject.idl SALOME_MPIContainer.idl
-CXXFLAGS+=${MPI_INCLUDES}
-CXX_DEPEND_FLAG+=${MPI_INCLUDES}
-LDFLAGS+= -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil ${MPI_LIBS}
+LDFLAGS+= -lSalomeContainer -lSalomeNS -lRegistry -lOpUtil -lSalomeNotification -lSALOMELocalTrace
+
+ifeq (@WITHMPI@,yes)
+ CXXFLAGS+=${MPI_INCLUDES}
+ CXX_DEPEND_FLAG+=${MPI_INCLUDES}
+ LDFLAGS+= ${MPI_LIBS}
+endif
@CONCLUDE@
-// SALOME MPIContainer : implemenation of container based on MPI libraries
-//
-// 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.cxx
-// Module : SALOME
-
#include <iostream>
#include "MPIContainer_i.hxx"
+#include "Utils_ORB_INIT.hxx"
+#include "Utils_SINGLETON.hxx"
#include "utilities.h"
-#include "LocalTraceCollector.hxx"
#include <mpi.h>
using namespace std;
int main(int argc, char* argv[])
{
- LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance();
int nbproc, numproc;
- MPIContainer_i * myContainer;
+ int flag;
+ Engines_MPIContainer_i * myContainer=NULL;
BEGIN_OF(argv[0])
try {
MESSAGE("Connection MPI");
-
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&nbproc);
MPI_Comm_rank(MPI_COMM_WORLD,&numproc);
- MESSAGE("Initialisation CORBA");
+ MESSAGE("[" << numproc << "] Initialisation CORBA");
// Initialise the ORB.
- CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ // CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
// Obtain a reference to the root POA.
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
containerName = argv[1] ;
}
- MESSAGE("Chargement container sur proc: " << numproc);
- myContainer = new MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName);
- MESSAGE("Fin chargement container");
+ MESSAGE("[" << numproc << "] Chargement container");
+ myContainer = new Engines_MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName,argc,argv);
pman->activate();
orb->run();
orb->destroy();
- delete myContainer;
- MPI_Finalize();
}
- catch(CORBA::SystemException&) {
- INFOS("Caught CORBA::SystemException.")
+ catch(CORBA::SystemException&){
+ INFOS("Caught CORBA::SystemException.");
+ }
+ catch(PortableServer::POA::WrongPolicy&){
+ INFOS("Caught CORBA::WrongPolicyException.");
}
- catch(PortableServer::POA::WrongPolicy&)
- {
- INFOS("Caught CORBA::WrongPolicyException.")
+ catch(PortableServer::POA::ServantAlreadyActive&){
+ INFOS("Caught CORBA::ServantAlreadyActiveException");
}
- catch(PortableServer::POA::ServantAlreadyActive&)
- {
- INFOS("Caught CORBA::ServantAlreadyActiveException")
+ catch(CORBA::Exception&){
+ INFOS("Caught CORBA::Exception.");
}
- catch(CORBA::Exception&) {
- INFOS("Caught CORBA::Exception.")
+ catch(...){
+ INFOS("Caught unknown exception.");
}
- catch(...) {
- INFOS("Caught unknown exception.")
- }
+
+ if(myContainer)
+ delete myContainer;
+ MPI_Initialized(&flag);
+ if(flag)
+ MPI_Finalize();
+
END_OF(argv[0]);
- delete myThreadTrace;
- return 0;
}
}
Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer(
- const string theComputer ,
- const string theMPIContainerRoot,
+ const std::string theComputer ,
+ const std::string theMPIContainerRoot,
const int nbproc)
{
char nbp[1024];
sprintf(nbp,"_%d",nbproc);
- string theMPIContainer = theMPIContainerRoot + nbp;
- string aComputerContainer = theComputer + "/" + theMPIContainer;
+ std::string theMPIContainer = theMPIContainerRoot + nbp;
+ std::string aComputerContainer = theComputer + "/" + theMPIContainer;
SCRUTE( aComputerContainer ) ;
SCRUTE( theComputer ) ;
if ( !strcmp( &theMPIContainerRoot.c_str()[len-2] , "Py" ) ) {
pyCont = true ;
}
- string MPIFactoryServer = theComputer ;
+ std::string MPIFactoryServer = theComputer ;
if ( pyCont ) {
MPIFactoryServer += "/MPIFactoryServerPy" ;
}
// On n'a pas trouve le container generique: on lance le container demande
if ( CORBA::is_nil( aMPIFactoryServer ) ) {
// rsh -n ikkyo /export/home/rahuel/SALOME_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515 &
- string rsh( "" ) ;
+ std::string rsh( "" ) ;
if ( theComputer!= GetHostname() ) {
rsh += "rsh -n " ;
rsh += theComputer ;
rsh += " " ;
}
- string path = ComputerPath( theComputer.c_str() ) ;
+ std::string path = ComputerPath( theComputer.c_str() ) ;
SCRUTE( path ) ;
// rsh += "runSession " ;
if ( pyCont ) {
rsh += nbp;
rsh += theMPIContainer +" -" ;
}
- string omniORBcfg( getenv( "OMNIORB_CONFIG" ) ) ;
+ std::string omniORBcfg( getenv( "OMNIORB_CONFIG" ) ) ;
ifstream omniORBfile( omniORBcfg.c_str() ) ;
char ORBInitRef[12] ;
char nameservice[132] ;
Engines::MPIContainer_var _MPIFactoryServer ;
private:
- Engines::MPIContainer_var FindOrStartMPIContainer(const string theComputer ,
- const string theMPIContainerRoot,
+ Engines::MPIContainer_var FindOrStartMPIContainer(const std::string theComputer ,
+ const std::string theMPIContainerRoot,
const int nbproc) ;
} ;
RegistryDisplay ModuleGenerator SALOME_PYQT Loader Communication
ifeq (@mpi_ok@,yes)
- SUBDIRS+= MPIContainer
+ SUBDIRS+= MPIContainer MPILifeCycleCORBA TestMPIContainer
endif
ifeq (@WITHOPENPBS@,yes)
**
**********************************************************************/
-using namespace std;
#include "qsplitterP.h"
#ifndef QT_NO_COMPLEXWIDGETS
#include <qobjectlist.h>
#include <qapplication.h> //sendPostedEvents
+using namespace std;
#define SPLITTER_ICON_WIDTH 10
#define SPLITTER_ICON_HEIGHT 12
**
**********************************************************************/
-using namespace std;
#include "qworkspaceP.h"
#include <qapplication.h>
#include <private/qapplication_p.h>
#include <private/qinternal_p.h>
+using namespace std;
#define BUTTON_WIDTH 16
#define BUTTON_HEIGHT 14
throw SALOME::SALOME_Exception(ExDescription); \
}
-#include <ostream.h>
+#include <iostream>
//Dump the CORBA exception type.
-static ostream& operator<<(ostream& os, const CORBA::Exception& e)
+static std::ostream& operator<<(std::ostream& os, const CORBA::Exception& e)
{
CORBA::Any tmp;
tmp<<= e;
StoreSignalHandler(mySigHandlerCont,SIGTERM); // termination
StoreSignalHandler(mySigHandlerCont,SIGSEGV); // segmentation
//StoreSignalHandler(mySigHandlerCont,SIGABRT); // abort (ANSI).
- StoreSignalHandler(mySigHandlerCont,SIGSTKFLT); // stack fault.
+ // portage CCRT
+ // StoreSignalHandler(mySigHandlerCont,SIGSTKFLT); // stack fault.
}
// Module : SALOME
# include "Utils_Timer.hxx"
-# include <stream.h>
+# include <iostream>
#include "utilities.h"
using namespace std;