]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Adding a new flag for configure: --enable-mpi-seq-container
authorribes <ribes>
Mon, 30 Mar 2009 09:30:33 +0000 (09:30 +0000)
committerribes <ribes>
Mon, 30 Mar 2009 09:30:33 +0000 (09:30 +0000)
It permits to choose if you enable mpi support into SALOME_Container
(default is no even if mpi is ok)

configure.ac
salome_adm/unix/config_files/production.m4
src/Container/Makefile.am
src/Container/SALOME_Container.cxx

index 844d28f585ea9d781e6522a421b2ee4b8524688e..3716d879ede899db2a430d1853127319b912c4e7 100644 (file)
@@ -126,6 +126,7 @@ echo
 # production.m4
 AC_ENABLE_DEBUG(no)
 AC_ENABLE_PRODUCTION(no)
+AC_ENABLE_MPI_SEQ_CONTAINER(no)
 
 echo
 echo ---------------------------------------------
index e109a03dcbde6a9dfb0ec98ac61b1779242e1730..6b61d9207ffac22028eb50db184d5fe3a7c2c9f0 100644 (file)
@@ -82,3 +82,25 @@ fi
 
 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
 AC_DEFUN([AC_DISABLE_DEBUG], [AC_ENABLE_DEBUG(no)])
+
+dnl AC_ENABLE_MPI_SEQ_CONTAINER
+dnl
+dnl This macro enables mpi into the sequential container
+dnl default = not enabled
+dnl
+AC_DEFUN([AC_ENABLE_MPI_SEQ_CONTAINER],
+    [define([AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT], ifelse($1, no, no, yes))dnl
+    AC_ARG_ENABLE([mpi-seq-container],
+       [AC_HELP_STRING([--enable-mpi-seq-container],
+             [enable mpi into seq container @<:@default=]AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT[@:>@])],
+    [
+    enable_mpi_seq_container=$enableval
+    ],
+    [enable_mpi_seq_container=]AC_ENABLE_MPI_SEQ_CONTAINER_DEFAULT)
+
+if test "X$enable_mpi_seq_container" = "Xyes"; then
+  CFLAGS="$CFLAGS -D_MPI_SEQ_CONTAINER_ "
+  CXXFLAGS="$CXXFLAGS -D_MPI_SEQ_CONTAINER_ "
+fi
+AM_CONDITIONAL([WITH_MPI_SEQ_CONTAINER], [test "x$enable_mpi_seq_container" = "xyes"])
+])
index 5f8172cff83bad609ce0e7e3ee4a0158f7669f2e..394ea10358b0604eaad5e324201f2e6dfcd1258a 100644 (file)
@@ -61,7 +61,6 @@ dist_salomescript_SCRIPTS=\
 # This local variable defines the list of CPPFLAGS common to all target in this package.
 COMMON_CPPFLAGS=\
        @PYTHON_INCLUDES@ \
-       @MPI_INCLUDES@ \
        @HDF5_INCLUDES@ \
        -I$(srcdir)/../Batch \
        -I$(srcdir)/../Basics \
@@ -89,10 +88,14 @@ COMMON_LIBS =\
        ../HDFPersist/libSalomeHDFPersist.la \
        ../Batch/libSalomeBatch.la \
        $(top_builddir)/idl/libSalomeIDLKernel.la \
-       @MPI_LIBS@ \
        @CORBA_LIBS@ \
        $(PYTHON_LIBS)
 
+if WITH_MPI_SEQ_CONTAINER      
+COMMON_CPPFLAGS += @MPI_INCLUDES@
+COMMON_LIBS += @MPI_LIBS@
+endif
+
 #
 # ===============================================================
 # Libraries targets
@@ -142,10 +145,13 @@ SALOME_Container_LDADD = \
        libSalomeContainer.la \
        ../Basics/libSALOMEBasics.la \
        $(HDF5_LIBS) \
-       $(MPI_LIBS) \
        $(CORBA_LIBS) \
        $(PYTHON_LIBS)
 
+if WITH_MPI_SEQ_CONTAINER      
+SALOME_Container_LDADD += $(MPI_LIBS)
+endif
+
 SALOME_Container_LDFLAGS  =\
 -Xlinker -export-dynamic
 
@@ -159,6 +165,6 @@ TestSalome_file_LDADD =\
        libSalomeContainer.la \
        ../Basics/libSALOMEBasics.la \
        $(HDF5_LIBS) \
-       $(MPI_LIBS) \
        $(CORBA_LIBS) \
        $(PYTHON_LIBS)
+
index 07024cd13e697a9ced9594a74583f79a6ac131ec..fe1959ff04f2a6210ea0b50e2599e884df51fc44 100644 (file)
 //  Module : SALOME
 //  $Header$
 //
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
 #include <mpi.h>
+  #endif
 #endif
 
 #include <iostream>
@@ -118,9 +120,11 @@ void unexpectedHandler(void)
 
 int main(int argc, char* argv[])
 {
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
   MPI_Init(&argc,&argv);
-#endif
+  #endif
+#endif  
 
 #ifndef WIN32
   if(getenv ("DEBUGGER"))
@@ -225,9 +229,11 @@ int main(int argc, char* argv[])
       INFOS("Caught unknown exception.");
     }
 
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
   MPI_Finalize();
-#endif
+  #endif
+#endif  
 
   //END_OF(argv[0]);
   //LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();