MPI function added and gateway prototype added for toolboxes. 43/18543/12
Cedric Delamarre [Thu, 8 Sep 2016 13:53:14 +0000 (15:53 +0200)]
  * MPI_Create_comm function added.
  * scicppopt type of gateway proto added.
  * management of given comm in MPI functions.
  * doc updated, test added.

Change-Id: I71699ee8cb3a828c36fdf9c5c716fbb1fce6aaf5

40 files changed:
scilab/CHANGES.md
scilab/modules/dynamic_link/macros/ilib_compile.sci
scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci
scilab/modules/modules_manager/help/en_US/tbx_build_gateway.xml
scilab/modules/mpi/Makefile.am
scilab/modules/mpi/Makefile.in
scilab/modules/mpi/help/en_US/MPI_Bcast.xml
scilab/modules/mpi/help/en_US/MPI_Create_comm.xml [new file with mode: 0644]
scilab/modules/mpi/help/en_US/MPI_Finalize.xml [new file with mode: 0644]
scilab/modules/mpi/help/en_US/MPI_Init.xml
scilab/modules/mpi/help/en_US/MPI_Irecv.xml
scilab/modules/mpi/help/en_US/MPI_Isend.xml
scilab/modules/mpi/help/en_US/MPI_Recv.xml
scilab/modules/mpi/help/en_US/MPI_Send.xml
scilab/modules/mpi/help/en_US/MPI_Wait.xml
scilab/modules/mpi/help/ja_JP/MPI_Bcast.xml
scilab/modules/mpi/help/ja_JP/MPI_Init.xml
scilab/modules/mpi/help/ja_JP/MPI_Irecv.xml
scilab/modules/mpi/help/ja_JP/MPI_Isend.xml
scilab/modules/mpi/help/ja_JP/MPI_Recv.xml
scilab/modules/mpi/help/ja_JP/MPI_Send.xml
scilab/modules/mpi/help/ja_JP/MPI_Wait.xml
scilab/modules/mpi/includes/getOptionalComm.h [new file with mode: 0644]
scilab/modules/mpi/includes/mpi_gw.hxx [new file with mode: 0644]
scilab/modules/mpi/includes/sciMpiComm.hxx [new file with mode: 0644]
scilab/modules/mpi/mpi.vcxproj
scilab/modules/mpi/mpi.vcxproj.filters
scilab/modules/mpi/sci_gateway/c/sci_mpi_bcast.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_rank.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_size.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_init.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_irecv.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_isend.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c
scilab/modules/mpi/sci_gateway/c/sci_mpi_wait.c
scilab/modules/mpi/sci_gateway/cpp/sci_mpi_createComm.cpp [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/mpi_gateway.xml
scilab/modules/mpi/src/cpp/getOptionalComm.cpp [new file with mode: 0644]
scilab/modules/mpi/tests/unit_tests/mpi_create_comm.tst [new file with mode: 0644]

index 3dc8445..1864594 100644 (file)
@@ -155,7 +155,7 @@ Feature changes and additions
 * The zoom rubber box now can start/finish from points lying outside the axes bounds.
 * The zoom rubber box now can select multiple and overlying axes at once. Changed behavior of scroll zoom, scrolling over overlying axes will zoom all of them together, using the CTRL key while scrolling will zoom all axes in the current figure.
 * The graphics entity "Datatip" has a new property `detached_position` which accepts `[]` or a 3-components vector to set the position in axes coordinates to draw the datatip text box.
-
+* `MPI_Create_comm` create a new communicator from MPI_COMM_WORLD using MPI world ranks.
 
 Help pages:
 -----------
index b9a69b8..042c448 100644 (file)
@@ -98,6 +98,10 @@ function libn = ilib_compile(lib_name, ..
             defaultModulesFHeader=[ "core" ];
             ScilabTreeFound=%t
 
+            if isdef("MPI_Init") then
+                defaultModulesCHeader = [defaultModulesCHeader, "mpi"]
+            end
+
             for x = defaultModulesCHeader;
                 cflags = cflags + " -I" + SCI + "/modules/" + x + "/includes/ ";
             end
@@ -115,6 +119,9 @@ function libn = ilib_compile(lib_name, ..
         if isdir(SCI+"/../../include/scilab/") & ~ScilabTreeFound then
             cflags="-I"+SCI+"/../../include/scilab/ -I"+SCI+"/../../include/ " + cflags
             fflags="-I"+SCI+"/../../include/scilab/ " + fflags
+            if isdef("MPI_Init") then
+                cflags = "-I"+SCI+"/../../include/scilab/mpi/ " + cflags
+            end
             ScilabTreeFound=%t
         end
 
@@ -122,6 +129,9 @@ function libn = ilib_compile(lib_name, ..
         if isdir("/usr/include/scilab/") & ~ScilabTreeFound then
             cflags="-I/usr/include/scilab/ "+cflags
             fflags="-I/usr/include/scilab/ "+fflags
+            if isdef("MPI_Init") then
+                cflags="-I/usr/include/scilab/mpi/ "+cflags
+            end
             ScilabTreeFound=%t
         end
 
index 142ea3b..7365826 100644 (file)
@@ -254,6 +254,10 @@ function [gate,names,cppCompilation] = new_names(table)
             cppCompilation = %t;
             names(i) = table(i,2);
             gate(i, 2) = "CPP_GATEWAY_PROTOTYPE(" + names(i) + ");";
+        case "cppsciopt"  then
+            cppCompilation = %t;
+            names(i) = table(i,2);
+            gate(i, 2) = "CPP_OPT_GATEWAY_PROTOTYPE(" + names(i) + ");";
         case "direct"  then
             names(i) = table(i,2);
             gate(i, 1) = "STACK_GATEWAY_PROTOTYPE(" + names(i) + ");";
index cd29a43..846883c 100644 (file)
@@ -2,7 +2,7 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA
- * 
+ *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
@@ -45,6 +45,7 @@
                             <para>cmex : C mexlib entry point for MexLib</para>
                             <para>fmex : Fortran mexlib entry point for MexLib</para>
                             <para>cppsci : C++ entry point for C++ API Scilab</para>
+                            <para>cppsciopt : C++ entry point for C++ API Scilab with optional arguments</para>
                         </listitem>
                     </para>
                 </listitem>
@@ -97,7 +98,7 @@
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 // Recommended usage
 tbx_build_gateway('mytoolbox', ['c_sum','sci_csum';'c_sub','sci_csub'], ['sci_csum.c','sci_csub.c'], ..
                   get_absolute_file_path('builder_gateway_c.sce'), ..
index 723e970..9ece3c3 100644 (file)
 # For more information, see the COPYING file which you should have received
 # along with this program.
 
-MPI_C_SOURCES =     src/c/serialization.c \
+MPI_CPP_SOURCES = \
+    src/cpp/getOptionalComm.cpp
+
+MPI_C_SOURCES = \
+    src/c/serialization.c \
     src/c/deserialization.c
 
 # List of the gateway c files
@@ -27,30 +31,39 @@ GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_mpi_wait.c \
     sci_gateway/c/sci_mpi_get_processor_name.c
 
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_mpi_createComm.cpp
+
 # Includes need for the compilation
 # MPI code needs to be compile with the openmpi 'compiler' (it is a wrapper)
 CC = $(OPENMPI_CC)
-libscimpi_la_CFLAGS=  -Iincludes/ \
-       -Isrc/c/ \
-       -I$(top_srcdir)/libs/MALLOC/includes/ \
-       -I$(top_srcdir)/modules/ast/includes/ast \
-       -I$(top_srcdir)/modules/ast/includes/operations \
-       -I$(top_srcdir)/modules/ast/includes/types \
-       -I$(top_srcdir)/modules/ast/includes/system_env \
-       -I$(top_srcdir)/modules/output_stream/includes \
-       -I$(top_srcdir)/modules/localization/includes \
-       -I$(top_srcdir)/modules/api_scilab/includes \
-       -I$(top_srcdir)/modules/elementary_functions/includes
+libscimpi_la_CPPFLAGS=  -Iincludes/ \
+    -Isrc/c/ \
+    -I$(top_srcdir)/modules/ast/includes/ast/ \
+    -I$(top_srcdir)/modules/ast/includes/exps/ \
+    -I$(top_srcdir)/modules/ast/includes/operations/ \
+    -I$(top_srcdir)/modules/ast/includes/parse/ \
+    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+    -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    $(OPENMPI_CFLAGS)
 
 # libscimpi_la_LDFLAGS = $(LAMPI_LDFLAGS)
-libscimpi_la_LIBADD = $(OPENMPI_LIBS)
+libscimpi_la_LIBADD = $(OPENMPI_LIBS) -lmpi++
 
 # Name of the future library (.la will be replace by .so, .a, etc regarding
 # the system)
 pkglib_LTLIBRARIES = libscimpi.la
 
 # All the sources needed by libscimpi.la
-libscimpi_la_SOURCES =   $(GATEWAY_C_SOURCES)  $(MPI_C_SOURCES)
+libscimpi_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(MPI_C_SOURCES) $(MPI_CPP_SOURCES)
 #$(GATEWAY_FORTRAN_SOURCES) $(MPI_FORTRAN_SOURCES)
 
 
@@ -71,7 +84,8 @@ libscimpi_la_sci_gateway_DATA = sci_gateway/mpi_gateway.xml
 
 #### mpi : include files ####
 libscimpi_la_includedir=$(pkgincludedir)/mpi
-libscimpi_la_include_HEADERS = includes/gw_mpi.h
+libscimpi_la_include_HEADERS = includes/gw_mpi.h \
+                               includes/sciMpiComm.hxx
 
 # Provides macros compilation, Java compilation, cleaning
 include $(top_srcdir)/Makefile.incl.am
index 492913e..6f48f32 100644 (file)
@@ -197,17 +197,17 @@ am__objects_1 = sci_gateway/c/libscimpi_la-sci_mpi_init.lo \
        sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo \
        sci_gateway/c/libscimpi_la-sci_mpi_wait.lo \
        sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo
-am__objects_2 = src/c/libscimpi_la-serialization.lo \
+am__objects_2 = sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo
+am__objects_3 = src/c/libscimpi_la-serialization.lo \
        src/c/libscimpi_la-deserialization.lo
-am_libscimpi_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+am__objects_4 = src/cpp/libscimpi_la-getOptionalComm.lo
+am_libscimpi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
+       $(am__objects_3) $(am__objects_4)
 libscimpi_la_OBJECTS = $(am_libscimpi_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-libscimpi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libscimpi_la_CFLAGS) \
-       $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -242,6 +242,24 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
 SOURCES = $(libscimpi_la_SOURCES)
 DIST_SOURCES = $(libscimpi_la_SOURCES)
 am__can_run_installinfo = \
@@ -566,7 +584,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-MPI_C_SOURCES = src/c/serialization.c \
+MPI_CPP_SOURCES = \
+    src/cpp/getOptionalComm.cpp
+
+MPI_C_SOURCES = \
+    src/c/serialization.c \
     src/c/deserialization.c
 
 
@@ -584,28 +606,37 @@ GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_mpi_wait.c \
     sci_gateway/c/sci_mpi_get_processor_name.c
 
-libscimpi_la_CFLAGS = -Iincludes/ \
-       -Isrc/c/ \
-       -I$(top_srcdir)/libs/MALLOC/includes/ \
-       -I$(top_srcdir)/modules/ast/includes/ast \
-       -I$(top_srcdir)/modules/ast/includes/operations \
-       -I$(top_srcdir)/modules/ast/includes/types \
-       -I$(top_srcdir)/modules/ast/includes/system_env \
-       -I$(top_srcdir)/modules/output_stream/includes \
-       -I$(top_srcdir)/modules/localization/includes \
-       -I$(top_srcdir)/modules/api_scilab/includes \
-       -I$(top_srcdir)/modules/elementary_functions/includes
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_mpi_createComm.cpp
+
+libscimpi_la_CPPFLAGS = -Iincludes/ \
+    -Isrc/c/ \
+    -I$(top_srcdir)/modules/ast/includes/ast/ \
+    -I$(top_srcdir)/modules/ast/includes/exps/ \
+    -I$(top_srcdir)/modules/ast/includes/operations/ \
+    -I$(top_srcdir)/modules/ast/includes/parse/ \
+    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+    -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    $(OPENMPI_CFLAGS)
 
 
 # libscimpi_la_LDFLAGS = $(LAMPI_LDFLAGS)
-libscimpi_la_LIBADD = $(OPENMPI_LIBS)
+libscimpi_la_LIBADD = $(OPENMPI_LIBS) -lmpi++
 
 # Name of the future library (.la will be replace by .so, .a, etc regarding
 # the system)
 pkglib_LTLIBRARIES = libscimpi.la
 
 # All the sources needed by libscimpi.la
-libscimpi_la_SOURCES = $(GATEWAY_C_SOURCES)  $(MPI_C_SOURCES)
+libscimpi_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(MPI_C_SOURCES) $(MPI_CPP_SOURCES)
 #$(GATEWAY_FORTRAN_SOURCES) $(MPI_FORTRAN_SOURCES)
 
 #### Target ######
@@ -625,7 +656,9 @@ libscimpi_la_sci_gateway_DATA = sci_gateway/mpi_gateway.xml
 
 #### mpi : include files ####
 libscimpi_la_includedir = $(pkgincludedir)/mpi
-libscimpi_la_include_HEADERS = includes/gw_mpi.h
+libscimpi_la_include_HEADERS = includes/gw_mpi.h \
+                               includes/sciMpiComm.hxx
+
 
 # Where all the Scilab stuff is installed (macros, help, ...)
 mydatadir = $(pkgdatadir)/modules/$(modulename)
@@ -702,7 +735,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .sci .bin .c .lo .o .obj
+.SUFFIXES: .sci .bin .c .cpp .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -807,6 +840,15 @@ sci_gateway/c/libscimpi_la-sci_mpi_wait.lo:  \
 sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/$(am__dirstamp):
+       @$(MKDIR_P) sci_gateway/cpp
+       @: > sci_gateway/cpp/$(am__dirstamp)
+sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) sci_gateway/cpp/$(DEPDIR)
+       @: > sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 src/c/$(am__dirstamp):
        @$(MKDIR_P) src/c
        @: > src/c/$(am__dirstamp)
@@ -817,16 +859,28 @@ src/c/libscimpi_la-serialization.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libscimpi_la-deserialization.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
+src/cpp/$(am__dirstamp):
+       @$(MKDIR_P) src/cpp
+       @: > src/cpp/$(am__dirstamp)
+src/cpp/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/cpp/$(DEPDIR)
+       @: > src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscimpi_la-getOptionalComm.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libscimpi.la: $(libscimpi_la_OBJECTS) $(libscimpi_la_DEPENDENCIES) $(EXTRA_libscimpi_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(libscimpi_la_LINK) -rpath $(pkglibdir) $(libscimpi_la_OBJECTS) $(libscimpi_la_LIBADD) $(LIBS)
+       $(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libscimpi_la_OBJECTS) $(libscimpi_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
        -rm -f sci_gateway/c/*.$(OBJEXT)
        -rm -f sci_gateway/c/*.lo
+       -rm -f sci_gateway/cpp/*.$(OBJEXT)
+       -rm -f sci_gateway/cpp/*.lo
        -rm -f src/c/*.$(OBJEXT)
        -rm -f src/c/*.lo
+       -rm -f src/cpp/*.$(OBJEXT)
+       -rm -f src/cpp/*.lo
 
 distclean-compile:
        -rm -f *.tab.c
@@ -842,8 +896,10 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_recv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_send.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_wait.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscimpi_la-sci_mpi_createComm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscimpi_la-deserialization.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscimpi_la-serialization.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscimpi_la-getOptionalComm.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -870,95 +926,133 @@ distclean-compile:
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 sci_gateway/c/libscimpi_la-sci_mpi_init.lo: sci_gateway/c/sci_mpi_init.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_init.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_init.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_init.lo `test -f 'sci_gateway/c/sci_mpi_init.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_init.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_init.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_init.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_init.lo `test -f 'sci_gateway/c/sci_mpi_init.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_init.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_init.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_init.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_init.c' object='sci_gateway/c/libscimpi_la-sci_mpi_init.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_init.lo `test -f 'sci_gateway/c/sci_mpi_init.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_init.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_init.lo `test -f 'sci_gateway/c/sci_mpi_init.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_init.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo: sci_gateway/c/sci_mpi_finalize.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_finalize.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo `test -f 'sci_gateway/c/sci_mpi_finalize.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_finalize.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_finalize.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo `test -f 'sci_gateway/c/sci_mpi_finalize.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_finalize.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_finalize.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_finalize.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_finalize.c' object='sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo `test -f 'sci_gateway/c/sci_mpi_finalize.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_finalize.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_finalize.lo `test -f 'sci_gateway/c/sci_mpi_finalize.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_finalize.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo: sci_gateway/c/sci_mpi_comm_size.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo `test -f 'sci_gateway/c/sci_mpi_comm_size.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_size.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo `test -f 'sci_gateway/c/sci_mpi_comm_size.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_size.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_comm_size.c' object='sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo `test -f 'sci_gateway/c/sci_mpi_comm_size.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_size.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_size.lo `test -f 'sci_gateway/c/sci_mpi_comm_size.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_size.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo: sci_gateway/c/sci_mpi_comm_rank.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo `test -f 'sci_gateway/c/sci_mpi_comm_rank.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_rank.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo `test -f 'sci_gateway/c/sci_mpi_comm_rank.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_rank.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_comm_rank.c' object='sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo `test -f 'sci_gateway/c/sci_mpi_comm_rank.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_rank.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_comm_rank.lo `test -f 'sci_gateway/c/sci_mpi_comm_rank.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_comm_rank.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_recv.lo: sci_gateway/c/sci_mpi_recv.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_recv.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_recv.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_recv.lo `test -f 'sci_gateway/c/sci_mpi_recv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_recv.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_recv.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_recv.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_recv.lo `test -f 'sci_gateway/c/sci_mpi_recv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_recv.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_recv.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_recv.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_recv.c' object='sci_gateway/c/libscimpi_la-sci_mpi_recv.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_recv.lo `test -f 'sci_gateway/c/sci_mpi_recv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_recv.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_recv.lo `test -f 'sci_gateway/c/sci_mpi_recv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_recv.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_send.lo: sci_gateway/c/sci_mpi_send.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_send.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_send.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_send.lo `test -f 'sci_gateway/c/sci_mpi_send.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_send.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_send.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_send.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_send.lo `test -f 'sci_gateway/c/sci_mpi_send.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_send.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_send.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_send.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_send.c' object='sci_gateway/c/libscimpi_la-sci_mpi_send.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_send.lo `test -f 'sci_gateway/c/sci_mpi_send.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_send.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_send.lo `test -f 'sci_gateway/c/sci_mpi_send.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_send.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo: sci_gateway/c/sci_mpi_irecv.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_irecv.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo `test -f 'sci_gateway/c/sci_mpi_irecv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_irecv.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_irecv.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo `test -f 'sci_gateway/c/sci_mpi_irecv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_irecv.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_irecv.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_irecv.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_irecv.c' object='sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo `test -f 'sci_gateway/c/sci_mpi_irecv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_irecv.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_irecv.lo `test -f 'sci_gateway/c/sci_mpi_irecv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_irecv.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_isend.lo: sci_gateway/c/sci_mpi_isend.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_isend.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_isend.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_isend.lo `test -f 'sci_gateway/c/sci_mpi_isend.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_isend.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_isend.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_isend.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_isend.lo `test -f 'sci_gateway/c/sci_mpi_isend.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_isend.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_isend.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_isend.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_isend.c' object='sci_gateway/c/libscimpi_la-sci_mpi_isend.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_isend.lo `test -f 'sci_gateway/c/sci_mpi_isend.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_isend.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_isend.lo `test -f 'sci_gateway/c/sci_mpi_isend.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_isend.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo: sci_gateway/c/sci_mpi_bcast.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_bcast.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo `test -f 'sci_gateway/c/sci_mpi_bcast.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_bcast.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_bcast.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo `test -f 'sci_gateway/c/sci_mpi_bcast.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_bcast.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_bcast.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_bcast.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_bcast.c' object='sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo `test -f 'sci_gateway/c/sci_mpi_bcast.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_bcast.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_bcast.lo `test -f 'sci_gateway/c/sci_mpi_bcast.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_bcast.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_wait.lo: sci_gateway/c/sci_mpi_wait.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_wait.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_wait.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_wait.lo `test -f 'sci_gateway/c/sci_mpi_wait.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_wait.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_wait.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_wait.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_wait.lo `test -f 'sci_gateway/c/sci_mpi_wait.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_wait.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_wait.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_wait.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_wait.c' object='sci_gateway/c/libscimpi_la-sci_mpi_wait.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_wait.lo `test -f 'sci_gateway/c/sci_mpi_wait.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_wait.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_wait.lo `test -f 'sci_gateway/c/sci_mpi_wait.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_wait.c
 
 sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo: sci_gateway/c/sci_mpi_get_processor_name.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_get_processor_name.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo `test -f 'sci_gateway/c/sci_mpi_get_processor_name.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_get_processor_name.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_get_processor_name.Tpo -c -o sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo `test -f 'sci_gateway/c/sci_mpi_get_processor_name.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_get_processor_name.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_get_processor_name.Tpo sci_gateway/c/$(DEPDIR)/libscimpi_la-sci_mpi_get_processor_name.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_mpi_get_processor_name.c' object='sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo `test -f 'sci_gateway/c/sci_mpi_get_processor_name.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_get_processor_name.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscimpi_la-sci_mpi_get_processor_name.lo `test -f 'sci_gateway/c/sci_mpi_get_processor_name.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_get_processor_name.c
 
 src/c/libscimpi_la-serialization.lo: src/c/serialization.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT src/c/libscimpi_la-serialization.lo -MD -MP -MF src/c/$(DEPDIR)/libscimpi_la-serialization.Tpo -c -o src/c/libscimpi_la-serialization.lo `test -f 'src/c/serialization.c' || echo '$(srcdir)/'`src/c/serialization.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscimpi_la-serialization.lo -MD -MP -MF src/c/$(DEPDIR)/libscimpi_la-serialization.Tpo -c -o src/c/libscimpi_la-serialization.lo `test -f 'src/c/serialization.c' || echo '$(srcdir)/'`src/c/serialization.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscimpi_la-serialization.Tpo src/c/$(DEPDIR)/libscimpi_la-serialization.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/serialization.c' object='src/c/libscimpi_la-serialization.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o src/c/libscimpi_la-serialization.lo `test -f 'src/c/serialization.c' || echo '$(srcdir)/'`src/c/serialization.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscimpi_la-serialization.lo `test -f 'src/c/serialization.c' || echo '$(srcdir)/'`src/c/serialization.c
 
 src/c/libscimpi_la-deserialization.lo: src/c/deserialization.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT src/c/libscimpi_la-deserialization.lo -MD -MP -MF src/c/$(DEPDIR)/libscimpi_la-deserialization.Tpo -c -o src/c/libscimpi_la-deserialization.lo `test -f 'src/c/deserialization.c' || echo '$(srcdir)/'`src/c/deserialization.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscimpi_la-deserialization.lo -MD -MP -MF src/c/$(DEPDIR)/libscimpi_la-deserialization.Tpo -c -o src/c/libscimpi_la-deserialization.lo `test -f 'src/c/deserialization.c' || echo '$(srcdir)/'`src/c/deserialization.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscimpi_la-deserialization.Tpo src/c/$(DEPDIR)/libscimpi_la-deserialization.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/deserialization.c' object='src/c/libscimpi_la-deserialization.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o src/c/libscimpi_la-deserialization.lo `test -f 'src/c/deserialization.c' || echo '$(srcdir)/'`src/c/deserialization.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscimpi_la-deserialization.lo `test -f 'src/c/deserialization.c' || echo '$(srcdir)/'`src/c/deserialization.c
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@  $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo: sci_gateway/cpp/sci_mpi_createComm.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscimpi_la-sci_mpi_createComm.Tpo -c -o sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo `test -f 'sci_gateway/cpp/sci_mpi_createComm.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mpi_createComm.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscimpi_la-sci_mpi_createComm.Tpo sci_gateway/cpp/$(DEPDIR)/libscimpi_la-sci_mpi_createComm.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_mpi_createComm.cpp' object='sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscimpi_la-sci_mpi_createComm.lo `test -f 'sci_gateway/cpp/sci_mpi_createComm.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mpi_createComm.cpp
+
+src/cpp/libscimpi_la-getOptionalComm.lo: src/cpp/getOptionalComm.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscimpi_la-getOptionalComm.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscimpi_la-getOptionalComm.Tpo -c -o src/cpp/libscimpi_la-getOptionalComm.lo `test -f 'src/cpp/getOptionalComm.cpp' || echo '$(srcdir)/'`src/cpp/getOptionalComm.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscimpi_la-getOptionalComm.Tpo src/cpp/$(DEPDIR)/libscimpi_la-getOptionalComm.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/getOptionalComm.cpp' object='src/cpp/libscimpi_la-getOptionalComm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscimpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscimpi_la-getOptionalComm.lo `test -f 'src/cpp/getOptionalComm.cpp' || echo '$(srcdir)/'`src/cpp/getOptionalComm.cpp
 
 mostlyclean-libtool:
        -rm -f *.lo
@@ -966,7 +1060,9 @@ mostlyclean-libtool:
 clean-libtool:
        -rm -rf .libs _libs
        -rm -rf sci_gateway/c/.libs sci_gateway/c/_libs
+       -rm -rf sci_gateway/cpp/.libs sci_gateway/cpp/_libs
        -rm -rf src/c/.libs src/c/_libs
+       -rm -rf src/cpp/.libs src/cpp/_libs
 install-libscimpi_la_etcDATA: $(libscimpi_la_etc_DATA)
        @$(NORMAL_INSTALL)
        @list='$(libscimpi_la_etc_DATA)'; test -n "$(libscimpi_la_etcdir)" || list=; \
@@ -1170,8 +1266,12 @@ distclean-generic:
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
        -rm -f sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
        -rm -f sci_gateway/c/$(am__dirstamp)
+       -rm -f sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+       -rm -f sci_gateway/cpp/$(am__dirstamp)
        -rm -f src/c/$(DEPDIR)/$(am__dirstamp)
        -rm -f src/c/$(am__dirstamp)
+       -rm -f src/cpp/$(DEPDIR)/$(am__dirstamp)
+       -rm -f src/cpp/$(am__dirstamp)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -1182,7 +1282,7 @@ clean-am: clean-generic clean-libtool clean-local \
        clean-pkglibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+       -rm -rf sci_gateway/c/$(DEPDIR) sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-local distclean-tags
@@ -1231,7 +1331,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+       -rm -rf sci_gateway/c/$(DEPDIR) sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
index 4a62a09..13f2b0d 100644 (file)
@@ -2,7 +2,14 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ * Copyright (C) 2016 - Scilab Enterprises - Delamarre Cedric
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Bcast" xml:lang="en">
     <refnamediv>
@@ -11,7 +18,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>res = MPI_Bcast(value,rootID)</synopsis>
+        <synopsis>res = MPI_Bcast(value,rootID[,comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>res</term>
                 <listitem>
-                    <para>The broadcasted value</para>
+                    <para>The broadcasted value. If the optional argument "comm" is given, all nodes which are not in the communicator will return empty matrix.</para>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -46,7 +62,7 @@
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
@@ -61,7 +77,7 @@
             b=MPI_Bcast(a, 0);
             assert_checkequal(b,42);
             MPI_Finalize();
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
diff --git a/scilab/modules/mpi/help/en_US/MPI_Create_comm.xml b/scilab/modules/mpi/help/en_US/MPI_Create_comm.xml
new file mode 100644 (file)
index 0000000..4a5113d
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2016 - Scilab Enterprises - Delamarre Cedric
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Create_comm" xml:lang="en">
+    <refnamediv>
+        <refname>MPI_Create_comm</refname>
+        <refpurpose>Create a MPI subcommunicator of MPI_COMM_WORLD</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>comm = MPI_Create_comm(ranks)</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>ranks</term>
+                <listitem>
+                    <para>Vector of World ranks used to create the new communicator.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>comm</term>
+                <listitem>
+                    <para>The new communicator created.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Create a communicator using world ranks given by the array "ranks".
+            The communicator can be passed to MPI functions using the optional argument "comm".
+            This function have to be called by all process.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+            MPI_Init();
+
+            worldRnk  = MPI_Comm_rank();
+            worldSize = MPI_Comm_size();
+
+            evenComm = MPI_Create_comm(0:2:(worldSize-1));
+            oddComm  = MPI_Create_comm(1:2:(worldSize-1));
+
+            // Comm rank / size
+            evenRnk  = MPI_Comm_rank(comm=evenComm);
+            oddRnk   = MPI_Comm_rank(comm=oddComm);
+            evenSize = MPI_Comm_size(comm=evenComm);
+            oddSize  = MPI_Comm_size(comm=oddComm);
+
+            if worldRnk == 0 then
+                disp("world rank | world size | comm rank | comm size");
+            end
+
+            if evenRnk <> -1 then
+                disp("even  "+string(worldRnk)+ "      "+string(worldSize)+ "      "+string(evenRnk)+ "      "+string(evenSize))
+            else
+                disp("odd   "+string(worldRnk)+ "      "+string(worldSize)+ "      "+string(oddRnk) + "      "+string(oddSize))
+            end
+
+            MPI_Finalize();
+        ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="MPI_Recv">MPI_Recv</link>
+            </member>
+            <member>
+                <link linkend="MPI_Send">MPI_Send</link>
+            </member>
+            <member>
+                <link linkend="MPI_Init">MPI_Init</link>
+            </member>
+            <member>
+                <link linkend="MPI_Finalize">MPI_Finalize</link>
+            </member>
+        </simplelist>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/mpi/help/en_US/MPI_Finalize.xml b/scilab/modules/mpi/help/en_US/MPI_Finalize.xml
new file mode 100644 (file)
index 0000000..ef2c7e5
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2016 - DIGITEO - Sylvestre Ledru
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Finalize" xml:lang="en">
+    <refnamediv>
+        <refname>MPI_Finalize</refname>
+        <refpurpose>Terminate the MPI environment</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Syntax</title>
+        <synopsis>MPI_Finalize()</synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Terminate the MPI environment, must be called before exit Scilab.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+            MPI_Init();
+            rnk =    MPI_Comm_rank();
+            sizeNodes =    MPI_Comm_size();
+            
+            SLV = rnk;                // handy shortcuts, master is rank 0
+            Master = ~ SLV;            // slaves are all other
+            tag=0;
+            if Master
+            // The master node
+            for slaveId = 1:sizeNodes-1
+            // Send data to the slaves
+            value = rand(100,100) + rand(100,100) * %i;
+            MPI_Send(value, slaveId);
+            end
+            
+            for slaveId = 1:sizeNodes-1
+            valueBack=MPI_Recv(slaveId, tag);
+            // Check that the slaves gaves us what we expected
+            assert_checkequal(valueBack,value + 1);
+            end
+            else
+            // The slaves
+            rankSource=0;
+            // Receive the information from the master
+            value=MPI_Recv(rankSource);
+            // Increment all the values by one
+            value=value+1;
+            // Send back to the master
+            MPI_Send(value,0);
+            
+            end
+            
+            MPI_Finalize();
+            
+            ]]></programlisting>
+        
+    </refsection>
+    <refsection role="see also">
+        <title>See also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="MPI_Init">MPI_Finalize</link>
+            </member>
+        </simplelist>
+    </refsection>
+</refentry>
index 252b27e..1308a6a 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Init" xml:lang="en">
     <refnamediv>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>res = MPI_Init()</synopsis>
+        <synopsis>MPI_Init()</synopsis>
     </refsynopsisdiv>
     <refsection>
-        <title>Arguments</title>
-        <variablelist>
-            <varlistentry>
-                <term>value</term>
-                <listitem>
-                    <para>The value to be sent to the specified node.</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>node</term>
-                <listitem>
-                    <para>The node to send the data</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>res</term>
-                <listitem>
-                    <para>The result of the operation (true if success, false if failed)</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-    </refsection>
-    <refsection>
         <title>Description</title>
         <para>
-            Send a variable to a specified node. The value should be retrieved by the node with the function <link linkend="MPI_Send">MPI_Send</link>.
+            Initialize the MPI environment, must be called before all other MPI functions.
         </para>
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example">//TODO</programlisting>
+        <programlisting role="example"><![CDATA[
+            MPI_Init();
+            rnk =    MPI_Comm_rank();
+            sizeNodes =    MPI_Comm_size();
+            
+            SLV = rnk;                // handy shortcuts, master is rank 0
+            Master = ~ SLV;            // slaves are all other
+            tag=0;
+            if Master
+            // The master node
+            for slaveId = 1:sizeNodes-1
+            // Send data to the slaves
+            value = rand(100,100) + rand(100,100) * %i;
+            MPI_Send(value, slaveId);
+            end
+            
+            for slaveId = 1:sizeNodes-1
+            valueBack=MPI_Recv(slaveId, tag);
+            // Check that the slaves gaves us what we expected
+            assert_checkequal(valueBack,value + 1);
+            end
+            else
+            // The slaves
+            rankSource=0;
+            // Receive the information from the master
+            value=MPI_Recv(rankSource);
+            // Increment all the values by one
+            value=value+1;
+            // Send back to the master
+            MPI_Send(value,0);
+            
+            end
+            
+            MPI_Finalize();
+            
+            ]]></programlisting>
+        
     </refsection>
     <refsection role="see also">
         <title>See also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="MPI_Recv">MPI_Recv</link>
+                <link linkend="MPI_Finalize">MPI_Finalize</link>
             </member>
         </simplelist>
     </refsection>
index 3bc8ffb..b4566d2 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Irecv" xml:lang="en">
     <refnamediv>
@@ -11,7 +17,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>MPI_Irecv(rank,tag)</synopsis>
+        <synopsis>MPI_Irecv(rank,tag[,comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                     <para>The tag. TODO</para>
                 </listitem>
             </varlistentry>
+            <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
@@ -48,7 +63,7 @@
     <refsection>
         <title>Examples</title>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 
 
                 MPI_Init();
index 9f777d0..ca454af 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Isend" xml:lang="en">
     <refnamediv>
@@ -11,7 +17,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>res = MPI_Isend(value,node)</synopsis>
+        <synopsis>res = MPI_Isend(value,node[,comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>res</term>
                 <listitem>
-                    <para>The result of the operation (true if success, false if failed)</para>
+                    <para>The result of the operation (true if success, false if failed).
+                        If the optional argument "comm" is given, all nodes which are not in the communicator will return false.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -44,7 +61,7 @@
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 
 
                 MPI_Init();
index 1e0a97d..5a74614 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Recv" xml:lang="en">
     <refnamediv>
@@ -11,7 +17,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>value = MPI_Recv(rank,tag)</synopsis>
+        <synopsis>value = MPI_Recv(rank,tag[, comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>res</term>
                 <listitem>
-                    <para>The value received from MPI_Send.</para>
+                    <para>The value received from MPI_Send.
+                        If the optional argument "comm" is given, all nodes which are not in the communicator will return empty matrix.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -50,7 +67,7 @@
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
             
             MPI_Finalize();
             
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
index e320fbc..ee08746 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Send" xml:lang="en">
     <refnamediv>
@@ -11,7 +17,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>res = MPI_Send(value,node)</synopsis>
+        <synopsis>res = MPI_Send(value,node[,comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>res</term>
                 <listitem>
-                    <para>The result of the operation (true if success, false if failed)</para>
+                    <para>The result of the operation (true if success, false if failed).
+                        If the optional argument "comm" is given, all nodes which are not in the communicator will return false.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -44,7 +61,7 @@
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
@@ -79,7 +96,7 @@
             
             MPI_Finalize();
             
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
index c6a3101..9f3a181 100644 (file)
@@ -2,7 +2,13 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
- * 
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Wait" xml:lang="en">
     <refnamediv>
@@ -11,7 +17,7 @@
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>res = MPI_Wait(request)</synopsis>
+        <synopsis>res = MPI_Wait(request[,comm=mpi_comm])</synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>comm=mpi_comm</term>
+                <listitem>
+                    <para>If the optional argument "comm" is given,
+                        this function will use the MPI communicator created by <link linkend="MPI_Create_comm">MPI_Create_comm</link>.
+                        If not, the default MPI_COMM_WORLD is used.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>res</term>
                 <listitem>
-                    <para>The variable sent by MPI_Isend and matching the MPI Request declared by MPI_Irecv</para>
+                    <para>The variable sent by MPI_Isend and matching the MPI Request declared by MPI_Irecv.
+                        If the optional argument "comm" is given, all nodes which are not in the communicator will return empty matrix.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-
-
+        <programlisting role="example"><![CDATA[
                 MPI_Init();
-                rnk =    MPI_Comm_rank();
-                sizeNodes =    MPI_Comm_size();
+                rnk = MPI_Comm_rank();
+                sizeNodes = MPI_Comm_size();
 
                 SLV = rnk;
                 Master = ~ SLV;
index 9baec82..da6a31f 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Bcast" xml:lang="ja">
     <refnamediv>
@@ -54,7 +60,7 @@
     </refsection>
     <refsection>
         <title>例</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
@@ -68,7 +74,7 @@
             b=MPI_Bcast(a, 0);
             assert_checkequal(b,42);
             MPI_Finalize();
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>参照</title>
index a94b888..300128c 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Init" xml:lang="ja">
     <refnamediv>
index 7f87bab..4b1f5b0 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Irecv" xml:lang="ja">
     <refnamediv>
index c7434aa..f25e566 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Isend" xml:lang="ja">
     <refnamediv>
index add5ea9..c695ed7 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Recv" xml:lang="ja">
     <refnamediv>
@@ -54,7 +60,7 @@
     </refsection>
     <refsection>
         <title>例</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
@@ -84,7 +90,7 @@
             MPI_Send(value,0);
             end
             MPI_Finalize();
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>参照</title>
index e3904c8..2283700 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Send" xml:lang="ja">
     <refnamediv>
@@ -46,7 +52,7 @@
     </refsection>
     <refsection>
         <title>例</title>
-        <programlisting role="example">
+        <programlisting role="example"><![CDATA[
             MPI_Init();
             rnk =    MPI_Comm_rank();
             sizeNodes =    MPI_Comm_size();
@@ -76,7 +82,7 @@
             MPI_Send(value,0);
             end
             MPI_Finalize();
-        </programlisting>
+            ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>参照</title>
index 191093e..772442d 100644 (file)
@@ -3,6 +3,12 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
  * 
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
  -->
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="MPI_Wait" xml:lang="ja">
     <refnamediv>
diff --git a/scilab/modules/mpi/includes/getOptionalComm.h b/scilab/modules/mpi/includes/getOptionalComm.h
new file mode 100644 (file)
index 0000000..5d2be05
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+
+#ifndef __GETOPTIONALCOMM__
+#define __GETOPTIONALCOMM__
+
+#include "mpi.h"
+MPI_Comm getOptionalComm(void* _pvApiCtx);
+
+#endif /*  __GETOPTIONALCOMM__ */
diff --git a/scilab/modules/mpi/includes/mpi_gw.hxx b/scilab/modules/mpi/includes/mpi_gw.hxx
new file mode 100644 (file)
index 0000000..991ff63
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2008-2008 - DIGITEO - Antoine ELIAS
+*
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+*
+*/
+
+#ifndef __MPI_GW_HXX__
+#define __MPI_GW_HXX__
+
+#include "dynlib_mpi.h"
+#include "cpp_gateway_prototype.hxx"
+
+MPI_IMPEXP CPP_GATEWAY_PROTOTYPE_EXPORT(sci_mpi_createComm, MPI_IMPEXP);
+
+#endif /* __MPI_GW_HXX__ */
+
diff --git a/scilab/modules/mpi/includes/sciMpiComm.hxx b/scilab/modules/mpi/includes/sciMpiComm.hxx
new file mode 100644 (file)
index 0000000..46fb93e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) Scilab-Enterprises - 2016 - Cedric DELAMARRE
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#ifndef __SCIMPICOMM_HXX__
+#define __SCIMPICOMM_HXX__
+
+#include <string>
+#include <mpi.h>
+#include "user.hxx"
+
+extern "C"
+{
+    #include "dynlib_mpi.h"
+}
+
+class MPI_IMPEXP SciMpiComm : public types::UserType
+{
+
+public :
+    SciMpiComm(int* piRanks, int iSize)
+    {
+        m_iGroupSize = iSize;
+        m_piWorldIndex = new int[m_iGroupSize];
+        memcpy(m_piWorldIndex, piRanks, m_iGroupSize * sizeof(int));
+        // create group from the world communicator
+        MPI_Group world_group;
+        MPI_Comm_group(MPI_COMM_WORLD, &world_group);
+
+        // create communicator from the group
+        MPI_Group_incl(world_group, m_iGroupSize, m_piWorldIndex, &m_group);
+        MPI_Comm_create(MPI_COMM_WORLD, m_group, &m_comm);
+    }
+
+    SciMpiComm* clone()
+    {
+        return new SciMpiComm(m_piWorldIndex, m_iGroupSize);
+    }
+
+    std::wstring getTypeStr()
+    {
+        return L"SciMpiComm";
+    }
+
+    std::wstring getShortTypeStr()
+    {
+        return L"smc";
+    }
+
+    bool hasToString()
+    {
+        return true;
+    }
+
+    bool toString(std::wostringstream& ostr)
+    {
+        ostr << L"MPI communicator of size " << m_iGroupSize << std::endl;
+        ostr << L"World ranks:" << std::endl;
+        for (int i = 0; i < m_iGroupSize; i++)
+        {
+            ostr << " " << m_piWorldIndex[i];
+        }
+
+        return true;
+    }
+
+    MPI_Comm getComm()
+    {
+        return m_comm;
+    }
+
+    ~SciMpiComm()
+    {
+        delete[] m_piWorldIndex;
+    }
+
+private :
+    MPI_Group m_group;
+    MPI_Comm m_comm;
+    int m_iGroupSize;
+    int* m_piWorldIndex;
+};
+
+#endif //__SCIMPICOMM_HXX__
index b5a9810..0b80411 100644 (file)
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../string/includes;../output_stream/includes;../localization/includes;../dynamic_link/includes;../elementary_functions/includes;../core/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env;../ast/includes/exps;../ast/includes/parse;../ast/includes/analysis;../ast/includes/symbol</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../string/includes;../output_stream/includes;../localization/includes;../dynamic_link/includes;../elementary_functions/includes;../core/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env;../ast/includes/exps;../ast/includes/parse;../ast/includes/analysis;../ast/includes/symbol</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../string/includes;../output_stream/includes;../localization/includes;../dynamic_link/includes;../elementary_functions/includes;../core/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env;../ast/includes/exps;../ast/includes/parse;../ast/includes/analysis;../ast/includes/symbol</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../core/includes;../output_stream/includes;../localization/includes;../elementary_functions/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../../libs/mpi/include;../../libs/intl;../api_scilab/includes;../string/includes;../output_stream/includes;../localization/includes;../dynamic_link/includes;../elementary_functions/includes;../core/includes;../ast/includes/operations;../ast/includes/ast;../ast/includes/types;../ast/includes/system_env;../ast/includes/exps;../ast/includes/parse;../ast/includes/analysis;../ast/includes/symbol</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;MPI_EXPORTS;_CRT_SECURE_NO_DEPRECATE;OMPI_IMPORTS;OPAL_IMPORTS;ORTE_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="includes\dynlib_mpi.h" />
+    <ClInclude Include="includes\getOptionalComm.h" />
     <ClInclude Include="includes\gw_mpi.h" />
+    <ClInclude Include="includes\mpi_gw.hxx" />
+    <ClInclude Include="includes\sciMpiComm.hxx" />
     <ClInclude Include="src\c\deserialization.h" />
     <ClInclude Include="src\c\sci_mpi.h" />
     <ClInclude Include="src\c\serialization.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="sci_gateway\cpp\sci_mpi_createComm.cpp" />
     <ClCompile Include="sci_gateway\c\sci_mpi_bcast.c" />
     <ClCompile Include="sci_gateway\c\sci_mpi_comm_rank.c" />
     <ClCompile Include="sci_gateway\c\sci_mpi_comm_size.c" />
     <ClCompile Include="sci_gateway\c\sci_mpi_recv.c" />
     <ClCompile Include="sci_gateway\c\sci_mpi_send.c" />
     <ClCompile Include="sci_gateway\c\sci_mpi_wait.c" />
+    <ClCompile Include="src\cpp\getOptionalComm.cpp" />
     <ClCompile Include="src\c\deserialization.c" />
     <ClCompile Include="src\c\DllmainMpi.c" />
     <ClCompile Include="src\c\serialization.c" />
     <ProjectReference Include="..\api_scilab\api_scilab.vcxproj">
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\ast\ast.vcxproj">
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\core\src\c\core.vcxproj">
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
     </ProjectReference>
index 94cea8e..e9cb48c 100644 (file)
     <ClInclude Include="includes\dynlib_mpi.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\getOptionalComm.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\sciMpiComm.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\mpi_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="src\c\deserialization.c">
     <ClCompile Include="src\c\DllmainMpi.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\getOptionalComm.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\sci_mpi_createComm.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
index d5d7049..fd020f4 100644 (file)
  *
  */
 
-#include "api_scilab.h"
-#include <stdio.h>
-#include <mpi.h>
 #include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "api_scilab.h"
 #include "Scierror.h"
 #include "sci_malloc.h"
 #include "localization.h"
 #include "serialization.h"
 #include "deserialization.h"
+#include "getOptionalComm.h"
 
 int sci_mpi_bcast(char *fname, void* pvApiCtx)
 {
@@ -35,9 +35,27 @@ int sci_mpi_bcast(char *fname, void* pvApiCtx)
     double rootID = 0;
     int rank = 0;
 
-    CheckInputArgument(pvApiCtx, 2, 2);
+    CheckInputArgument(pvApiCtx, 2, 3);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
+    // return the communicator from optional argument "comm"
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        // return empty matrix
+        createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 0, 0, NULL);
+        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
     if (sciErr.iErr)
     {
@@ -60,7 +78,7 @@ int sci_mpi_bcast(char *fname, void* pvApiCtx)
         return 0;
     }
 
-    iRet = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    iRet = MPI_Comm_rank(comm, &rank);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
@@ -81,7 +99,7 @@ int sci_mpi_bcast(char *fname, void* pvApiCtx)
     }
 
     /* First, send the size of the data as broadcast */
-    iRet = MPI_Bcast(&iBufferSize, 1, MPI_INT, (int)rootID, MPI_COMM_WORLD);
+    iRet = MPI_Bcast(&iBufferSize, 1, MPI_INT, (int)rootID, comm);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
@@ -97,7 +115,7 @@ int sci_mpi_bcast(char *fname, void* pvApiCtx)
     }
 
     /* Second, restore the data with the right size */
-    iRet = MPI_Bcast(piBuffer, iBufferSize, MPI_INT, (int)rootID, MPI_COMM_WORLD);
+    iRet = MPI_Bcast(piBuffer, iBufferSize, MPI_INT, (int)rootID, comm);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
index 212f903..2b0d52b 100644 (file)
 #include "Scierror.h"
 #include "localization.h"
 #include "api_scilab.h"
+#include "getOptionalComm.h"
 
 /**
- * This function returns the rank of a process within
- * the specified communicator.
+ * This function returns the rank of a process within the specified communicator.
  */
 int sci_mpi_comm_rank(char *fname, void* pvApiCtx)
 {
-    int comm_rank = 0;
+    int comm_rank = -1;
 
-    CheckInputArgument(pvApiCtx, 0, 0); // Check the parameters of the function ... Here 0
+    CheckInputArgument(pvApiCtx, 0, 1); // Check the parameters of the function ... Here 0 or 1
     CheckOutputArgument(pvApiCtx, 1, 1); // The output of the function (1 parameter)
 
-    MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
+    // return the communicator from optional argument "comm"
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_rank(comm, &comm_rank);
+    }
 
     if (createScalarDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, (double)comm_rank))
     {
index 84189b9..8ddf4db 100644 (file)
  * along with this program.
  *
  */
-#include <stdio.h>
 #include "gw_mpi.h"
 #include "sci_mpi.h"
-#include "api_scilab.h"
 #include "Scierror.h"
 #include "localization.h"
-#include "sci_malloc.h"
+#include "api_scilab.h"
+#include "getOptionalComm.h"
 
 /**
- * This function returns the rank of a process
+ * This function returns the size of the specified communicator
  */
 int sci_mpi_comm_size(char *fname, void* pvApiCtx)
 {
-    SciErr sciErr;
-    int comm_size;
-    MPI_Comm comm = MPI_COMM_WORLD;
-    int *piAddr = NULL;
-    double dblReal = 0;
+    int comm_size = -1;
 
-    CheckInputArgument(pvApiCtx, 0, 1);            // Check the parameters of the function ... Here 0 or 1
-    CheckOutputArgument(pvApiCtx, 1, 1);            // The output of the function (1 parameter)
+    CheckInputArgument(pvApiCtx, 0, 1); // Check the parameters of the function ... Here 0 or 1
+    CheckOutputArgument(pvApiCtx, 1, 1); // The output of the function (1 parameter)
 
-    if (nbInputArgument(pvApiCtx) == 1)
+    // return the communicator from optional argument "comm"
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
     {
-        sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
-        if (sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
-            return 0;
-        }
-
-        if (getScalarDouble(pvApiCtx, piAddr, &dblReal))
-        {
-            Scierror(999, _("%s: Wrong type for input argument #%d: A scalar integer value expected.\n"), fname, 1);
-            return 0;
-        }
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
 
-        comm = (MPI_Comm)(int)dblReal;
+    if (comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_size(comm, &comm_size);
     }
 
-    MPI_Comm_size(comm, &comm_size);
     if (createScalarDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, (double)comm_size))
     {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
+        Scierror(999, _("%s: Unable to create variable.\n"), fname);
         return 0;
     }
 
index 31def56..a3b8264 100644 (file)
@@ -17,6 +17,7 @@
 #include "sci_malloc.h"
 #include "BOOL.h"                       // for ::TRUE, ::FALSE, BOOL
 #include "api_scilab.h"                 // for pvApiCtx, etc
+#include "gw_mpi.h"
 
 /* Create some static datastructure to store all the Request references */
 MPI_Request *request;
index 9ba556f..2a483e5 100644 (file)
@@ -21,6 +21,7 @@
 #include "localization.h"
 #include "sci_malloc.h"
 #include "deserialization.h"
+#include "getOptionalComm.h"
 
 int sci_mpi_irecv(char *fname, void* pvApiCtx)
 {
@@ -38,9 +39,24 @@ int sci_mpi_irecv(char *fname, void* pvApiCtx)
     double dblRequestID = 0;
     MPI_Status status;
 
-    CheckInputArgument(pvApiCtx, 3, 3);
+    CheckInputArgument(pvApiCtx, 3, 4);
     CheckOutputArgument(pvApiCtx, 0, 1);
 
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        AssignOutputVariable(pvApiCtx, 1) = 0;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     //Rank
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
     if (sciErr.iErr)
@@ -94,7 +110,7 @@ int sci_mpi_irecv(char *fname, void* pvApiCtx)
         return 0;
     }
 
-    iRet = MPI_Probe((int)Rank, (int)Tag, MPI_COMM_WORLD, &status);
+    iRet = MPI_Probe((int)Rank, (int)Tag, comm, &status);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
@@ -121,7 +137,7 @@ int sci_mpi_irecv(char *fname, void* pvApiCtx)
         return 0;
     }
 
-    iRet = MPI_Irecv(piBuffer, iBufferSize, MPI_INT, (int)Rank, (int)Tag, MPI_COMM_WORLD, &request[iRequestID]);
+    iRet = MPI_Irecv(piBuffer, iBufferSize, MPI_INT, (int)Rank, (int)Tag, comm, &request[iRequestID]);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
index f2f34b4..6a9c4f4 100644 (file)
@@ -21,6 +21,7 @@
 #include "localization.h"
 #include "sci_malloc.h"
 #include "serialization.h"
+#include "getOptionalComm.h"
 
 #define TAG 0
 
@@ -39,9 +40,31 @@ int sci_mpi_isend(char *fname, void* pvApiCtx)
     int iRequestID = 0;
     double dblRequestID = 0;
 
-    CheckInputArgument(pvApiCtx, 3, 3);
+    CheckInputArgument(pvApiCtx, 3, 4);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
+    // return the communicator from optional argument "comm"
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        if (createScalarBoolean(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 0))
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), fname);
+            return 0;
+        }
+
+        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
     if (sciErr.iErr)
     {
@@ -93,7 +116,7 @@ int sci_mpi_isend(char *fname, void* pvApiCtx)
         return 0;
     }
 
-    iRet = MPI_Isend(piBuffer, iBufferSize, MPI_INT, (int)NodeID, TAG, MPI_COMM_WORLD, &request[iRequestID]);
+    iRet = MPI_Isend(piBuffer, iBufferSize, MPI_INT, (int)NodeID, TAG, comm, &request[iRequestID]);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
index 6b18845..5df6faa 100644 (file)
@@ -12,7 +12,6 @@
  * along with this program.
  *
  */
-#include <stdio.h>
 #include <mpi.h>
 #include "api_scilab.h"
 #include "gw_mpi.h"
@@ -20,6 +19,7 @@
 #include "sci_malloc.h"
 #include "localization.h"
 #include "deserialization.h"
+#include "getOptionalComm.h"
 
 int sci_mpi_recv(char *fname, void* pvApiCtx)
 {
@@ -34,9 +34,26 @@ int sci_mpi_recv(char *fname, void* pvApiCtx)
     double Rank = 0;
     MPI_Status status;
 
-    CheckInputArgument(pvApiCtx, 2, 2);
+    CheckInputArgument(pvApiCtx, 2, 3);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        // return empty matrix
+        createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 0, 0, NULL);
+        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     //Rank
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
     if (sciErr.iErr)
@@ -68,7 +85,7 @@ int sci_mpi_recv(char *fname, void* pvApiCtx)
     }
 
     //wait message "Rank" node
-    iRet = MPI_Probe((int)Rank, (int)Tag, MPI_COMM_WORLD, &status);
+    iRet = MPI_Probe((int)Rank, (int)Tag, comm, &status);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
@@ -98,7 +115,7 @@ int sci_mpi_recv(char *fname, void* pvApiCtx)
     }
 
     //receive data
-    iRet = MPI_Recv(piBuffer, iBufferSize, MPI_INT, (int)Rank, (int)Tag, MPI_COMM_WORLD, &status);
+    iRet = MPI_Recv(piBuffer, iBufferSize, MPI_INT, (int)Rank, (int)Tag, comm, &status);
     if (iRet != MPI_SUCCESS)
     {
         char error_string[MPI_MAX_ERROR_STRING];
index 9485714..0575090 100644 (file)
  * along with this program.
  *
  */
-#include <stdio.h>
-#include <mpi.h>
+#include "sci_mpi.h"
 #include "api_scilab.h"
 #include "gw_mpi.h"
 #include "Scierror.h"
 #include "localization.h"
 #include "sci_malloc.h"
 #include "serialization.h"
+#include "getOptionalComm.h"
 
 #define TAG 0
 
@@ -34,9 +34,31 @@ int sci_mpi_send(char *fname, void* pvApiCtx)
     int iBufferSize = 0;
     double NodeID = 0;
 
-    CheckInputArgument(pvApiCtx, 2, 2);
+    CheckInputArgument(pvApiCtx, 2, 3);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
+    // return the communicator from optional argument "comm"
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        if (createScalarBoolean(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 0))
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), fname);
+            return 0;
+        }
+
+        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
     if (sciErr.iErr)
     {
@@ -68,7 +90,7 @@ int sci_mpi_send(char *fname, void* pvApiCtx)
     }
 
     //send data
-    iRet = MPI_Send(piBuffer, iBufferSize, MPI_INT, (int)NodeID, TAG, MPI_COMM_WORLD);
+    iRet = MPI_Send(piBuffer, iBufferSize, MPI_INT, (int)NodeID, TAG, comm);
     FREE(piBuffer);
     if (iRet != MPI_SUCCESS)
     {
index bae5ea8..d7b6d9b 100644 (file)
@@ -12,7 +12,6 @@
  * along with this program.
  *
  */
-#include <stdio.h>
 #include <mpi.h>
 #include "api_scilab.h"
 #include "gw_mpi.h"
@@ -22,6 +21,7 @@
 #include "sci_malloc.h"
 #include "serialization.h"
 #include "deserialization.h"
+#include "getOptionalComm.h"
 
 int sci_mpi_wait(char *fname, void* pvApiCtx)
 {
@@ -34,9 +34,26 @@ int sci_mpi_wait(char *fname, void* pvApiCtx)
     int iRequestID;
     double dblRequestID;
 
-    CheckInputArgument(pvApiCtx, 1, 1);
+    CheckInputArgument(pvApiCtx, 1, 2);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
+    // if no optional "comm" is given, return MPI_COMM_WORLD
+    MPI_Comm comm = getOptionalComm(pvApiCtx);
+    if (comm == NULL)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%s: An MPI communicator expected.\n"), fname, "comm");
+        return 0;
+    }
+
+    if (comm == MPI_COMM_NULL)
+    {
+        // return empty matrix
+        createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 0, 0, NULL);
+        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+        ReturnArguments(pvApiCtx);
+        return 0;
+    }
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
     if (sciErr.iErr)
     {
diff --git a/scilab/modules/mpi/sci_gateway/cpp/sci_mpi_createComm.cpp b/scilab/modules/mpi/sci_gateway/cpp/sci_mpi_createComm.cpp
new file mode 100644 (file)
index 0000000..c02f7a6
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) Scilab Enterprises - 2016 - Cedric DELAMARRE
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/* ========================================================================== */
+#include "mpi_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "sciMpiComm.hxx"
+#include "mpi.h"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+}
+
+static const char fname[] = "MPI_Create_comm";
+/* ========================================================================== */
+types::Function::ReturnValue sci_mpi_createComm(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() != 1)
+    {
+        Scierror(999, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    if (out.size() > 1)
+    {
+        Scierror(999, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    if (in[0]->isDouble() == false )
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A Matrix expected.\n"), fname, 1);
+        return types::Function::Error;
+    }
+
+    types::Double* pDbl = in[0]->getAs<types::Double>();
+    int iSize = pDbl->getSize();
+    int* piRanks = new int[iSize];
+    double* pdblRanks = pDbl->get();
+    for (int i = 0; i < iSize; i++)
+    {
+        piRanks[i] = (int)pdblRanks[i];
+    }
+
+    out.push_back(new SciMpiComm(piRanks, iSize));
+
+    delete[] piRanks;
+    return types::Function::OK;
+}
+/* ========================================================================== */
index ee7f15b..bc920c9 100644 (file)
@@ -33,4 +33,5 @@
     <gateway name="sci_mpi_irecv"               function="MPI_Irecv"                type="0" />
     <gateway name="sci_mpi_isend"               function="MPI_Isend"                type="0" />
     <gateway name="sci_mpi_wait"                function="MPI_Wait"                 type="0" />
+    <gateway name="sci_mpi_createComm"          function="MPI_Create_comm"          type="1" />
 </module>
diff --git a/scilab/modules/mpi/src/cpp/getOptionalComm.cpp b/scilab/modules/mpi/src/cpp/getOptionalComm.cpp
new file mode 100644 (file)
index 0000000..a92122b
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ * Please note that piece of code will be rewrited for the Scilab 6 family
+ * However, the API (profile of the functions in the header files) will be
+ * still available and supported in Scilab 6.
+ */
+
+#include "gatewaystruct.hxx"
+#include "sciMpiComm.hxx"
+
+extern "C"
+{
+#include "getOptionalComm.h"
+#include "api_scilab.h"
+}
+
+MPI_Comm getOptionalComm(void* _pvApiCtx)
+{
+    types::GatewayStruct* pStr = (types::GatewayStruct*)_pvApiCtx;
+    types::optional_list opt = *pStr->m_pOpt;
+
+    for (const auto & o : opt)
+    {
+        if (o.first != L"comm")
+        {
+            continue;
+        }
+
+        if (o.second->isUserType() == false || o.second->getAs<types::UserType>()->getTypeStr() != L"SciMpiComm")
+        {
+            return NULL;
+        }
+
+        SciMpiComm* sciComm = (SciMpiComm*)(o.second->getAs<types::UserType>());
+        return sciComm->getComm();
+    }
+
+    return MPI_COMM_WORLD;
+}
diff --git a/scilab/modules/mpi/tests/unit_tests/mpi_create_comm.tst b/scilab/modules/mpi/tests/unit_tests/mpi_create_comm.tst
new file mode 100644 (file)
index 0000000..79fa07d
--- /dev/null
@@ -0,0 +1,94 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2016 - Scilab Enterprises - Cedric Delamarre
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- MPI TEST -->
+//
+
+MPI_Init();
+
+worldRnk  = MPI_Comm_rank();
+worldSize = MPI_Comm_size();
+
+assert_checkequal(worldSize, 4);
+
+evenNodes = 0:2:(worldSize-1);
+evenComm  = MPI_Create_comm(evenNodes);
+oddNodes  = 1:2:(worldSize-1);
+oddComm   = MPI_Create_comm(oddNodes);
+
+// Comm rank / size
+evenRnk  = MPI_Comm_rank(comm=evenComm);
+oddRnk   = MPI_Comm_rank(comm=oddComm);
+evenSize = MPI_Comm_size(comm=evenComm);
+oddSize  = MPI_Comm_size(comm=oddComm);
+
+// I am an even node
+isEven = evenRnk <> -1;
+// I am an odd node
+isOdd  = oddRnk <> -1;
+// I am an even master
+isEvenMaster = evenRnk == 0;
+// I am an odd master
+isOddMaster  = oddRnk == 0;
+
+if isEven then
+    assert_checkequal(evenSize, 2);
+    assert_checkequal(worldRnk/2,  evenRnk);
+else
+    assert_checkequal(oddSize,  2);
+    assert_checkequal(floor(worldRnk/2),  oddRnk);
+end
+
+
+// Bcast
+a=0;
+if isEvenMaster then
+    a=42;
+end
+b=MPI_Bcast(a, 0, comm=evenComm);
+
+if isEven then
+    assert_checkequal(b, 42);
+else
+    assert_checkequal(b, []);
+end
+
+
+// Send / Recv
+if isOddMaster then
+    for i=1:(oddSize-1)
+        MPI_Send(10+i, i, comm=oddComm);
+    end
+else
+    val=MPI_Recv(0, 0, comm=oddComm);
+    if isOdd then
+        assert_checkequal(val, 10+oddRnk);
+    else
+        assert_checkequal(val, []);
+    end
+end
+
+// Isend / Irecv
+req = 26;
+if isEvenMaster then
+    for i=1:(evenSize-1)
+        MPI_Isend(10+i, i, req, comm=evenComm);
+    end
+else
+    MPI_Irecv(0, 0, req, comm=evenComm);
+    val = MPI_Wait(req, comm=evenComm);
+    if isEven then
+        assert_checkequal(val, 10+evenRnk);
+    else
+        assert_checkequal(val, []);
+    end
+end
+
+disp("MPI_Create_comm test DONE.")
+
+MPI_Finalize();
+exit()