]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
merge from V1_2_4_with_MPI pour portage CCRT
authorsecher <secher>
Wed, 10 Nov 2004 11:53:05 +0000 (11:53 +0000)
committersecher <secher>
Wed, 10 Nov 2004 11:53:05 +0000 (11:53 +0000)
27 files changed:
configure.in.base
idl/Makefile.in
salome_adm/unix/config_files/ac_cxx_depend_flag.m4
salome_adm/unix/config_files/check_cas.m4
salome_adm/unix/config_files/check_mpich.m4
salome_adm/unix/config_files/check_pthreads.m4
salome_adm/unix/config_files/check_sip.m4
salome_adm/unix/config_files/check_vtk.m4
salome_adm/unix/config_files/production.m4
salome_adm/unix/config_files/python.m4
salome_adm/unix/make_commence.in
src/Container/SALOME_Container_i.hxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx
src/MPIContainer/MPIContainer_i.cxx
src/MPIContainer/MPIContainer_i.hxx
src/MPIContainer/MPIObject_i.cxx
src/MPIContainer/MPIObject_i.hxx
src/MPIContainer/Makefile.in
src/MPIContainer/SALOME_MPIContainer.cxx
src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.cxx
src/MPILifeCycleCORBA/SALOME_MPILifeCycleCORBA.hxx
src/Makefile.in
src/PatchQt/qsplitterP.cxx
src/PatchQt/qworkspaceP.cxx
src/Utils/Utils_CorbaException.hxx
src/Utils/Utils_SignalsHandler.cxx
src/Utils/Utils_Timer.cxx

index 0eef838db2ab3e6fd9498899f4c078614e488d8a..e0760a01e9ccb80776a16bad670748174623b8b3 100644 (file)
@@ -14,7 +14,7 @@
 #
 # Created from configure.in.base
 #
-
+AS_SHELL_SANITIZES
 AC_INIT(src)
 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
 AC_CANONICAL_HOST
@@ -48,6 +48,10 @@ echo Build  root directory : $ROOT_BUILDDIR
 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
@@ -68,9 +72,6 @@ AC_PROG_INSTALL
 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 ---------------------------------------------
@@ -86,7 +87,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the
 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
 
@@ -100,22 +101,34 @@ cc_ok=no
 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 ---------------------------------------------
index 7de067f7454eff8be80916d2ee980c517707c64a..6e46e61bd1c4b576c0e36f9236923ddafe4736bb 100644 (file)
@@ -22,9 +22,8 @@ IDL_FILES = \
   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
index 7c87413dd8ef9e9da0412e899d84f00cd1dd6045..5dd873fd2c4da7d5273979be2306f35fc20267d2 100644 (file)
@@ -35,17 +35,34 @@ ac_cv_depend_flag,
  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
@@ -54,12 +71,12 @@ ac_cv_depend_flag,
 
 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
@@ -70,7 +87,7 @@ dnl use gcc option -MG : asume unknown file will be construct later
     exit
  fi
 
- echo -n " C : " ${C_DEPEND_FLAG}
+ printf " C :  ${DEPCC} ${C_DEPEND_FLAG}"
 
  AC_LANG_CPLUSPLUS
  echo "conftest.o: conftest.cxx" > conftest.verif
@@ -80,13 +97,13 @@ dnl use gcc option -MG : asume unknown file will be construct later
  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
@@ -95,12 +112,12 @@ dnl use gcc option -MG : asume unknown file will be construct later
 
 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
@@ -112,9 +129,12 @@ dnl use g++ option -MG : asume unknown file will be construct later
     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)
 ])
index 85d8f0c73e3b111c8b5c375b19daa9e226d19499..eed46982c6d0cf5cc2b98472b9b0992bfd07da1b 100644 (file)
@@ -36,7 +36,6 @@ AC_SUBST(CAS_MODELER)
 AC_SUBST(CAS_OCAF)
 AC_SUBST(CAS_DATAEXCHANGE)
 AC_SUBST(CAS_LDFLAGS)
-
 AC_SUBST(CAS_LDPATH)
 
 OWN_CONFIG_H=no
@@ -47,7 +46,6 @@ CAS_LDFLAGS=""
 occ_ok=no
 own_config_h=no
 
-
 dnl libraries directory location
 case $host_os in
    linux*)
@@ -62,7 +60,7 @@ case $host_os in
    irix6.*)
       casdir=Linux
       ;;
-   osf4.*)
+   osf*)
       casdir=Linux
       ;;
    solaris2.*)
@@ -73,6 +71,20 @@ case $host_os in
       ;;
 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)
@@ -90,13 +102,19 @@ fi
 
 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
@@ -125,32 +143,19 @@ dnl cascade headers
     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";
@@ -160,28 +165,36 @@ using namespace std;
   ])
   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
index 5b34bcd806519c49d89fcdb85818c8ba2fe5a763..ea7b9d1bfef927145316e5daf1c6d8f1f7ac89bf 100644 (file)
@@ -52,16 +52,14 @@ if test "$WITHMPICH" = yes; then
   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
index 0608c4a40489f029b0f4427288c5c3f74a4b5c0a..983bfc20076571ef473c0a830d5a919f9e9416e4 100644 (file)
@@ -30,22 +30,21 @@ dnl@id $Id$
 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
index feecb0dde36a765e526746b4d7181d88e4fb6227..48a025918c32991048b7c7714351e774a0ed44a8 100644 (file)
@@ -28,10 +28,17 @@ else
            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"
@@ -44,11 +51,11 @@ else
 
     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"
index 1b1a8d1a1845e3a92347e0306cabfec012e1afdc..4b4b1454fab0c07c93f3cdcb6d164863b686e03a 100644 (file)
@@ -48,10 +48,16 @@ then
    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 
@@ -64,7 +70,7 @@ fi
 
 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")
 
@@ -82,7 +88,7 @@ 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"
 
index b115b8aab84c79fdddd6c6c918b9f398c7b763d9..1cebe979e09be50fc9793d107fb83bbc9ffa28ac 100644 (file)
@@ -53,16 +53,25 @@ no) enable_production=no ;;
 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
 ])
 
index b86c21d35c50295a7a38c58b19950cb4bf2e3a21..b99b9d138009e8ac65a713b033aaa5ddb4f5ea78 100644 (file)
@@ -126,8 +126,8 @@ 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
@@ -135,8 +135,8 @@ 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
@@ -144,8 +144,8 @@ 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
@@ -153,8 +153,8 @@ 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
index e421712461fcbcaa5b7618253c2a51f0a87be568..e294c2f1c31d78fa669453c3c9755a714960f79b 100644 (file)
@@ -2,7 +2,8 @@
 inc_builddir=$(top_builddir)/include/salome
 
 @SET_MAKE@
-SHELL=/bin/sh
+# Modifcation B. Secher portage sur osf
+SHELL=@SHELL@
 
 # header missing
 
@@ -10,9 +11,10 @@ HAVE_SSTREAM=@HAVE_SSTREAM@
 
 
 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@
 
index e960a3b830b902cb7b437d5fa31a694c6cf9cdf0..6a65dcb3c86457be9fe9fa4a129c285cc709284c 100644 (file)
@@ -91,7 +91,7 @@ protected:
   std::map<std::string, void *> remove_map ;
   omni_mutex _numInstanceMutex ; // if several threads on the same object
 
-private: 
+  //private: 
 
   int   _argc ;
   char** _argv ;
index 2338fe34c690ebc4cfe4abadd25768b7af09f321..23b4e8797bd0ac4ed8b2b532f8fc9e8ff61dd855 100644 (file)
@@ -55,7 +55,7 @@ protected:
   SALOME_NamingService *_NS;
   Engines::Container_var _FactoryServer ;
 
-private:
+  //private:
   std::string ContainerName( const char * aComputerContainer ,
                         std::string * theComputer ,
                         std::string * theContainer ) ;
index e02449626cb2dd789bfaaa90f90321f4ec74eb9f..ad729c45ae07eaf880699114ef8356a2c294fb27 100644 (file)
 #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
@@ -55,52 +63,176 @@ MPIContainer_i::MPIContainer_i(int nbproc, int numproc,
   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,
@@ -121,6 +253,7 @@ Engines::Component_ptr MPIContainer_i::load_impl(const char* nameToRegister,
   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);
   }
@@ -128,32 +261,32 @@ Engines::Component_ptr MPIContainer_i::load_impl(const char* nameToRegister,
     // 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;
@@ -168,10 +301,29 @@ void MPIContainer_i::remove_impl(Engines::Component_ptr component_i)
     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() ;
@@ -190,29 +342,45 @@ void MPIContainer_i::remove_impl(Engines::Component_ptr component_i)
     {
       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");
 }
index 390f6ce738cc8495a260b001136b4e84cb3e0cf2..7d9ddc9a26425bdea04da91a5f1e32785462a0a8 100644 (file)
 #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
index c32e204bd257a15fdcbdec41d79f4d3f982b169f..0da19e33ca5753158c78f16f0951fd48bd9b7590 100644 (file)
@@ -31,8 +31,8 @@ using namespace std;
 
 MPIObject_i::MPIObject_i()
 {
-  _nbproc = 1;
-  _numproc = 0;
+  MPI_Comm_size( MPI_COMM_WORLD, &_nbproc );
+  MPI_Comm_rank( MPI_COMM_WORLD, &_numproc );
   _tior=NULL;
 }
 
@@ -50,11 +50,11 @@ MPIObject_i::~MPIObject_i()
 
 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)
@@ -65,23 +65,20 @@ 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++){
@@ -91,35 +88,38 @@ void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_var pobj,
        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);
   }
 
 }
index e504bb829843cea777f4925570724690ff2f451e..d15a1b4d5174a5c835704621acfdda5478a8b1d0 100644 (file)
@@ -28,7 +28,7 @@
 #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
 {
@@ -48,7 +48,7 @@ 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
index 5576a570a74a10c5631626393929a250a962d51e..ae1ab27576ec7b96f4762f798d63a8fc210c321e 100644 (file)
@@ -44,15 +44,19 @@ EXPORT_HEADERS = \
 
 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@
index 5f008c70cf9cddecc33ac81e5e6306163be9b4e8..d6fb4474fc110c4eb32072064f234926bab00d6f 100644 (file)
@@ -1,54 +1,31 @@
-//  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");
@@ -88,37 +65,37 @@ int main(int argc, char* argv[])
        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;
 }
 
index cfa9f4c77c193b906c3799be6df5dc45aa9a95ff..9d342ca3238c001bd083d7e64111a56e0980ab2a 100644 (file)
@@ -41,15 +41,15 @@ SALOME_MPILifeCycleCORBA::~SALOME_MPILifeCycleCORBA()
 }
 
 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 ) ;
@@ -72,7 +72,7 @@ Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer(
     if ( !strcmp( &theMPIContainerRoot.c_str()[len-2] , "Py" ) ) {
       pyCont = true ;
     }
-    string MPIFactoryServer = theComputer ;
+    std::string MPIFactoryServer = theComputer ;
     if ( pyCont ) {
       MPIFactoryServer += "/MPIFactoryServerPy" ;
     }
@@ -85,13 +85,13 @@ Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer(
     // 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 ) {
@@ -105,7 +105,7 @@ Engines::MPIContainer_var SALOME_MPILifeCycleCORBA::FindOrStartMPIContainer(
         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] ;
index dfac110345f6e0e8f275f5e4a77f52a0eca13c61..e560a072e460e1639d68ba44c4958c571c3b707b 100644 (file)
@@ -36,8 +36,8 @@ protected:
   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) ;
 
 } ;
index 684d6230548e7a8abb78b1ade1e252bcf0e4c887..d40b8e22b424839364dd33cc9594b01fcb640c14 100644 (file)
@@ -45,7 +45,7 @@ SUBDIRS = MSG2QM SALOMELocalTrace Logger Utils CASCatch PatchQt \
           RegistryDisplay ModuleGenerator SALOME_PYQT Loader Communication
 
 ifeq (@mpi_ok@,yes)
-  SUBDIRS+= MPIContainer
+  SUBDIRS+= MPIContainer MPILifeCycleCORBA TestMPIContainer
 endif
 
 ifeq (@WITHOPENPBS@,yes)
index fd2a7fc5c6aa2c82ae0950a084f66f4ad728bf43..cbe25a69111404fd138891b631b367afe9fa49b6 100644 (file)
@@ -41,7 +41,6 @@
 **
 **********************************************************************/
 
-using namespace std;
 #include "qsplitterP.h"
 #ifndef QT_NO_COMPLEXWIDGETS
 
@@ -61,6 +60,7 @@ using namespace std;
 
 #include <qobjectlist.h>
 #include <qapplication.h> //sendPostedEvents
+using namespace std;
 
 #define SPLITTER_ICON_WIDTH 10
 #define SPLITTER_ICON_HEIGHT 12
index f73e7392787fa6810d8fb965eb3059f6c163b4d6..1a959ae47f4008f17ae4ab28c4e40c86b613c851 100644 (file)
@@ -41,7 +41,6 @@
 **
 **********************************************************************/
 
-using namespace std;
 #include "qworkspaceP.h"
 
 #include <qapplication.h>
@@ -73,6 +72,7 @@ using namespace std;
 
 #include <private/qapplication_p.h>
 #include <private/qinternal_p.h>
+using namespace std;
 
 #define BUTTON_WIDTH   16
 #define BUTTON_HEIGHT  14
index d785f16d103250a0c33228c917b93dcceeff5136..44d642b86fe0f7dba6b0f832051b6979f0080b2f 100644 (file)
@@ -45,9 +45,9 @@
                 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;
index d8af06d926fa032af1c6f85ec9526c58e631c0e8..a76eb3eafb909da5fa5df775fb466901d3fe3135 100644 (file)
@@ -88,7 +88,8 @@ Utils_SignalsHandler::Utils_SignalsHandler()
   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.  
 }
 
 
index 74a64bac72c0117f0bf806f143ffd809900a25c3..67153429ee3c715d27d0cf8bbcfe4195232bd652 100644 (file)
@@ -25,7 +25,7 @@
 //  Module : SALOME
 
 # include "Utils_Timer.hxx"
-# include <stream.h>
+# include <iostream>
 
 #include "utilities.h"
 using namespace std;