Skeleton and a few functions providing mpi
Sylvestre Ledru [Thu, 7 May 2009 16:16:47 +0000 (18:16 +0200)]
56 files changed:
scilab/modules/mpi/Makefile.am [new file with mode: 0644]
scilab/modules/mpi/Makefile.in [new file with mode: 0644]
scilab/modules/mpi/TODO [new file with mode: 0644]
scilab/modules/mpi/VERSION [new file with mode: 0644]
scilab/modules/mpi/changelog.txt [new file with mode: 0644]
scilab/modules/mpi/etc/mpi.quit [new file with mode: 0644]
scilab/modules/mpi/etc/mpi.start [new file with mode: 0644]
scilab/modules/mpi/examples/foo.sci [new file with mode: 0644]
scilab/modules/mpi/includes/gw_mpi.h [new file with mode: 0644]
scilab/modules/mpi/licence.txt [new file with mode: 0644]
scilab/modules/mpi/macros/MPIHelloWorld.sci [new file with mode: 0644]
scilab/modules/mpi/macros/MPIPi.sci [new file with mode: 0644]
scilab/modules/mpi/macros/MPIPi_seq.sci [new file with mode: 0644]
scilab/modules/mpi/macros/buildmacros.sce [new file with mode: 0644]
scilab/modules/mpi/macros/mpi.sce [new file with mode: 0644]
scilab/modules/mpi/readme.txt [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/gw_mpi.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_rank.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_size.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_finalize.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_init.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_irecv.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_isend.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c.back [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c.back [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/mpi [new file with mode: 0644]
scilab/modules/mpi/sci_gateway/mpi_gateway.xml [new file with mode: 0644]
scilab/modules/mpi/src/c/#s_mpi_send.c# [new file with mode: 0644]
scilab/modules/mpi/src/c/build_buff_type.c [new file with mode: 0644]
scilab/modules/mpi/src/c/build_buff_type.h [new file with mode: 0644]
scilab/modules/mpi/src/c/dboard.c [new file with mode: 0644]
scilab/modules/mpi/src/c/mpi_pi_reduce.c [new file with mode: 0644]
scilab/modules/mpi/src/c/mpi_pi_send.c [new file with mode: 0644]
scilab/modules/mpi/src/c/mpitest.c [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_irecv.c [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_irecv.h [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_isend.c [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_isend.h [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_recv.c [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_recv.h [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_send.c [new file with mode: 0644]
scilab/modules/mpi/src/c/s_mpi_send.h [new file with mode: 0644]
scilab/modules/mpi/src/c/sci_mpi.h [new file with mode: 0644]
scilab/modules/mpi/src/c/testPDGEMM-MPI.c [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intmpi.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_comm_rank.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_comm_size.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_finalize.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_init.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_irecv.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_isend.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_recv.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/intsmpi_send.f [new file with mode: 0644]
scilab/modules/mpi/src/fortran/mpi_init.f [new file with mode: 0644]

diff --git a/scilab/modules/mpi/Makefile.am b/scilab/modules/mpi/Makefile.am
new file mode 100644 (file)
index 0000000..e8a71f8
--- /dev/null
@@ -0,0 +1,95 @@
+##########
+### Sylvestre Ledru <sylvestre.ledru@inria.fr>
+### Scilab / MPI Makefile
+### INRIA - Scilab 2007
+##########
+
+# List of the c files
+#MPI_C_SOURCES = src/c/s_mpi_irecv.c \
+#src/c/build_buff_type.c \
+#src/c/s_mpi_recv.c \
+#src/c/s_mpi_send.c \
+#src/c/s_mpi_isend.c
+
+
+# List of the fortran files
+#MPI_FORTRAN_SOURCES = src/fortran/intsmpi_isend.f \
+#src/fortran/intmpi.f \
+#src/fortran/intsmpi_send.f \
+#src/fortran/intsmpi_recv.f \
+#src/fortran/intsmpi_comm_rank.f \
+#src/fortran/intsmpi_irecv.f \
+#src/fortran/intsmpi_init.f \
+#src/fortran/intsmpi_finalize.f \
+#src/fortran/intsmpi_comm_size.f
+#src/fortran/mpi_init.f
+
+MPI_TEST_EXE_SOURCES = src/c/mpitest.c
+bin_PROGRAMS = mpitest mpi_pi
+mpitest_SOURCES = $(MPI_TEST_EXE_SOURCES)
+mpitest_LDFLAGS = $(OPENMPI_LIBS)
+
+
+MPI_PI_SOURCES = src/c/mpi_pi_send.c src/c/dboard.c
+mpi_pi_SOURCES = $(MPI_PI_SOURCES)
+mpi_pi_LDFLAGS = $(OPENMPI_LIBS)
+
+# List of the gateway c files
+GATEWAY_C_SOURCES = sci_gateway/c/sci_mpi_init.c \
+sci_gateway/c/sci_mpi_finalize.c \
+sci_gateway/c/sci_mpi_comm_size.c \
+sci_gateway/c/sci_mpi_comm_rank.c \
+sci_gateway/c/gw_mpi.c \
+sci_gateway/c/sci_mpi_recv.c \
+sci_gateway/c/sci_mpi_send.c \
+src/c/build_buff_type.c \
+src/c/s_mpi_recv.c \
+src/c/s_mpi_send.c
+
+#sci_gateway/c/sci_mpi_isend.c \
+#sci_gateway/c/sci_mpi_irecv.c \
+#sci_gateway/c/sci_mpi_comm_rank.c \
+#sci_gateway/c/sci_mpi_comm_size.c
+
+
+# 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/ -DDEBUG
+libscimpi_la_LDFLAGS = $(OPENMPI_LIBS)
+# $(LAMPI_LDFLAGS)
+
+# 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) 
+#$(GATEWAY_FORTRAN_SOURCES) $(MPI_FORTRAN_SOURCES)
+#$(MPI_C_SOURCES)
+
+## Libraries necessary
+libscimpi_la_LIBADD = \
+       $(top_builddir)/modules/core/libscicore.la
+#      $(top_builddir)/libs/MALLOC/libscimalloc.la
+
+#### Target ######
+
+#### mpi : Conf files ####
+libscimpi_la_rootdir = $(mydatadir)
+libscimpi_la_root_DATA = changelog.txt licence.txt readme.txt VERSION
+
+#### mpi : init scripts #### 
+libscimpi_la_etcdir = $(mydatadir)/etc
+libscimpi_la_etc_DATA = etc/mpi.quit etc/mpi.start
+
+#### mpi : gateway declaration #### 
+libscimpi_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+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
+
+# Provides macros compilation, Java compilation, cleaning
+include $(top_srcdir)/Makefile.incl.am
diff --git a/scilab/modules/mpi/Makefile.in b/scilab/modules/mpi/Makefile.in
new file mode 100644 (file)
index 0000000..6cb6c09
--- /dev/null
@@ -0,0 +1,1210 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+##########
+### Sylvestre Ledru <sylvestre.ledru@inria.fr>
+### Scilab / MPI Makefile
+### INRIA - Scilab 2007
+##########
+
+# List of the c files
+#MPI_C_SOURCES = src/c/s_mpi_irecv.c \
+#src/c/build_buff_type.c \
+#src/c/s_mpi_recv.c \
+#src/c/s_mpi_send.c \
+#src/c/s_mpi_isend.c
+
+# List of the fortran files
+#MPI_FORTRAN_SOURCES = src/fortran/intsmpi_isend.f \
+#src/fortran/intmpi.f \
+#src/fortran/intsmpi_send.f \
+#src/fortran/intsmpi_recv.f \
+#src/fortran/intsmpi_comm_rank.f \
+#src/fortran/intsmpi_irecv.f \
+#src/fortran/intsmpi_init.f \
+#src/fortran/intsmpi_finalize.f \
+#src/fortran/intsmpi_comm_size.f
+#src/fortran/mpi_init.f
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+# Copyright (C) 2008      - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+#
+# 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
+#
+
+##########
+### Makefile included stuff
+### Target, variable, suffixes which are supposed to be usefull in every makefile.am
+##########
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = mpitest$(EXEEXT) mpi_pi$(EXEEXT)
+DIST_COMMON = $(libscimpi_la_include_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(top_srcdir)/Makefile.incl.am TODO
+@NEED_JAVA_TRUE@am__append_1 = java
+subdir = modules/mpi
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \
+       $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \
+       $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/intel_compiler.m4 \
+       $(top_srcdir)/m4/java.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/libs_by_debian.m4 \
+       $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/mpi.m4 \
+       $(top_srcdir)/m4/ocaml.m4 $(top_srcdir)/m4/pcre.m4 \
+       $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/pvm.m4 \
+       $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \
+       $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \
+       $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \
+       "$(DESTDIR)$(libscimpi_la_etcdir)" \
+       "$(DESTDIR)$(libscimpi_la_rootdir)" \
+       "$(DESTDIR)$(libscimpi_la_sci_gatewaydir)" \
+       "$(DESTDIR)$(libscimpi_la_includedir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libscimpi_la_DEPENDENCIES =  \
+       $(top_builddir)/modules/core/libscicore.la
+am__objects_1 = libscimpi_la-sci_mpi_init.lo \
+       libscimpi_la-sci_mpi_finalize.lo \
+       libscimpi_la-sci_mpi_comm_size.lo \
+       libscimpi_la-sci_mpi_comm_rank.lo libscimpi_la-gw_mpi.lo \
+       libscimpi_la-sci_mpi_recv.lo libscimpi_la-sci_mpi_send.lo \
+       libscimpi_la-build_buff_type.lo libscimpi_la-s_mpi_recv.lo \
+       libscimpi_la-s_mpi_send.lo
+am_libscimpi_la_OBJECTS = $(am__objects_1)
+libscimpi_la_OBJECTS = $(am_libscimpi_la_OBJECTS)
+libscimpi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libscimpi_la_CFLAGS) \
+       $(CFLAGS) $(libscimpi_la_LDFLAGS) $(LDFLAGS) -o $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__objects_2 = mpi_pi_send.$(OBJEXT) dboard.$(OBJEXT)
+am_mpi_pi_OBJECTS = $(am__objects_2)
+mpi_pi_OBJECTS = $(am_mpi_pi_OBJECTS)
+mpi_pi_LDADD = $(LDADD)
+mpi_pi_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mpi_pi_LDFLAGS) \
+       $(LDFLAGS) -o $@
+am__objects_3 = mpitest.$(OBJEXT)
+am_mpitest_OBJECTS = $(am__objects_3)
+mpitest_OBJECTS = $(am_mpitest_OBJECTS)
+mpitest_LDADD = $(LDADD)
+mpitest_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mpitest_LDFLAGS) \
+       $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libscimpi_la_SOURCES) $(mpi_pi_SOURCES) $(mpitest_SOURCES)
+DIST_SOURCES = $(libscimpi_la_SOURCES) $(mpi_pi_SOURCES) \
+       $(mpitest_SOURCES)
+libscimpi_la_etcDATA_INSTALL = $(INSTALL_DATA)
+libscimpi_la_rootDATA_INSTALL = $(INSTALL_DATA)
+libscimpi_la_sci_gatewayDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(libscimpi_la_etc_DATA) $(libscimpi_la_root_DATA) \
+       $(libscimpi_la_sci_gateway_DATA)
+libscimpi_la_includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(libscimpi_la_include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMTAR = @AMTAR@
+ANT = @ANT@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AVALON_FRAMEWORK = @AVALON_FRAMEWORK@
+AWK = @AWK@
+BATIK = @BATIK@
+BLAS_LIBS = @BLAS_LIBS@
+
+#sci_gateway/c/sci_mpi_isend.c \
+#sci_gateway/c/sci_mpi_irecv.c \
+#sci_gateway/c/sci_mpi_comm_rank.c \
+#sci_gateway/c/sci_mpi_comm_size.c
+
+# Includes need for the compilation
+# MPI code needs to be compile with the openmpi 'compiler' (it is a wrapper)
+CC = $(OPENMPI_CC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMMONS_IO = @COMMONS_IO@
+COMMONS_LOGGING = @COMMONS_LOGGING@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FFTW3_LIB = @FFTW3_LIB@
+FFTW_ENABLE = @FFTW_ENABLE@
+FLEXDOCK = @FLEXDOCK@
+FLIBS = @FLIBS@
+FOP = @FOP@
+GIWS_BIN = @GIWS_BIN@
+GLUEGEN_RT = @GLUEGEN_RT@
+GRAPHICS_ENABLE = @GRAPHICS_ENABLE@
+GREP = @GREP@
+GUI_ENABLE = @GUI_ENABLE@
+HELP_ENABLE = @HELP_ENABLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVAH = @JAVAH@
+JAVASCI_ENABLE = @JAVASCI_ENABLE@
+JAVA_DEBUG_OPTIONS = @JAVA_DEBUG_OPTIONS@
+JAVA_ENABLE = @JAVA_ENABLE@
+JAVA_G = @JAVA_G@
+JAVA_HOME = @JAVA_HOME@
+JAVA_JNI_INCLUDE = @JAVA_JNI_INCLUDE@
+JAVA_JNI_LIBS = @JAVA_JNI_LIBS@
+JDB = @JDB@
+JEUCLID_CORE = @JEUCLID_CORE@
+JHALL = @JHALL@
+JOGL = @JOGL@
+JROSETTA_API = @JROSETTA_API@
+JROSETTA_ENGINE = @JROSETTA_ENGINE@
+LAPACK_LIBS = @LAPACK_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LOOKS = @LOOKS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MATIO_CFLAGS = @MATIO_CFLAGS@
+MATIO_ENABLE = @MATIO_ENABLE@
+MATIO_LIBS = @MATIO_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_ENABLE = @MPI_ENABLE@
+MSGCAT = @MSGCAT@
+MSGFMT = @MSGFMT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+OCAMLC = @OCAMLC@
+OCAMLDEP = @OCAMLDEP@
+OCAMLLEX = @OCAMLLEX@
+OCAMLOPT = @OCAMLOPT@
+OCAMLYACC = @OCAMLYACC@
+OPENMPI_CC = @OPENMPI_CC@
+OPENMPI_FLAGS = @OPENMPI_FLAGS@
+OPENMPI_LIBS = @OPENMPI_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCRE_CFLAGS = @PCRE_CFLAGS@
+PCRE_CONFIG = @PCRE_CONFIG@
+PCRE_LIBS = @PCRE_LIBS@
+PCRE_VERSION = @PCRE_VERSION@
+PKG_CONFIG = @PKG_CONFIG@
+POW_LIB = @POW_LIB@
+PVMARCH = @PVMARCH@
+PVMGETARCH = @PVMGETARCH@
+PVM_ENABLE = @PVM_ENABLE@
+PVM_INCLUDE = @PVM_INCLUDE@
+PVM_LIB = @PVM_LIB@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RELOCATABLE = @RELOCATABLE@
+RT_LIB = @RT_LIB@
+SAXON = @SAXON@
+SCICOS_ENABLE = @SCICOS_ENABLE@
+SCILAB_LIBRARY_VERSION = @SCILAB_LIBRARY_VERSION@
+SCIPAD_ENABLE = @SCIPAD_ENABLE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SET_RELOCATABLE = @SET_RELOCATABLE@
+SHELL = @SHELL@
+SKINLF = @SKINLF@
+STRIP = @STRIP@
+SWIG_BIN = @SWIG_BIN@
+SWIG_JAVA = @SWIG_JAVA@
+SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
+TCLTK_LIBS = @TCLTK_LIBS@
+TCL_INC_PATH = @TCL_INC_PATH@
+TERMCAP_LIB = @TERMCAP_LIB@
+TK_INC_PATH = @TK_INC_PATH@
+UMFPACK_ENABLE = @UMFPACK_ENABLE@
+UMFPACK_LIB = @UMFPACK_LIB@
+VERSION = @VERSION@
+WITH_OCAML = @WITH_OCAML@
+WITH_TKSCI = @WITH_TKSCI@
+XGETTEXT = @XGETTEXT@
+XMKMF = @XMKMF@
+XMLGRAPHICS_COMMONS = @XMLGRAPHICS_COMMONS@
+XML_APIS_EXT = @XML_APIS_EXT@
+XML_CONFIG = @XML_CONFIG@
+XML_FLAGS = @XML_FLAGS@
+XML_LIBS = @XML_LIBS@
+XML_VERSION = @XML_VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cxx_present = @cxx_present@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+MPI_TEST_EXE_SOURCES = src/c/mpitest.c
+mpitest_SOURCES = $(MPI_TEST_EXE_SOURCES)
+mpitest_LDFLAGS = $(OPENMPI_LIBS)
+MPI_PI_SOURCES = src/c/mpi_pi_send.c src/c/dboard.c
+mpi_pi_SOURCES = $(MPI_PI_SOURCES)
+mpi_pi_LDFLAGS = $(OPENMPI_LIBS)
+
+# List of the gateway c files
+GATEWAY_C_SOURCES = sci_gateway/c/sci_mpi_init.c \
+sci_gateway/c/sci_mpi_finalize.c \
+sci_gateway/c/sci_mpi_comm_size.c \
+sci_gateway/c/sci_mpi_comm_rank.c \
+sci_gateway/c/gw_mpi.c \
+sci_gateway/c/sci_mpi_recv.c \
+sci_gateway/c/sci_mpi_send.c \
+src/c/build_buff_type.c \
+src/c/s_mpi_recv.c \
+src/c/s_mpi_send.c
+
+libscimpi_la_CFLAGS = -Iincludes/ -Isrc/c/ -I$(top_srcdir)/libs/MALLOC/includes/ -DDEBUG
+libscimpi_la_LDFLAGS = $(OPENMPI_LIBS)
+# $(LAMPI_LDFLAGS)
+
+# 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) 
+#$(GATEWAY_FORTRAN_SOURCES) $(MPI_FORTRAN_SOURCES)
+#$(MPI_C_SOURCES)
+libscimpi_la_LIBADD = \
+       $(top_builddir)/modules/core/libscicore.la
+
+#      $(top_builddir)/libs/MALLOC/libscimalloc.la
+
+#### Target ######
+
+#### mpi : Conf files ####
+libscimpi_la_rootdir = $(mydatadir)
+libscimpi_la_root_DATA = changelog.txt licence.txt readme.txt VERSION
+
+#### mpi : init scripts #### 
+libscimpi_la_etcdir = $(mydatadir)/etc
+libscimpi_la_etc_DATA = etc/mpi.quit etc/mpi.start
+
+#### mpi : gateway declaration #### 
+libscimpi_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+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
+
+# Where all the Scilab stuff is installed (macros, help, ...)
+mydatadir = $(pkgdatadir)/modules/$(modulename)
+
+# splint options
+SPLINT_OPTIONS = -weak -booltype BOOL
+
+########################### JAVA ######################################
+#### We are delegating java compilation to ant... Thanks to that
+#### the procedure will be the same with Microsoft Windows (C)
+#### and Linux/Unix
+#######################################################################
+TARGETS_ALL = $(am__append_1)
+
+################ MACROS ######################
+# Rule to build a macro
+# NOT USED  AT THE MOMENT
+SUFFIXES = .sci 
+
+########### INSTALL DOCUMENTATION ###################
+
+# Install documentation files into the right target
+# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because
+# automake needs the html files to be present which is not the case when
+# we are building Scilab
+
+# Where it should be installed
+pkgdocdir = $(mydatadir)
+
+# What is the mask of the help source
+DOCMASKXML = *.xml
+
+# What is the mask of the MathML sources
+DOCMASKMML = *.mml
+
+########### INSTALL DATA ###################
+# Install macros, help & demos
+# Where it should be installed
+pkgmacrosdir = $(mydatadir)
+# Which directory we process
+MACRODIRS = macros/
+# Mask of the Scilab sources macros
+MACROMASK = *.sci
+# Mask of the Scilab executable sources macros
+MACROBUILDMASK = *.sce
+# Mask of the Scilab compiled macros
+MACROBINMASK = *.bin
+# List of the standard directory for tests
+TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests
+# Where the demos should be installed
+pkgdemosdir = $(mydatadir)
+# List of the standard directory for demos
+DEMOS_DIR = demos
+# List of the standard directory for examples
+EXAMPLES_DIR = examples
+# Where to export JAVA archives (.jar)
+JARDIR = jar/
+# JAR files mask
+JARMASK = *.jar
+# Chapter file 
+HELP_CHAPTERDIR = help/
+HELP_CHAPTERFILE = addchapter.sce
+HELP_CHAPTERLANG = en_US fr_FR pt_BR
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .sci .bin .c .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 \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  modules/mpi/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  modules/mpi/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+           $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-pkglibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+       done
+
+clean-pkglibLTLIBRARIES:
+       -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libscimpi.la: $(libscimpi_la_OBJECTS) $(libscimpi_la_DEPENDENCIES) 
+       $(libscimpi_la_LINK) -rpath $(pkglibdir) $(libscimpi_la_OBJECTS) $(libscimpi_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         if test -f $$p \
+            || test -f $$p1 \
+         ; then \
+           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+         else :; fi; \
+       done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+         echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(bindir)/$$f"; \
+       done
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+mpi_pi$(EXEEXT): $(mpi_pi_OBJECTS) $(mpi_pi_DEPENDENCIES) 
+       @rm -f mpi_pi$(EXEEXT)
+       $(mpi_pi_LINK) $(mpi_pi_OBJECTS) $(mpi_pi_LDADD) $(LIBS)
+mpitest$(EXEEXT): $(mpitest_OBJECTS) $(mpitest_DEPENDENCIES) 
+       @rm -f mpitest$(EXEEXT)
+       $(mpitest_LINK) $(mpitest_OBJECTS) $(mpitest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dboard.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-build_buff_type.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-gw_mpi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-s_mpi_recv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-s_mpi_send.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_finalize.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_init.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_recv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscimpi_la-sci_mpi_send.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi_pi_send.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpitest.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+libscimpi_la-sci_mpi_init.lo: sci_gateway/c/sci_mpi_init.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_init.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_init.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_init.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_init.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_init.c' object='libscimpi_la-sci_mpi_init.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-sci_mpi_init.lo `test -f 'sci_gateway/c/sci_mpi_init.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_init.c
+
+libscimpi_la-sci_mpi_finalize.lo: sci_gateway/c/sci_mpi_finalize.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_finalize.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_finalize.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_finalize.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_finalize.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_finalize.c' object='libscimpi_la-sci_mpi_finalize.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-sci_mpi_finalize.lo `test -f 'sci_gateway/c/sci_mpi_finalize.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_finalize.c
+
+libscimpi_la-sci_mpi_comm_size.lo: sci_gateway/c/sci_mpi_comm_size.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_comm_size.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_comm_size.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_comm_size.c' object='libscimpi_la-sci_mpi_comm_size.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o 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
+
+libscimpi_la-sci_mpi_comm_rank.lo: sci_gateway/c/sci_mpi_comm_rank.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_comm_rank.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_comm_rank.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_comm_rank.c' object='libscimpi_la-sci_mpi_comm_rank.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o 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
+
+libscimpi_la-gw_mpi.lo: sci_gateway/c/gw_mpi.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-gw_mpi.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-gw_mpi.Tpo -c -o libscimpi_la-gw_mpi.lo `test -f 'sci_gateway/c/gw_mpi.c' || echo '$(srcdir)/'`sci_gateway/c/gw_mpi.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscimpi_la-gw_mpi.Tpo $(DEPDIR)/libscimpi_la-gw_mpi.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_mpi.c' object='libscimpi_la-gw_mpi.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-gw_mpi.lo `test -f 'sci_gateway/c/gw_mpi.c' || echo '$(srcdir)/'`sci_gateway/c/gw_mpi.c
+
+libscimpi_la-sci_mpi_recv.lo: sci_gateway/c/sci_mpi_recv.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_recv.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_recv.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_recv.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_recv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_recv.c' object='libscimpi_la-sci_mpi_recv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-sci_mpi_recv.lo `test -f 'sci_gateway/c/sci_mpi_recv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_recv.c
+
+libscimpi_la-sci_mpi_send.lo: sci_gateway/c/sci_mpi_send.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-sci_mpi_send.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-sci_mpi_send.Tpo -c -o 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@   mv -f $(DEPDIR)/libscimpi_la-sci_mpi_send.Tpo $(DEPDIR)/libscimpi_la-sci_mpi_send.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_mpi_send.c' object='libscimpi_la-sci_mpi_send.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-sci_mpi_send.lo `test -f 'sci_gateway/c/sci_mpi_send.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mpi_send.c
+
+libscimpi_la-build_buff_type.lo: src/c/build_buff_type.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-build_buff_type.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-build_buff_type.Tpo -c -o libscimpi_la-build_buff_type.lo `test -f 'src/c/build_buff_type.c' || echo '$(srcdir)/'`src/c/build_buff_type.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscimpi_la-build_buff_type.Tpo $(DEPDIR)/libscimpi_la-build_buff_type.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/build_buff_type.c' object='libscimpi_la-build_buff_type.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-build_buff_type.lo `test -f 'src/c/build_buff_type.c' || echo '$(srcdir)/'`src/c/build_buff_type.c
+
+libscimpi_la-s_mpi_recv.lo: src/c/s_mpi_recv.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-s_mpi_recv.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-s_mpi_recv.Tpo -c -o libscimpi_la-s_mpi_recv.lo `test -f 'src/c/s_mpi_recv.c' || echo '$(srcdir)/'`src/c/s_mpi_recv.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscimpi_la-s_mpi_recv.Tpo $(DEPDIR)/libscimpi_la-s_mpi_recv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/s_mpi_recv.c' object='libscimpi_la-s_mpi_recv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-s_mpi_recv.lo `test -f 'src/c/s_mpi_recv.c' || echo '$(srcdir)/'`src/c/s_mpi_recv.c
+
+libscimpi_la-s_mpi_send.lo: src/c/s_mpi_send.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -MT libscimpi_la-s_mpi_send.lo -MD -MP -MF $(DEPDIR)/libscimpi_la-s_mpi_send.Tpo -c -o libscimpi_la-s_mpi_send.lo `test -f 'src/c/s_mpi_send.c' || echo '$(srcdir)/'`src/c/s_mpi_send.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscimpi_la-s_mpi_send.Tpo $(DEPDIR)/libscimpi_la-s_mpi_send.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/s_mpi_send.c' object='libscimpi_la-s_mpi_send.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscimpi_la_CFLAGS) $(CFLAGS) -c -o libscimpi_la-s_mpi_send.lo `test -f 'src/c/s_mpi_send.c' || echo '$(srcdir)/'`src/c/s_mpi_send.c
+
+mpi_pi_send.o: src/c/mpi_pi_send.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpi_pi_send.o -MD -MP -MF $(DEPDIR)/mpi_pi_send.Tpo -c -o mpi_pi_send.o `test -f 'src/c/mpi_pi_send.c' || echo '$(srcdir)/'`src/c/mpi_pi_send.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/mpi_pi_send.Tpo $(DEPDIR)/mpi_pi_send.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mpi_pi_send.c' object='mpi_pi_send.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpi_pi_send.o `test -f 'src/c/mpi_pi_send.c' || echo '$(srcdir)/'`src/c/mpi_pi_send.c
+
+mpi_pi_send.obj: src/c/mpi_pi_send.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpi_pi_send.obj -MD -MP -MF $(DEPDIR)/mpi_pi_send.Tpo -c -o mpi_pi_send.obj `if test -f 'src/c/mpi_pi_send.c'; then $(CYGPATH_W) 'src/c/mpi_pi_send.c'; else $(CYGPATH_W) '$(srcdir)/src/c/mpi_pi_send.c'; fi`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/mpi_pi_send.Tpo $(DEPDIR)/mpi_pi_send.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mpi_pi_send.c' object='mpi_pi_send.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpi_pi_send.obj `if test -f 'src/c/mpi_pi_send.c'; then $(CYGPATH_W) 'src/c/mpi_pi_send.c'; else $(CYGPATH_W) '$(srcdir)/src/c/mpi_pi_send.c'; fi`
+
+dboard.o: src/c/dboard.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dboard.o -MD -MP -MF $(DEPDIR)/dboard.Tpo -c -o dboard.o `test -f 'src/c/dboard.c' || echo '$(srcdir)/'`src/c/dboard.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/dboard.Tpo $(DEPDIR)/dboard.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/dboard.c' object='dboard.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dboard.o `test -f 'src/c/dboard.c' || echo '$(srcdir)/'`src/c/dboard.c
+
+dboard.obj: src/c/dboard.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dboard.obj -MD -MP -MF $(DEPDIR)/dboard.Tpo -c -o dboard.obj `if test -f 'src/c/dboard.c'; then $(CYGPATH_W) 'src/c/dboard.c'; else $(CYGPATH_W) '$(srcdir)/src/c/dboard.c'; fi`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/dboard.Tpo $(DEPDIR)/dboard.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/dboard.c' object='dboard.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dboard.obj `if test -f 'src/c/dboard.c'; then $(CYGPATH_W) 'src/c/dboard.c'; else $(CYGPATH_W) '$(srcdir)/src/c/dboard.c'; fi`
+
+mpitest.o: src/c/mpitest.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpitest.o -MD -MP -MF $(DEPDIR)/mpitest.Tpo -c -o mpitest.o `test -f 'src/c/mpitest.c' || echo '$(srcdir)/'`src/c/mpitest.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/mpitest.Tpo $(DEPDIR)/mpitest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mpitest.c' object='mpitest.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpitest.o `test -f 'src/c/mpitest.c' || echo '$(srcdir)/'`src/c/mpitest.c
+
+mpitest.obj: src/c/mpitest.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mpitest.obj -MD -MP -MF $(DEPDIR)/mpitest.Tpo -c -o mpitest.obj `if test -f 'src/c/mpitest.c'; then $(CYGPATH_W) 'src/c/mpitest.c'; else $(CYGPATH_W) '$(srcdir)/src/c/mpitest.c'; fi`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/mpitest.Tpo $(DEPDIR)/mpitest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mpitest.c' object='mpitest.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mpitest.obj `if test -f 'src/c/mpitest.c'; then $(CYGPATH_W) 'src/c/mpitest.c'; else $(CYGPATH_W) '$(srcdir)/src/c/mpitest.c'; fi`
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-libscimpi_la_etcDATA: $(libscimpi_la_etc_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscimpi_la_etcdir)" || $(MKDIR_P) "$(DESTDIR)$(libscimpi_la_etcdir)"
+       @list='$(libscimpi_la_etc_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(libscimpi_la_etcDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libscimpi_la_etcdir)/$$f'"; \
+         $(libscimpi_la_etcDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libscimpi_la_etcdir)/$$f"; \
+       done
+
+uninstall-libscimpi_la_etcDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscimpi_la_etc_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(libscimpi_la_etcdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(libscimpi_la_etcdir)/$$f"; \
+       done
+install-libscimpi_la_rootDATA: $(libscimpi_la_root_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscimpi_la_rootdir)" || $(MKDIR_P) "$(DESTDIR)$(libscimpi_la_rootdir)"
+       @list='$(libscimpi_la_root_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(libscimpi_la_rootDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libscimpi_la_rootdir)/$$f'"; \
+         $(libscimpi_la_rootDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libscimpi_la_rootdir)/$$f"; \
+       done
+
+uninstall-libscimpi_la_rootDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscimpi_la_root_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(libscimpi_la_rootdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(libscimpi_la_rootdir)/$$f"; \
+       done
+install-libscimpi_la_sci_gatewayDATA: $(libscimpi_la_sci_gateway_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscimpi_la_sci_gatewaydir)" || $(MKDIR_P) "$(DESTDIR)$(libscimpi_la_sci_gatewaydir)"
+       @list='$(libscimpi_la_sci_gateway_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(libscimpi_la_sci_gatewayDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libscimpi_la_sci_gatewaydir)/$$f'"; \
+         $(libscimpi_la_sci_gatewayDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libscimpi_la_sci_gatewaydir)/$$f"; \
+       done
+
+uninstall-libscimpi_la_sci_gatewayDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscimpi_la_sci_gateway_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(libscimpi_la_sci_gatewaydir)/$$f'"; \
+         rm -f "$(DESTDIR)$(libscimpi_la_sci_gatewaydir)/$$f"; \
+       done
+install-libscimpi_la_includeHEADERS: $(libscimpi_la_include_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscimpi_la_includedir)" || $(MKDIR_P) "$(DESTDIR)$(libscimpi_la_includedir)"
+       @list='$(libscimpi_la_include_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(libscimpi_la_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libscimpi_la_includedir)/$$f'"; \
+         $(libscimpi_la_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libscimpi_la_includedir)/$$f"; \
+       done
+
+uninstall-libscimpi_la_includeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscimpi_la_include_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(libscimpi_la_includedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(libscimpi_la_includedir)/$$f"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
+               all-local
+installdirs:
+       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libscimpi_la_etcdir)" "$(DESTDIR)$(libscimpi_la_rootdir)" "$(DESTDIR)$(libscimpi_la_sci_gatewaydir)" "$(DESTDIR)$(libscimpi_la_includedir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+       clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-libscimpi_la_etcDATA \
+       install-libscimpi_la_includeHEADERS \
+       install-libscimpi_la_rootDATA \
+       install-libscimpi_la_sci_gatewayDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am: install-html-local
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-libscimpi_la_etcDATA \
+       uninstall-libscimpi_la_includeHEADERS \
+       uninstall-libscimpi_la_rootDATA \
+       uninstall-libscimpi_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \
+       clean clean-binPROGRAMS clean-generic clean-libtool \
+       clean-local clean-pkglibLTLIBRARIES ctags distclean \
+       distclean-compile distclean-generic distclean-libtool \
+       distclean-local distclean-tags distdir dvi dvi-am html html-am \
+       info info-am install install-am install-binPROGRAMS \
+       install-data install-data-am install-data-local install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-html-local install-info \
+       install-info-am install-libscimpi_la_etcDATA \
+       install-libscimpi_la_includeHEADERS \
+       install-libscimpi_la_rootDATA \
+       install-libscimpi_la_sci_gatewayDATA install-man install-pdf \
+       install-pdf-am install-pkglibLTLIBRARIES install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-binPROGRAMS \
+       uninstall-libscimpi_la_etcDATA \
+       uninstall-libscimpi_la_includeHEADERS \
+       uninstall-libscimpi_la_rootDATA \
+       uninstall-libscimpi_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+
+# This target enables tests for Scilab
+check-local: $(top_builddir)/scilab-bin
+       @COMMAND="test_run('$(modulename)');quit";\
+       export LANG=C;\
+       $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"
+check-code:
+       @if test -f build.xml; then \
+               $(ANT) checkstyle; \
+       fi;\
+       splint $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC)
+@NEED_JAVA_TRUE@java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT); \
+@NEED_JAVA_TRUE@       fi
+
+@NEED_JAVA_TRUE@clean-java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT) clean; \
+@NEED_JAVA_TRUE@       fi;
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@SWIG_TRUE@swig: $(SWIG_WRAPPERS)
+@SWIG_TRUE@    @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \
+@SWIG_TRUE@    SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \
+@SWIG_TRUE@    if test ! -z "$(SWIG_WRAPPERS)"; then \
+@SWIG_TRUE@            for file in $(SWIG_WRAPPERS) ; do \
+@SWIG_TRUE@                    echo "Swig process of $$file ..."; \
+@SWIG_TRUE@                    $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME  -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@            done; \
+@SWIG_TRUE@    fi
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@GIWS_TRUE@giws: $(GIWS_WRAPPERS)
+@GIWS_TRUE@    @GIWS_OUTPUTDIR=src/jni/;\
+@GIWS_TRUE@    if test ! -z "$(GIWS_WRAPPERS)"; then \
+@GIWS_TRUE@            for file in $(GIWS_WRAPPERS) ; do \
+@GIWS_TRUE@                    echo "GIWS process of $$file ..."; \
+@GIWS_TRUE@                    $(GIWS_BIN) --output-dir $$GIWS_OUTPUTDIR --throws-exception-on-error --description-file $$file; \
+@GIWS_TRUE@            done; \
+@GIWS_TRUE@    fi
+
+macros:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+               echo "Error : Cannot build $< : Scilab has not been built"; \
+       else \
+               $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\
+       fi)
+
+# Removes the macros
+clean-macros:
+# Removes macros (*.bin generated from .sci)
+       @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+               echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \
+               rm -f $(builddir)/$$dir/$(MACROBINMASK); \
+       done
+
+all-local: $(TARGETS_ALL)
+
+.sci.bin:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+       echo "Error : Cannot build $< : Scilab has not been build"; \
+       else \
+       echo "Creating $@"; \
+       $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \
+       fi )
+
+install-html-local:
+# If the user wants the help sources to be installed
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of XML sources of help files --------"; \
+@INSTALL_HELP_XML_TRUE@        for lang in $(ALL_LINGUAS); do \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/$$lang; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@         fi; \
+@INSTALL_HELP_XML_TRUE@        done; \
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of MathML sources --------"; \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/mml/; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@        fi
+install-data-local:
+# Install the tests
+       @echo "-------- Install tests (if any) --------"; \
+       for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the help chapter
+       @echo "-------- Install the help chapter (if any) --------"; \
+       for lang in $(HELP_CHAPTERLANG); do \
+               HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \
+               if test -f $$HELPFILE; then \
+                       echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+                       $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+               fi; \
+       done
+# Install the demos & examples
+       @echo "-------- Install demos & examples (if any) --------"; \
+       for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the macros
+       @echo "-------- Install macros (if any) --------"; \
+       for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+         $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+               if test -d $(srcdir)/$$dir/; then \
+                       FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\
+                       for specialExt in $(MACROSSPECIALEXT); do \
+                               specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \
+                       done; \
+                       FILELIST="$$FILELIST $$specialExtDir"; \
+                 for file in `ls -1 $$FILELIST 2>/dev/null`; do \
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \
+                 done; \
+               fi; \
+       done
+# Install java files (.jar)
+       @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \
+       echo "-------- Install jar files --------"; \
+    $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \
+         for file in $(srcdir)/$(JARDIR)$(JARMASK); do\
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \
+         done ; \
+       fi
+
+########### CLEAN ###################
+# Clean macros and help (generated automatically by Scilab)
+@NEED_JAVA_TRUE@clean-local: clean-java clean-macros
+@NEED_JAVA_FALSE@clean-local: clean-macros
+
+distclean-local:
+       rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_*
+
+.PHONY: macros java swig giws
+
+# Provides macros compilation, Java compilation, cleaning
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scilab/modules/mpi/TODO b/scilab/modules/mpi/TODO
new file mode 100644 (file)
index 0000000..bd6394a
--- /dev/null
@@ -0,0 +1,10 @@
+Mandatory functions :
+
+mpi_init
+MPI_Comm_rank
+MPI_Comm_size
+MPI_Send
+MPI_Recv
+
+MPI_Reduce
+MPI_Finalize
\ No newline at end of file
diff --git a/scilab/modules/mpi/VERSION b/scilab/modules/mpi/VERSION
new file mode 100644 (file)
index 0000000..49d5957
--- /dev/null
@@ -0,0 +1 @@
+0.1
diff --git a/scilab/modules/mpi/changelog.txt b/scilab/modules/mpi/changelog.txt
new file mode 100644 (file)
index 0000000..4768956
--- /dev/null
@@ -0,0 +1,6 @@
+module_skeleton (0.1-1) stable; urgency=medium
+
+  * First version of the module
+
+ -- Sylvestre Ledru <sylvestre.ledru@inria.fr>  Tue, 13 Mar 2007 13:37:08D +0200
+
diff --git a/scilab/modules/mpi/etc/mpi.quit b/scilab/modules/mpi/etc/mpi.quit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/scilab/modules/mpi/etc/mpi.start b/scilab/modules/mpi/etc/mpi.start
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/scilab/modules/mpi/examples/foo.sci b/scilab/modules/mpi/examples/foo.sci
new file mode 100644 (file)
index 0000000..6276d4b
--- /dev/null
@@ -0,0 +1,16 @@
+num = mpi_comm_rank()
+
+N =  mpi_comm_size()
+
+src  = modulo(num+N-1, N)
+
+dest = modulo(num+1, N)
+
+
+if ((modulo(num,2) == 0)) then 
+       mpi_send(num,dest,1001)
+       res = mpi_recv(src,1001)
+else 
+       res = mpi_recv(src,1001)
+       mpi_send(num,dest,1001)
+end
diff --git a/scilab/modules/mpi/includes/gw_mpi.h b/scilab/modules/mpi/includes/gw_mpi.h
new file mode 100644 (file)
index 0000000..d3fdbc9
--- /dev/null
@@ -0,0 +1,45 @@
+/**
+ * Gateway header file (declaration of the "links" 
+ * between Scilab and the MPI "library"
+ * @author Sylvestre LEDRU INRIA 2007
+ */
+
+#ifndef __GW_MPI__
+#define __GW_MPI__
+
+#ifdef _MSC_VER
+  #include <windows.h>
+  #include <stdio.h>
+#endif
+
+#include <string.h>
+#include "machine.h"
+#include "stack-c.h"
+
+int C2F(gw_mpi)(void);
+
+typedef int (*MPI_Interf) (char *fname,unsigned long l);
+
+typedef struct table_struct
+{
+  MPI_Interf f;    /** function **/
+  char *name;      /** its name **/
+} MPITable;
+
+// Declaration of all the profile function declared and 
+// used in sci_gateway/*/
+int C2F(sci_mpi_init) (char *fname,unsigned long fname_len);
+int C2F(sci_mpi_finalize) (char *fname,unsigned long fname_len);
+int C2F(sci_mpi_comm_size) (char *fname,unsigned long fname_len);
+int C2F(sci_mpi_comm_rank) (char *fname,unsigned long fname_len);
+int C2F(sci_mpi_recv) (char *fname,unsigned long fname_len);
+int C2F(sci_mpi_send) (char *fname,unsigned long fname_len);
+
+/*
+int intsmpi_comm_size (char *fname,unsigned long fname_len));
+
+int intsmpi_irecv (char *fname,unsigned long fname_len));
+int intsmpi_isend (char *fname,unsigned long fname_len));
+*/
+#endif /*  __GW_MPI__ */
+
diff --git a/scilab/modules/mpi/licence.txt b/scilab/modules/mpi/licence.txt
new file mode 100644 (file)
index 0000000..a9b14b9
--- /dev/null
@@ -0,0 +1 @@
+Licence File
diff --git a/scilab/modules/mpi/macros/MPIHelloWorld.sci b/scilab/modules/mpi/macros/MPIHelloWorld.sci
new file mode 100644 (file)
index 0000000..e24baa9
--- /dev/null
@@ -0,0 +1,39 @@
+function MPIHelloWorld()
+
+////////////
+// PARALLEL / initialization, include MPI_Init time in measurement
+////////////
+MPI_Init();                    // should have lambooted first
+rnk =  MPI_Comm_rank();        // let it abort if it fails
+sizeNodes =    MPI_Comm_size();
+
+    SLV = rnk;                 // handy shortcuts, master is rank 0
+    Master = ~ SLV;                    // slaves are all other
+
+if Master
+
+       disp("We have "+string(sizeNodes) + " processors")
+       for slaveId = 1:sizeNodes-1
+               MPI_Send("== FROM Master == MPI_Send",slaveId)
+       end
+
+       for slaveId = 1:sizeNodes-1
+               tag=0
+           valueBack=MPI_Recv(slaveId, tag)
+               disp("<=> VALUE BACK <=> "+valueBack+ " from " +string(slaveId))
+
+       end
+else
+// slave
+       disp("Processor "+string(rnk))
+       rankSource=0
+       tag=0
+    value=MPI_Recv(rankSource, tag)
+       value="(Modified by the slave) "+value
+       MPI_Send(value,0)
+
+end
+
+MPI_Finalize()
+
+endfunction
diff --git a/scilab/modules/mpi/macros/MPIPi.sci b/scilab/modules/mpi/macros/MPIPi.sci
new file mode 100644 (file)
index 0000000..53435aa
--- /dev/null
@@ -0,0 +1,106 @@
+function MPIPi(N,mod)
+// Pi_seq: Compute PI (sequential) by num.integr. of arctan(x) in [0..1]
+//
+//     Pi_seq [ (N) ]
+//
+//  N  [1E7]   #subdivisions of the [0, 1] interval
+// mod ['s']   communication modality:  (s)end (r)educe
+//  printed results struct contains
+//     pi      estimated pi value
+//     err     error
+//     time    from argument xmit to pi computed
+//
+// Examples:
+//
+//  octave:1> Pi_seq
+//  results =
+//  {
+//    pi =  3.1416
+//    err = -6.4837e-14
+//    time =  2.7761
+//  }
+//
+
+////////////////////
+// ArgChk //
+////////////////////
+if argn(2)<1,  N=1E7;  end
+if argn(2)<2,  mod='s';        end
+if argn(2)>2,  error("usage MPIPi(N,mod)"); end
+flag=0;
+[%H,%ierr] = evstr(string(N));
+flag=flag | size(N,"*")<>1 | %ierr<>0;
+flag=flag  |   fix(N)~=N   |           N<1;
+if flag,       error("usage MPIPi( <int> N>0, <char> mod==''s|r'' )"), end
+
+////////////////////////////////////
+// Results struct //
+////////////////////////////////////
+results.pi  =0;
+results.err =0;
+results.time=0;
+
+////////////
+// PARALLEL / initialization, include MPI_Init time in measurement
+////////////
+//  T=clock; /
+////////////
+               MPI_Init();                     // should have lambooted first
+   rnk =       MPI_Comm_rank();        // let it abort if it fails
+   siz =       MPI_Comm_size();
+
+    SLV = rnk;                 // handy shortcuts, master is rank 0
+    MST = ~ SLV;                       // slaves are all other
+
+if MST 
+disp("Master here")
+else
+disp("Slave here")
+end
+
+////////////
+// PARALLEL / computation (depends on rank/size)
+////////////                   // vectorized code, equivalent to
+  width=1/N; lsum=0;           // for i=rnk:siz:N-1
+  i=rnk:siz:N-1;               //   x=(i+0.5)*width;
+  x=(i+0.5)*width;             //   lsum=lsum+4/(1+x^2);
+  lsum=sum(4 ./(1+x.^2));      // end
+                               // mem-bound, N=1E7 => size(i)=8E7/siz (80MB!!!)
+////////////
+// PARALLEL / reduction and finish
+////////////
+select mod
+  case 's',                    TAG=7;  // Any tag would do
+    if SLV                             // All slaves send result back
+       MPI_Send(lsum,             0,TAG);
+    else                               // Here at master
+           Sum =lsum;                  // save local result
+      for slv=1:siz-1                  // collect in any order
+//     MPI_Recv(lsum,MPI_ANY_SOURCE,TAG,MPI_COMM_WORLD);
+               MPI_Recv(lsum,TAG);
+           Sum += lsum;                        // and accumulate
+      end                              // order: slv or MPI_ANY_SOURCE
+    end
+  case 'r',            Sum=0;          // reduction master = rank 0 @ WORLD
+        MPI_Reduce(lsum,Sum, MPI_SUM,  0,MPI_COMM_WORLD);
+end
+
+               MPI_Finalize;
+
+//////////////////////////////////////////////////////////////////
+//results.time = etime(clock,T);       //
+//////////////////////////////////////////////////////////////////
+results.err  = Sum-%pi;
+results.pi   = Sum // ;
+
+
+//////////////////////////////
+// FINAL CHECK //
+//////////////////////////////
+  if abs(results.err)>5E-10
+    warning("pretty nice pi value! go fix it")
+  end
+disp(results)
+endfunction
+
+
diff --git a/scilab/modules/mpi/macros/MPIPi_seq.sci b/scilab/modules/mpi/macros/MPIPi_seq.sci
new file mode 100644 (file)
index 0000000..4dbd38c
--- /dev/null
@@ -0,0 +1,68 @@
+function MPIPi_seq(N)
+// Pi_seq: Compute PI (sequential) by num.integr. of arctan(x) in [0..1]
+//
+//     Pi_seq [ (N) ]
+//
+//  N  [1E7]   #subdivisions of the [0, 1] interval
+//
+//  printed results struct contains
+//     pi      estimated pi value
+//     err     error
+//     time    from argument xmit to pi computed
+//
+// Examples:
+//
+//  octave:1> Pi_seq
+//  results =
+//  {
+//    pi =  3.1416
+//    err = -6.4837e-14
+//    time =  2.7761
+//  }
+//
+
+////////////////////
+// ArgChk //
+////////////////////
+if argn(2)<1,  N=1E7;  end
+if argn(2)>1,  error("usage Pi_seq(N)"); end
+flag=0;
+[%H,%ierr] = evstr(string(N));
+flag=flag | size(N,"*")<>1 | %ierr<>0;
+flag=flag  |   fix(N)~=N   |           N<1;
+if flag,       error("usage Pi_seq( <int> N>0, <char> mod==''s|r'' )"), end
+
+////////////////////////////////////
+// Results struct //
+////////////////////////////////////
+results.pi  =0;
+results.err =0;
+results.time=0;
+
+////////////////////////////
+// SEQUENTIAL // code, vectorized
+////////////////////////////
+//    T=clock; //
+////////////////////////////                   // vectorized code, equivalent to
+    width=1/N; Sum=0;          // for i=0:N-1
+    i=0:N-1;                   //   x=(i+0.5)*width;
+    x=(i+0.5)*width;           //   Sum=Sum+4/(1+x^2);
+    Sum=sum(4 ./ (1+x.^2));    // end
+    Sum      = Sum/N ;         // 1/N better at end: don't loose resolution
+//////////////////////////////////////////////////////////////////
+//results.time = etime(clock,T);       //
+//////////////////////////////////////////////////////////////////
+results.err  = Sum-%pi;
+results.pi   = Sum // ;
+
+
+//////////////////////////////
+// FINAL CHECK //
+//////////////////////////////
+  if abs(results.err)>5E-10
+    warning("pretty nice pi value! go fix it")
+  end
+disp(results)
+endfunction
+
+
diff --git a/scilab/modules/mpi/macros/buildmacros.sce b/scilab/modules/mpi/macros/buildmacros.sce
new file mode 100644 (file)
index 0000000..66373d5
--- /dev/null
@@ -0,0 +1,6 @@
+//------------------------------------
+// Sylvestre LEDRU INRIA 2007
+//------------------------------------
+// no macros yet
+genlib('mpilib','SCI/modules/mpi/macros');
+//------------------------------------
diff --git a/scilab/modules/mpi/macros/mpi.sce b/scilab/modules/mpi/macros/mpi.sce
new file mode 100644 (file)
index 0000000..56d2132
--- /dev/null
@@ -0,0 +1,4 @@
+ifile=SCIP_ROOT+'/lib/intmpi_'+PVM_ARCH+'.o';
+ufiles=[SCIP_ROOT+'/lib/libintmpi_sci_'+PVM_ARCH+'.a', MPI_LIB]
+files=[ifile,ufiles]
+exec(SCIP_ROOT+'/src-intersci/intmpi.sce');
diff --git a/scilab/modules/mpi/readme.txt b/scilab/modules/mpi/readme.txt
new file mode 100644 (file)
index 0000000..e085433
--- /dev/null
@@ -0,0 +1,30 @@
+README File
+
+1. Description
+
+The Message Passing Interface (MPI) is a language-independent computer communications descriptive application programming interface (API) for message-passing on a parallel computer.
+
+See : http://en.wikipedia.org/wiki/Message_Passing_Interface
+
+
+
+
+
+2. MPI Functions available into Scilab 
+2.1  MPI_Init
+
+2.2 MPI_Comm_size
+
+2.3 MPI_Comm_rank
+
+2.4 MPI_Send
+
+2.5 MPI_Recv
+
+2.6 MPI_Finalize
+
+
+3. Example
+$ mpirun -c 5 scilab -q --eval "MPIPi(2E7,'r')"        # parallel run, 5 ranks
+
+$ mpirun -c 5 scilab -q -e "getf('SCI/modules/mpi/macros/MPIPi_seq.sci'); MPIPi_seq(2E7)"      # parallel run, 5 ranks
\ No newline at end of file
diff --git a/scilab/modules/mpi/sci_gateway/c/gw_mpi.c b/scilab/modules/mpi/sci_gateway/c/gw_mpi.c
new file mode 100644 (file)
index 0000000..4549e30
--- /dev/null
@@ -0,0 +1,57 @@
+/**
+ * Declaration of the "linking" functions Scilab <=> native code 
+ * (here C & Fortran)
+ * @author Sylvestre LEDRU INRIA 
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#ifdef _MSC_VER
+#include <Windows.h>
+#include "ExceptionMessage.h"
+#endif
+#include "machine.h"
+/*-----------------------------------------------------------------------------------*/
+static MPITable Tab[]=
+{
+       {C2F(sci_mpi_init),"MPI_Init"},
+       {C2F(sci_mpi_finalize),"MPI_Finalize"},
+       {C2F(sci_mpi_comm_size),"MPI_Comm_size"},
+       {C2F(sci_mpi_comm_rank),"MPI_Comm_rank"},
+       {C2F(sci_mpi_recv),"MPI_Recv"},
+       {C2F(sci_mpi_send),"MPI_Send"}
+};
+/*static MPITable Tab[]=
+{
+       {intsmpi_send,"mpi_send"},
+       {intsmpi_recv,"mpi_recv"},
+       {intsmpi_isend,"mpi_isend"},
+       {intsmpi_irecv,"mpi_irecv"},
+       {intsmpi_init,"mpi_init"},
+       {intsmpi_finalize,"mpi_finalize"},
+       {intsmpi_comm_rank,"mpi_comm_rank"},
+       {intsmpi_comm_size,"mpi_comm_size"}
+};*/
+/*-----------------------------------------------------------------------------------*/
+int C2F(gw_mpi)(void)
+{  
+       Rhs = Max(0, Rhs);
+
+#ifdef _MSC_VER
+       #ifndef _DEBUG
+               _try
+               {
+                       (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
+               }
+               _except (EXCEPTION_EXECUTE_HANDLER)
+               {       
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
+               }
+       #else
+               (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
+       #endif
+#else
+                       (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
+#endif
+       return 0;
+}
+/*-----------------------------------------------------------------------------------*/
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_rank.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_rank.c
new file mode 100644 (file)
index 0000000..470951b
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * Function calling mpi_comm_rank
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+
+/**
+ * SCILAB function : mpi_comm_rank, fin = 7
+ * This function returns the rank of a process within
+ * the specified communicator.
+ */
+
+int C2F(sci_mpi_comm_rank) (char *fname,unsigned long fname_len)
+{
+       int comm_rank;
+       int n1=1,m1=1,l1=0;
+       CheckRhs(0,0); // Check the parameters of the function ... Here 0
+       CheckLhs(1,1); // The output of the function (1 parameter)
+       MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
+       
+       CreateVar(1, "d", &m1, &n1 ,&l1); // Create the space in the stack for comm_rank
+       *stk(l1)=(double)comm_rank; // Copy comm_size into the stack
+
+       LhsVar(1)= 1;
+       C2F(putlhsvar)();
+       return 0;
+}
+
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_size.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_comm_size.c
new file mode 100644 (file)
index 0000000..5d826ab
--- /dev/null
@@ -0,0 +1,45 @@
+/**
+ * Function calling mpi_comm_size
+ * @author Sylvestre LEDRU - INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "stack-c.h"
+
+/**
+ * SCILAB function : mpi_comm_size, fin = 3
+ * This function returns the rank of a process 
+ */
+int C2F(sci_mpi_comm_size) (char *fname,unsigned long fname_len)
+{
+       int comm_size;
+       int n1=1,m1=1,l1=0;
+       MPI_Comm comm=NULL;
+       CheckRhs(0,1); // Check the parameters of the function ... Here 0 or 1
+       CheckLhs(1,1); // The output of the function (1 parameter)
+       if (Rhs==1)
+               {
+                       if (GetType(1)==sci_matrix)
+                               {
+                                       GetRhsVar(1,"d",&m1,&n1,&l1);
+                                       comm=(MPI_Comm)(int)istk(l1);
+                               }else{
+                                       Scierror(999,"The first parameter should be an int");
+                               }
+               }
+       else
+               {
+                       comm=MPI_COMM_WORLD;
+               }
+       printf("comm : %d\n",comm);
+       MPI_Comm_size(comm, &comm_size);
+       printf("comm_size : %d\n",comm_size);
+
+       CreateVar(1, "d", &m1, &n1 ,&l1); // Create the space in the stack for comm_size
+       *stk(l1)=(double)comm_size; // Copy comm_size into the stack
+
+       LhsVar(1)= 1;
+       C2F(putlhsvar)();
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_finalize.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_finalize.c
new file mode 100644 (file)
index 0000000..f5c1a34
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * Function calling mpi_finalize
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+
+/******************************************
+ * SCILAB function : mpi_finalize, fin = 2
+ ******************************************/
+
+int C2F(sci_mpi_finalize) (char *fname,unsigned long fname_len)
+{
+ CheckRhs(0,0);
+ CheckLhs(1,1);
+ MPI_Finalize();
+ // TODO: catch les erreurs
+ LhsVar(1)= 0;
+ return 0;
+
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_init.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_init.c
new file mode 100644 (file)
index 0000000..b09a599
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * Function calling mpi_init
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+
+/**
+ * SCILAB function : mpi_init, fin = 1
+ * This function init the mpi env
+ */
+MPI_Errhandler errhdl;
+/* should be moved elsewhere */
+void MPIErrHandler(MPI_Comm *comm, int *errorcode, ...) {
+  char buffer[4096];
+  int resultlen;
+  MPI_Error_string(*errorcode,buffer,&resultlen);
+  buffer[resultlen] = 0;
+  printf("Erreur mpi : %s\n",buffer);
+}
+
+int C2F(sci_mpi_init) (char *fname,unsigned long fname_len)
+{
+       int flag;
+       CheckRhs(0,0);
+       CheckLhs(1,1);
+
+       MPI_Initialized(&flag);
+       if (!flag) {
+               /* MPI Not yet initialized */
+               MPI_Init(NULL,NULL);
+
+               MPI_Comm_create_errhandler(MPIErrHandler,&errhdl);
+               //              MPI_Comm_set_errhandler(MPI_COMM_WORLD, errhdl);
+
+               printf("MPI_INIT : init done\n");
+       }
+       LhsVar(1)= 0;
+       C2F(putlhsvar)();
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_irecv.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_irecv.c
new file mode 100644 (file)
index 0000000..d0208fb
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * Function calling mpi_irecv
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+//#include "s_mpi_irecv.h"
+
+/******************************************
+ * SCILAB function : mpi_irecv, fin = 4
+ ******************************************/
+
+int intsmpi_irecv (char *fname,unsigned long fname_len)
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,l3,m4,n4,l4,un=1,l5,l6;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xdat0[]= {MPI_COMM_WORLD}, *dat0 = xdat0;
+       nopt=NumOpt();
+       CheckRhs(3,3+nopt);
+       CheckLhs(1,2);
+       /*  checking variable buff */
+       GetRhsVar(1,"c",&m1,&n1,&l1);
+       /*  checking variable source */
+       GetRhsVar(2,"i",&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       /*  checking variable tag */
+       GetRhsVar(3,"i",&m3,&n3,&l3);
+       CheckScalar(3,m3,n3);
+       iopos=Rhs;
+       if ( get_optionals(fname,opts) == 0) return 0;
+       /* default value to optional argument comm */
+       if ( opts[0].position == -1 ){
+               iopos++ ; opts[0].position = iopos;
+               opts[0].m = 1;opts[0].n = 1;
+               CreateVarFromPtr(opts[0].position,opts[0].type,&opts[0].m,&opts[0].n,&dat0);
+               opts[0].l = VarPtr(opts[0].position);
+       }
+       else { 
+               GetRhsVar(4,"i",&m4,&n4,&l4);
+               CheckScalar(4,m4,n4);
+       } 
+       /* cross variable size checking */
+       CreateVar(5,"i",&un,&un,&l5);/* named: request */
+       CreateVar(6,"i",&un,&un,&l6);/* named: res */
+       C2F(s_mpi_irecv)(cstk(l1),&m1,istk(l2),istk(l3),istk(opts[0].l),istk(l5),istk(l6));
+       LhsVar(1)= 5;
+       LhsVar(2)= 6;
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_isend.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_isend.c
new file mode 100644 (file)
index 0000000..cf962dc
--- /dev/null
@@ -0,0 +1,52 @@
+/**
+ * Function calling mpi_isend
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "s_mpi_isend.h"
+
+/******************************************
+ * SCILAB function : mpi_isend, fin = 3
+ ******************************************/
+
+int intsmpi_isend (char *fname,unsigned long fname_len)
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,l3,m4,n4,l4,un=1,l5,l6;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xdat0[]= {MPI_COMM_WORLD}, *dat0 = xdat0;
+       nopt=NumOpt();
+       CheckRhs(3,3+nopt);
+       CheckLhs(1,2);
+       /*  checking variable buff */
+       GetRhsVar(1,"d",&m1,&n1,&l1);
+       /*  checking variable dest */
+       GetRhsVar(2,"i",&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       /*  checking variable tag */
+       GetRhsVar(3,"i",&m3,&n3,&l3);
+       CheckScalar(3,m3,n3);
+       iopos=Rhs;
+       if ( get_optionals(fname,opts) == 0) return 0;
+       /* default value to optional argument comm */
+       if ( opts[0].position == -1 ){
+               iopos++ ; opts[0].position = iopos;
+               opts[0].m = 1;opts[0].n = 1;
+               CreateVarFromPtr(opts[0].position,opts[0].type,&opts[0].m,&opts[0].n,&dat0);
+               opts[0].l = VarPtr(opts[0].position);
+       }
+       else { 
+               GetRhsVar(4,"i",&m4,&n4,&l4);
+               CheckScalar(4,m4,n4);
+       } 
+       /* cross variable size checking */
+       CreateVar(5,"i",&un,&un,&l5);/* named: request */
+       CreateVar(6,"i",&un,&un,&l6);/* named: res */
+       C2F(s_mpi_isend)(stk(l1),&m1,&n1,istk(l2),istk(l3),istk(opts[0].l),istk(l5),istk(l6));
+       LhsVar(1)= 5;
+       LhsVar(2)= 6;
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c
new file mode 100644 (file)
index 0000000..3b1bf1c
--- /dev/null
@@ -0,0 +1,55 @@
+/**
+ * Function calling mpi_recv
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "s_mpi_recv.h"
+#include "stackTypeVariable.h"
+#include "MALLOC.h"
+/******************************************
+ * SCILAB function : mpi_recv, fin = 2
+ ******************************************/
+
+int C2F(sci_mpi_recv) (char *fname,unsigned long fname_len)
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,l3,ne4,me4,nn4,un=1,mn4,l4,l5,lrs,mn;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xdat0[]= {MPI_COMM_WORLD}, *dat0 = xdat0;
+       double *le4;
+       int rankSource;
+       int tag;
+       char *stringToBeReceived=(char*)MALLOC((256)*sizeof(char));
+
+       CheckRhs(2,2);  
+       CheckLhs(1,1);
+
+       GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
+       CheckScalar(1,m1,n1);
+       rankSource=(int) *stk(l1);
+
+       GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE,&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       tag=(int) *stk(l2);
+
+       int msgsize;
+       MPI_Status status;
+       /* Freemat envoit d'abord le nombre de message puis le message ?! a voir si c'est obligatoire ou pas */
+       //      MPI_Recv(&msgsize,1,MPI_INT,rankSource,tag,MPI_COMM_WORLD,&status);
+       //      void *cp = malloc(msgsize);
+       MPI_Recv(stringToBeReceived,255,MPI_CHAR,rankSource,tag,MPI_COMM_WORLD,MPI_STATUS_IGNORE);
+       //      MPI_Recv(buff, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD, &stat);
+
+       m3=1;
+       n3=1;
+       CreateVarFromPtr( Rhs+1, "c",(m3=(int)strlen(stringToBeReceived), &m3),&n3,&stringToBeReceived);
+       
+       LhsVar(1) = Rhs+1;
+       C2F(putlhsvar)();       
+       FREE(stringToBeReceived);
+
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c.back b/scilab/modules/mpi/sci_gateway/c/sci_mpi_recv.c.back
new file mode 100644 (file)
index 0000000..570eaba
--- /dev/null
@@ -0,0 +1,55 @@
+/**
+ * Function calling mpi_recv
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "s_mpi_recv.h"
+#include "stackTypeVariable.h"
+
+/******************************************
+ * SCILAB function : mpi_recv, fin = 2
+ ******************************************/
+
+int C2F(sci_mpi_recv) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,l3,ne4,me4,nn4,un=1,mn4,l4,l5,lrs,mn;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xdat0[]= {MPI_COMM_WORLD}, *dat0 = xdat0;
+       double *le4;
+       int rankSource;
+       int tag;
+       char stringToBeReceived[255];
+       CheckRhs(2,2);  
+       CheckLhs(1,1);
+
+       GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
+       CheckScalar(1,m1,n1);
+       rankSource=(int) *stk(l1);
+
+       GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE,&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       tag=(int) *stk(l2);
+
+       int msgsize;
+       MPI_Status status;
+       /* Freemat envoit d'abord le nombre de message puis le message ?! a voir si c'est obligatoire ou pas */
+       //      MPI_Recv(&msgsize,1,MPI_INT,rankSource,tag,MPI_COMM_WORLD,&status);
+       //      void *cp = malloc(msgsize);
+       MPI_Recv(stringToBeReceived,255,MPI_CHAR,rankSource,tag,MPI_COMM_WORLD,MPI_STATUS_IGNORE);
+       //      MPI_Recv(buff, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD, &stat);
+       
+       m3=1;
+       n3=1;
+       CreateVarFromPtr( Rhs+1, "c",(m3=(int)strlen(stringToBeReceived), &m3),&n3,&stringToBeReceived);
+       CreateVar(Rhs+1, CHAR_DATATYPE,&m3,&n3,&l3);
+       *cstk(l3) = (char*);
+       
+       LhsVar(1) = Rhs+1;
+
+       C2F(putlhsvar)();       
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c b/scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c
new file mode 100644 (file)
index 0000000..f49ca8c
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * Function calling mpi_send
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include <mpi.h>
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "s_mpi_send.h"
+#include "stackTypeVariable.h"
+
+/******************************************
+ * SCILAB function : mpi_send, fin = 1
+ ******************************************/
+#define TAG 0
+int C2F(sci_mpi_send) (char *fname,unsigned long fname_len)
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,m4,n4,l4,un=1,l5;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xcomm_world[]= {MPI_COMM_WORLD}, *comm_world = xcomm_world;
+       char *stringToBeSend;
+       int nodeID;
+
+       int one = 1;
+       int l3 = 0;
+
+
+       // Tag should be optionnal
+
+       CheckRhs(2,2);  
+       CheckLhs(1,1);
+
+       GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
+       //      CheckScalar(1,m1,n1);
+       stringToBeSend=cstk(l1);
+
+
+       GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE,&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       nodeID=(int) *stk(l2);
+
+       MPI_Send(stringToBeSend, strlen(stringToBeSend), MPI_CHAR, nodeID, TAG, MPI_COMM_WORLD);
+       
+       m3=1;
+       n3=1;
+       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m3,&n3,&l3);
+       *stk(l3) = 1;
+       
+       LhsVar(1) = Rhs+1;
+
+       C2F(putlhsvar)();
+
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c.back b/scilab/modules/mpi/sci_gateway/c/sci_mpi_send.c.back
new file mode 100644 (file)
index 0000000..ace32ec
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+ * Function calling mpi_send
+ * @author Sylvestre LEDRU INRIA
+ * @date 2007
+ */
+#include "gw_mpi.h"
+#include "sci_mpi.h"
+#include "s_mpi_send.h"
+#include "stackTypeVariable.h"
+
+/******************************************
+ * SCILAB function : mpi_send, fin = 1
+ ******************************************/
+
+int C2F(sci_mpi_send) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int nopt,iopos,m1,n1,l1,m2,n2,l2,m3,n3,l3,m4,n4,l4,un=1,l5;
+       static rhs_opts opts[]={
+               {-1,"comm","i",0,0,0},
+               {-1,NULL,NULL,NULL,0,0}};
+       static int xcomm_world[]= {MPI_COMM_WORLD}, *comm_world = xcomm_world;
+       nopt=NumOpt();
+       CheckRhs(1,1);  
+       CheckLhs(1,1);
+
+       /*
+       CheckRhs(3,3+nopt);
+       CheckLhs(1,1);
+       /*  checking variable buff */
+       GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
+       /*  checking variable dest */
+       GetRhsVar(2,MATRIX_OF_INTEGER_DATATYPE,&m2,&n2,&l2);
+       CheckScalar(2,m2,n2);
+       /*  checking variable tag */
+       GetRhsVar(3,MATRIX_OF_INTEGER_DATATYPE,&m3,&n3,&l3);
+       CheckScalar(3,m3,n3);
+       iopos=Rhs;
+       if ( get_optionals(fname,opts) == 0) return 0;
+       /* default value to optional argument comm */
+       if ( opts[0].position == -1 ){
+               iopos++ ; 
+               opts[0].position = iopos;
+               opts[0].m = 1;
+               opts[0].n = 1;
+               CreateVarFromPtr(opts[0].position,opts[0].type,&opts[0].m,&opts[0].n,&xcomm_world);
+               opts[0].l = VarPtr(opts[0].position);
+       }
+       else { 
+               GetRhsVar(4,MATRIX_OF_INTEGER_DATATYPE,&m4,&n4,&l4);
+               CheckScalar(4,m4,n4);
+       } 
+       /* cross variable size checking */
+       CreateVar(5,MATRIX_OF_INTEGER_DATATYPE,&un,&un,&l5);/* named: res */
+       C2F(s_mpi_send)(stk(l1),&m1,&n1,istk(l2),istk(l3),istk(opts[0].l),istk(l5));
+       LhsVar(1)= 5;
+       */
+       return 0;
+}
diff --git a/scilab/modules/mpi/sci_gateway/mpi b/scilab/modules/mpi/sci_gateway/mpi
new file mode 100644 (file)
index 0000000..bc79227
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
+
+<GATEWAY>
+
+<!-- =================== -->
+<!--
+ Scilab 
+ Sylvestre Ledru
+ INRIA 2007
+ ===================
+ Don't edit if you aren't sure
+-->
+<!-- =================== -->
+
+<PRIMITIVE>
+  <GATEWAY_ID>52</GATEWAY_ID>
+  <PRIMITIVE_ID>1</PRIMITIVE_ID>
+       <PRIMITIVE_NAME>mpi_init</PRIMITIVE_NAME>
+</PRIMITIVE>   
+
+<PRIMITIVE>
+  <GATEWAY_ID>52</GATEWAY_ID>
+  <PRIMITIVE_ID>2</PRIMITIVE_ID>
+       <PRIMITIVE_NAME>mpi_finalize</PRIMITIVE_NAME>
+</PRIMITIVE>   
+
+
+<PRIMITIVE>
+  <GATEWAY_ID>52</GATEWAY_ID>
+  <PRIMITIVE_ID>3</PRIMITIVE_ID>
+       <PRIMITIVE_NAME>mpi_comm_size</PRIMITIVE_NAME>
+</PRIMITIVE>   
+
+<!--
+;52 1 mpi_send
+;52 2 mpi_recv
+;52 3 mpi_isend
+;52 4 mpi_irecv
+;52 5 mpi_init
+;52 6 mpi_finalize
+;52 7 mpi_comm_rank
+-->
+
+</GATEWAY>
diff --git a/scilab/modules/mpi/sci_gateway/mpi_gateway.xml b/scilab/modules/mpi/sci_gateway/mpi_gateway.xml
new file mode 100644 (file)
index 0000000..89c5a2f
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
+<GATEWAY name="sylvestre">
+<!-- =================== -->
+<!--
+ Scilab
+ Interface description. In this file, we define the list of the function which
+ will be available into Scilab and the link to the "native" function.
+
+ gatewayId is the position in the hashtable 'Interfaces' defined in the
+ file SCI/modules/core/src/c/callinterf.h
+
+ primitiveId is the position in the hashtable '<module>Table Tab[]' defined
+ in the file modules/<module>/sci_gateway/c/gw_<module>.c
+
+ primitiveName is the name of the Scilab function
+
+ @author Allan CORNET
+ @author Sylvestre LEDRU
+ @date INRIA 2007
+ ===================
+ Don't touch if you do not know what you are doing
+-->
+<!-- =================== -->
+
+<PRIMITIVE gatewayId="55" primitiveId="1" primitiveName="MPI_Init" />
+<PRIMITIVE gatewayId="55" primitiveId="2" primitiveName="MPI_Finalize" />
+<PRIMITIVE gatewayId="55" primitiveId="3" primitiveName="MPI_Comm_size" />
+<PRIMITIVE gatewayId="55" primitiveId="4" primitiveName="MPI_Comm_rank" />
+
+<PRIMITIVE gatewayId="55" primitiveId="5" primitiveName="MPI_Recv" />
+<PRIMITIVE gatewayId="55" primitiveId="6" primitiveName="MPI_Send" />
+</GATEWAY>
\ No newline at end of file
diff --git a/scilab/modules/mpi/src/c/#s_mpi_send.c# b/scilab/modules/mpi/src/c/#s_mpi_send.c#
new file mode 100644 (file)
index 0000000..3db5c97
--- /dev/null
@@ -0,0 +1,113 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include "sci_mpi.h"
+#include "s_mpi_send.h"
+#include "build_buff_type.h"
+
+void C2F(s_mpi_send)(int *pack, int *n, double *buff, int *dest, int *tag, int *comm, int *res){
+  int errcode, errclass;       /* Error mgmt */
+  char error_msg[MPI_MAX_ERROR_STRING];
+  int error_msg_length;
+  int l;                       /* size of the buff to send in bytes */
+  
+  MPI_Datatype buff_type;
+
+  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+#ifdef DEBUG
+  if (debuglevel >= 5) {    
+    int *ptr_int = (int *)buff;
+    (void) fprintf(stderr, "MPI_SEND: %d:%d:%d:%d|%d:%d|%d:%d:%d:%d|%f:%f\n", 
+                  *n, *dest, *tag, *comm, 
+                  pack[0], pack[1], 
+                  ptr_int[0],ptr_int[1],
+                  ptr_int[2],ptr_int[3],
+                  buff[2],buff[3]);
+    (void) fflush (stderr);    
+  }
+#endif /* DEBUG */
+
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int i;
+    (void) fprintf(stderr, "MPI_SEND: %d|", *n);       
+    for (i = 0; i < *n; ++i) {
+      (void) fprintf(stderr, "%d:", 
+                    pack[i]);
+    }
+    (void) fprintf(stderr, "\n");
+    (void) fflush(stderr);     
+  }    
+#endif /* DEBUG */
+  
+  errcode = build_buff_type(*n, pack, &buff_type, &l);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -build_buff_type-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  errcode = MPI_Type_commit(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Type_commit-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+    
+                               /* Send the packing vector. The recv
+                                  part must make a call to probe
+                                  firts to have its size. */
+  errcode = MPI_Send(pack, *n, MPI_INT, *dest, *tag, MPI_COMM_WORLD);  
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Send-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+                               /* Send the data... */
+  errcode = MPI_Send(buff, 1, buff_type, *dest, *tag, MPI_COMM_WORLD);  
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Send-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int i;
+    char *ptr = (char*) buff;
+    (void) fprintf(stderr, "SEND:");   
+    for (i = 0; i < l; ++i) {
+      (void) fprintf(stderr, "%d:",ptr[i]);
+    }
+    (void) fprintf(stderr, "\n");      
+    (void) fflush (stderr);    
+  }    
+#endif /* DEBUG */
+  errcode = MPI_Type_free(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Type_free-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  *res = MPI_SUCCESS;
+} 
diff --git a/scilab/modules/mpi/src/c/build_buff_type.c b/scilab/modules/mpi/src/c/build_buff_type.c
new file mode 100644 (file)
index 0000000..f6e65dd
--- /dev/null
@@ -0,0 +1,85 @@
+/**
+ * Copyright (c) 1999 - INRIA Lorraine
+ * Copyright (c) 2007 - Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include "sci_mpi.h"
+#include "build_buff_type.h"
+
+int build_buff_type(int n, int const * const pack, 
+               MPI_Datatype * const buff_type, int * const size)
+/* Given a pack vector (i.e., |int|double|+)  the function builds the
+   corresponding MPI type */
+{
+  int *array_of_blocklenghts;  /* Virtual structure */
+  MPI_Aint *array_of_displacements;
+  MPI_Datatype *array_of_types;
+  int displacement = 0;
+  int errcode = MPI_SUCCESS;
+  int i;                       /* loop index */
+  int nb_blocks;               /* nb of blocks  */
+
+  *size = 0;
+  if ((array_of_blocklenghts = (int *) malloc(n * sizeof(int))) ==  NULL){
+    (void) fprintf(stderr, "Error malloc in mpi_send\n");
+    (void) fflush(stderr);
+    return MPI_ERR_OTHER;
+  }
+  if ((array_of_displacements = 
+       (MPI_Aint *) malloc(n * sizeof(MPI_Aint))) == NULL){
+    free(array_of_blocklenghts);
+    (void) fprintf(stderr, "Error malloc in mpi_send\n");
+    (void) fflush(stderr);
+    return MPI_ERR_OTHER;
+  }
+  if ((array_of_types = 
+       (MPI_Datatype *) malloc(n * sizeof(MPI_Datatype))) == NULL){
+    free(array_of_blocklenghts);
+    free(array_of_displacements);
+    (void) fprintf(stderr, "Error malloc in mpi_send\n");
+    (void) fflush(stderr);
+    return MPI_ERR_OTHER;
+  }
+
+  for (i = 0, nb_blocks = 0; i < n; i+=2) {
+    if (pack[i] > 0){          /* Have to pack some int */
+      array_of_displacements[nb_blocks] = displacement;
+      array_of_blocklenghts[nb_blocks] = pack[i];
+      array_of_types[nb_blocks] = MPI_INT;
+      nb_blocks++;
+      displacement  += (((pack[i]-1)/2 + 1) * sizeof(double));
+    }
+    if (pack[i + 1] > 0){              /* Have to pack some double */
+      array_of_displacements[nb_blocks] = displacement;
+      array_of_blocklenghts[nb_blocks] = pack[i+1];
+      array_of_types[nb_blocks] = MPI_DOUBLE;
+      nb_blocks++;
+      displacement += (pack[i+1] * sizeof(double));
+    }
+  }
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int j;
+    (void) fprintf(stderr, "build_buff_type: %d|", displacement);      
+    for (j = 0; j < nb_blocks; ++j) {
+      (void) fprintf(stderr, "%d:%ld|", 
+                    array_of_blocklenghts[j],
+                    array_of_displacements[j]);
+    }
+    (void) fprintf(stderr, "\n");
+    (void) fflush (stderr);    
+  }    
+#endif /* DEBUG */
+
+  errcode = MPI_Type_struct(nb_blocks, 
+                           array_of_blocklenghts,
+                           array_of_displacements,
+                           array_of_types,
+                           buff_type);
+  *size = displacement;                /* taille en byte */
+  free(array_of_blocklenghts);  
+  free(array_of_displacements); 
+  free(array_of_types);   
+  return errcode;
+} /* build_buff_type */
diff --git a/scilab/modules/mpi/src/c/build_buff_type.h b/scilab/modules/mpi/src/c/build_buff_type.h
new file mode 100644 (file)
index 0000000..2620b17
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+/**
+ * TODO : comment
+ *
+ *
+ */
+int build_buff_type(int n, int const * const pack, MPI_Datatype * const buff_type, int * const size);
diff --git a/scilab/modules/mpi/src/c/dboard.c b/scilab/modules/mpi/src/c/dboard.c
new file mode 100644 (file)
index 0000000..0c21fbe
--- /dev/null
@@ -0,0 +1,39 @@
+/* dboard.c
+   see pi_send.c and pi_reduce.c    */
+
+#include <stdlib.h>
+#define sqr(x) ((x)*(x))
+long random(void);
+
+double dboard(int darts)
+     {
+     double x_coord,       /* x coordinate, between -1 and 1  */
+            y_coord,       /* y coordinate, between -1 and 1  */
+            pi,            /* pi  */
+            r;             /* random number between 0 and 1  */
+     int score,            /* number of darts that hit circle */
+         n;
+     unsigned long cconst; /* used to convert integer random number */
+                           /* between 0 and 2^31 to double random number */
+                           /* between 0 and 1  */
+
+     cconst = 2 << (31 - 1);
+     score = 0;
+
+     /* "throw darts at board" */
+     for (n = 1; n <= darts; n++)  {
+          /* generate random numbers for x and y coordinates */
+          r = (double)random()/cconst;
+          x_coord = (2.0 * r) - 1.0;
+          r = (double)random()/cconst;
+          y_coord = (2.0 * r) - 1.0;
+
+          /* if dart lands in circle, increment score */
+          if ((sqr(x_coord) + sqr(y_coord)) <= 1.0)
+               score++;
+          }
+
+     /* calculate pi */
+     pi = 4.0 * (double)score/(double)darts;
+     return(pi);
+     } 
diff --git a/scilab/modules/mpi/src/c/mpi_pi_reduce.c b/scilab/modules/mpi/src/c/mpi_pi_reduce.c
new file mode 100644 (file)
index 0000000..d6ab1d4
--- /dev/null
@@ -0,0 +1,89 @@
+/* ---------------------------------------------------------------
+ * MPI pi Calculation Example - C Version 
+ * Collective Communication example
+ * FILE: mpi_pi_reduce.c
+ * OTHER FILES: dboard.c
+ * DESCRIPTION:  MPI pi calculation example program.  C Version.
+ *   This program calculates pi using a "dartboard" algorithm.  See
+ *   Fox et al.(1988) Solving Problems on Concurrent Processors, vol.1
+ *   page 207.  All processes contribute to the calculation, with the
+ *   master averaging the values for pi.
+ *
+ *   SPMD version:  Conditional statements check if the process 
+ *   is the master or a worker. 
+ *
+ *   This version uses mpc_reduce to collect results
+ *
+ * AUTHOR: Roslyn Leibensperger. Converted to MPI: George L. Gusciora 
+ *   (1/25/95)
+ * LAST REVISED: 06/07/96 Blaise Barney
+ * --------------------------------------------------------------- */
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+void srandom (unsigned seed);
+double dboard (int darts);
+#define DARTS 50000     /* number of throws at dartboard */
+#define ROUNDS 100      /* number of times "darts" is iterated */
+#define MASTER 0        /* task ID of master task */
+
+int main(argc,argv)
+int argc;
+char *argv[];
+{
+double homepi,         /* value of pi calculated by current task */
+       pisum,          /* sum of tasks' pi values */
+       pi,             /* average of pi after "darts" is thrown */
+       avepi;          /* average pi value for all iterations */
+int    taskid,         /* task ID - also used as seed number */
+       numtasks,       /* number of tasks */
+       rc,             /* return code */
+       i;
+MPI_Status status;
+
+   /* Obtain number of tasks and task ID */
+   rc = MPI_Init(&argc,&argv);
+   rc|= MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
+   rc|= MPI_Comm_rank(MPI_COMM_WORLD,&taskid);
+   if (rc != MPI_SUCCESS)
+      printf ("error initializing MPI and obtaining task ID information\n");
+   else
+      printf ("task ID = %d\n", taskid);
+
+   /* Set seed for random number generator equal to task ID */
+   srandom (taskid);
+
+   avepi = 0;
+   for (i = 0; i < ROUNDS; i++)
+   {
+      /* All tasks calculate pi using dartboard algorithm */
+      homepi = dboard(DARTS);
+      /* Use MPI_Reduce to sum values of homepi across all tasks 
+       * Master will store the accumulated value in pisum 
+       * - homepi is the send buffer
+       * - pisum is the receive buffer (used by the receiving task only)
+       * - the size of the message is sizeof(double)
+       * - MASTER is the task that will receive the result of the reduction
+       *   operation
+       * - MPI_SUM is a pre-defined reduction function (double-precision
+       *   floating-point vector addition).  Must be declared extern.
+       * - MPI_COMM_WORLD is the group of tasks that will participate.
+       */
+
+      rc = MPI_Reduce(&homepi, &pisum, 1, MPI_DOUBLE, MPI_SUM,
+                         MASTER, MPI_COMM_WORLD);
+      if (rc != MPI_SUCCESS)
+         printf("%d: failure on mpc_reduce\n", taskid);
+
+      /* Master computes average for this iteration and all iterations */
+      if (taskid == MASTER)
+      {
+         pi = pisum/numtasks;
+         avepi = ((avepi * i) + pi)/(i + 1); 
+         printf("   After %3d throws, average value of pi = %10.8f\n",
+                   (DARTS * (i + 1)),avepi);
+      }    
+   } 
+   MPI_Finalize();
+   return 0;
+}
diff --git a/scilab/modules/mpi/src/c/mpi_pi_send.c b/scilab/modules/mpi/src/c/mpi_pi_send.c
new file mode 100644 (file)
index 0000000..953e1fa
--- /dev/null
@@ -0,0 +1,103 @@
+/* ---------------------------------------------------------------
+ * MPI pi Calculation Example - C Version 
+ * Point-to-Point communications example
+ *
+ * FILE: mpi_pi_send.c
+ * OTHER FILES: dboard.c
+ * DESCRIPTION:  MPI pi calculation example program.  C Version.
+ *   This program calculates pi using a "dartboard" algorithm.  See
+ *   Fox et al.(1988) Solving Problems on Concurrent Processors, vol.1
+ *   page 207.  All processes contribute to the calculation, with the
+ *   master averaging the values for pi.
+ *
+ *   SPMD version:  Conditional statements check if the process 
+ *   is the master or a worker. 
+ *
+ *   This version uses low level sends and receives to collect results
+ *
+ * AUTHOR: Roslyn Leibensperger. Converted to MPI: George L. Gusciora (1/25/95)
+ * LAST REVISED: 12/14/95 Blaise Barney
+ * --------------------------------------------------------------- */
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+void srandom (unsigned seed);
+double dboard (int darts);
+#define DARTS 5000      /* number of throws at dartboard */
+#define ROUNDS 100       /* number of times "darts" is iterated */
+#define MASTER 0        /* task ID of master task */
+
+int main(int argc,char *argv[])
+{
+       double  homepi,         /* value of pi calculated by current task */
+               pi,             /* average of pi after "darts" is thrown */
+               avepi,          /* average pi value for all iterations */
+               pirecv,         /* pi received from worker */
+               pisum;          /* sum of workers pi values */
+       int     taskid,         /* task ID - also used as seed number */
+               numtasks,       /* number of tasks */
+               source,         /* source of incoming message */ 
+               mtype,          /* message type */
+               rc,             /* return code */
+               i, n;
+       MPI_Status status;
+
+       /* Obtain number of tasks and task ID */
+       rc = MPI_Init(&argc,&argv);
+       rc = MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
+       rc = MPI_Comm_rank(MPI_COMM_WORLD,&taskid);
+       printf("numtasks : %d\n",numtasks);
+       printf("taskid : %d\n",taskid);
+       /* Set seed for random number generator equal to task ID */
+       srandom (taskid);
+
+       avepi = 0;
+       for (i = 0; i < ROUNDS; i++)
+               {
+                       /* All tasks calculate pi using dartboard algorithm */
+                       homepi = dboard(DARTS);
+
+                       /* Workers send homepi to master */
+                       /* - Message type will be set to the iteration count */
+                       if (taskid != MASTER)
+                               {
+                                       printf("On the Slave, taskid : %d\n",taskid);
+                                       mtype = i;
+                                       rc = MPI_Send(&homepi, 1, MPI_DOUBLE,
+                                                                 MASTER, mtype, MPI_COMM_WORLD);
+                                       if (rc != MPI_SUCCESS)
+                                               printf("%d: Send failure on round %d\n", taskid, mtype);
+                               } else
+                                       {
+                                       printf("On the Master, taskid : %d\n",taskid);
+
+                                               /* Master receives messages from all workers */
+                                               /* - Message type will be set to the iteration count */
+                                               /* - Message source will be set to the wildcard DONTCARE: */
+                                               /*   a message can be received from any task, as long as the */
+                                               /*   message types match */
+                                               /* - The return code will be checked, and a message displayed */
+                                               /*   if a problem occurred */
+                                               mtype = i;
+                                               pisum = 0;
+                                               for (n = 1; n < numtasks; n++)
+                                                       {
+                                                               rc = MPI_Recv(&pirecv, 1, MPI_DOUBLE, MPI_ANY_SOURCE,
+                                                                                         mtype, MPI_COMM_WORLD, &status);
+                                                               if (rc != MPI_SUCCESS) 
+                                                                       printf("%d: Receive failure on round %d\n", taskid, mtype);
+                                                               /* keep running total of pi */
+                                                               pisum = pisum + pirecv;
+                                                       }
+                                               /* Master calculates the average value of pi for this iteration */
+                                               pi = (pisum + homepi)/numtasks;
+                                               /* Master calculates the average value of pi over all iterations */
+                                               avepi = ((avepi * i) + pi)/(i + 1); 
+                                               printf("   After %3d throws, average value of pi = %10.8f\n",
+                                                          (DARTS * (i + 1)),avepi);
+                                       }    
+               } 
+
+       MPI_Finalize();
+       return 0;
+}
diff --git a/scilab/modules/mpi/src/c/mpitest.c b/scilab/modules/mpi/src/c/mpitest.c
new file mode 100644 (file)
index 0000000..32cbc97
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ "Hello World" Type MPI Test Program
+*/
+#include <mpi.h>
+#include <stdio.h>
+#include <string.h>
+
+#define BUFSIZE 128
+#define TAG 0
+
+int main(int argc, char *argv[])
+{
+  char idstr[32];
+  char buff[BUFSIZE];
+  char buffRecv[BUFSIZE];
+
+  int numprocs;
+  int myid;
+  int i;
+  MPI_Status stat; 
+  MPI_Init(&argc,&argv); /* all MPI programs start with MPI_Init; all 'N' processes exist thereafter */
+  MPI_Comm_size(MPI_COMM_WORLD,&numprocs); /* find out how big the SPMD world is */
+  MPI_Comm_rank(MPI_COMM_WORLD,&myid); /* and this processes' rank is */
+
+  /* At this point, all the programs are running equivalently, the rank is used to
+     distinguish the roles of the programs in the SPMD model, with rank 0 often used
+     specially... */
+  if(myid == 0)
+  {
+    printf("%d: We have %d processors\n", myid, numprocs);
+    for(i=1;i<numprocs;i++)
+    {
+      sprintf(buff, "Hello %d! ", i);
+      MPI_Send(buff, BUFSIZE, MPI_CHAR, i, TAG, MPI_COMM_WORLD);
+    }
+    for(i=1;i<numprocs;i++)
+    {
+      MPI_Recv(buff, BUFSIZE, MPI_CHAR, i, TAG, MPI_COMM_WORLD, &stat);
+      printf("%d: %s\n", myid, buff);
+    }
+  }
+  else
+  {
+    /* receive from rank 0: */
+    MPI_Recv(buffRecv, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD, &stat);
+    sprintf(idstr, "Processor %d ", myid);
+    strcat(buffRecv, idstr);
+    strcat(buffRecv, "reporting for duty\n");
+    /* send to rank 0: */
+    MPI_Send(buffRecv, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD);
+  }
+
+  MPI_Finalize(); /* MPI Programs end with MPI Finalize; this is a weak synchronization point */
+  return 0;
+}
diff --git a/scilab/modules/mpi/src/c/s_mpi_irecv.c b/scilab/modules/mpi/src/c/s_mpi_irecv.c
new file mode 100644 (file)
index 0000000..ab75559
--- /dev/null
@@ -0,0 +1,15 @@
+/**
+ * Copyright (c) 1999 - INRIA Lorraine
+ * Copyright (c) 2007 - Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt
+ */
+
+#include "sci_mpi.h"
+#include "s_mpi_irecv.h"
+
+void C2F(s_mpi_irecv)(const int * const source,  /* INPUT */
+                const int * const tag,     /* INPUT */
+                const int * const comm,    /* INPUT */
+                int *request, int *res)    /* OUTPUT */
+{
+       *res = MPI_SUCCESS;
+} /* scimpiirecv */
diff --git a/scilab/modules/mpi/src/c/s_mpi_irecv.h b/scilab/modules/mpi/src/c/s_mpi_irecv.h
new file mode 100644 (file)
index 0000000..627823e
--- /dev/null
@@ -0,0 +1,15 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include <stdio.h>
+
+/**
+ * TODO : comment
+ *
+ *
+ */
+void C2F(s_mpi_irecv)(const int * const source,  /* INPUT */
+                const int * const tag,     /* INPUT */
+                const int * const comm,    /* INPUT */
+                int *request, int *res);    /* OUTPUT */
diff --git a/scilab/modules/mpi/src/c/s_mpi_isend.c b/scilab/modules/mpi/src/c/s_mpi_isend.c
new file mode 100644 (file)
index 0000000..98c7ef8
--- /dev/null
@@ -0,0 +1,113 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include "sci_mpi.h"
+#include "s_mpi_isend.h"
+#include "build_buff_type.h"
+
+void  C2F(s_mpi_isend)(int *pack, int *n,
+                double *buff,
+                int *dest,
+                int *tag,
+                int *comm,
+                int *request,
+                int *res)
+{
+  int errcode, errclass;       /* Error mgmt */
+  char error_msg[MPI_MAX_ERROR_STRING];
+  int error_msg_length;
+  int entry = 0;
+  MPI_Datatype buff_type;
+  int l;                       /* size of the buff to send in bytes */
+
+                               /* Try to locate an entry in the
+                                  tab_req array */
+
+  *request = -1;
+  if (*n >= SCI_MPI_MAX_PACKING_VECT_SIZE){
+    (void) fprintf(stderr, "Error in mpi_isend: packing vector is too large\n");
+    (void) fflush(stderr);
+    *res = MPI_ERR_OTHER;
+    return;
+  }
+
+  while ((entry < SCI_MPI_MAX_PENDING_REQUESTS) &&
+        (tab_req[entry].ptr_header != NULL) &&
+        (tab_req[entry].ptr_body != NULL)) {
+    entry++;
+  }
+  if (entry == SCI_MPI_MAX_PENDING_REQUESTS){
+    (void) fprintf(stderr, "Error in mpi_isend: Too much pending requests\n");
+    (void) fflush(stderr);
+    *res = MPI_ERR_OTHER;
+    return;
+  }
+
+  errcode = build_buff_type(*n, pack, &buff_type, &l);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error in mpi_isend -build_buff_type-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  errcode = MPI_Type_commit(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Type_commit-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+                               /* Send the packing */
+  
+  errcode = MPI_Isend(pack, *n, MPI_INT, *dest, *tag, MPI_COMM_WORLD, 
+                     &tab_req[entry].req_header);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_ISend-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+                               /* Send the data... */
+  errcode = MPI_Isend(buff, 1, buff_type, *dest, *tag, MPI_COMM_WORLD, 
+                     &tab_req[entry].req_body);  
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_ISend-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+                               /* If ptr_header == &ptr_header the
+                                  entry is no free *** BUT *** you do 
+                               not have to free this ptr!!! just
+                               set them to the NULL value.*/
+  tab_req[entry].ptr_header = &tab_req[entry].ptr_header;
+  tab_req[entry].ptr_body =  &tab_req[entry].ptr_body;
+  
+  errcode = MPI_Type_free(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_isend -MPI_Type_free-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *request = entry;
+    *res = errcode;
+    return;
+  }
+
+  *request = entry;
+  *res = MPI_SUCCESS;
+} /* scimpiisend */
diff --git a/scilab/modules/mpi/src/c/s_mpi_isend.h b/scilab/modules/mpi/src/c/s_mpi_isend.h
new file mode 100644 (file)
index 0000000..dde11a4
--- /dev/null
@@ -0,0 +1,14 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include <stdio.h>
+
+void 
+C2F(s_mpi_isend)(int *pack, int *n,
+                double *buff,
+                int *dest,
+                int *tag,
+                int *comm,
+                int *request,
+                                  int *res);
diff --git a/scilab/modules/mpi/src/c/s_mpi_recv.c b/scilab/modules/mpi/src/c/s_mpi_recv.c
new file mode 100644 (file)
index 0000000..3d0585d
--- /dev/null
@@ -0,0 +1,195 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include "sci_mpi.h"
+#include "s_mpi_recv.h"
+
+
+void C2F(s_mpi_recv)(double * const beginvar,   /* I/O */
+               const int * const maxsize, /* INPUT */
+               int * const size,          /* OUTPUT */
+               const int * const source,  /* INPUT */
+               const int * const tag,     /* INPUT */
+               const int * const comm,    /* INPUT */
+               int stat[2], int *res)   /* OUTPUT */
+{
+  int errcode, errclass;       /* Error mgmt */
+  char error_msg[MPI_MAX_ERROR_STRING];
+  int error_msg_length;
+  MPI_Status status;
+  MPI_Datatype buff_type;
+
+  int n;                       /* size of the pack vector */
+  int *pack;                   /* the pack vector */
+  int l;                       /* size of the buff in bytes */
+
+#ifdef DEBUG
+  if (debuglevel >= 5) {
+    (void) fprintf(stderr, "MPI_RECV: |%f:%d|%d:%d:%d|\n", 
+                  beginvar[0], *maxsize, *source, *tag, *comm);        
+    (void) fflush (stderr);    
+  }    
+#endif /* DEBUG */
+
+  *size = 2;
+  if (*size <= *maxsize){              /* on retourne en cas d erreur une
+                                          matrice de taille vide */
+    int *ptr_int = (int*)beginvar;
+    
+    ptr_int[0] = 1;    /* scalar type */
+    ptr_int[1] = 0;    /* m */
+    ptr_int[2] = 0;    /* n */
+    ptr_int[3] = 0;    /* real */
+  } 
+  else {
+    (void) fprintf(stderr, "Error in mpi_recv: Not enough memory: available=%d:needed=%d\n", *maxsize, *size);
+    (void) fflush(stderr);
+    *res = MPI_ERR_OTHER;
+    return;
+  }
+  (void) fprintf(stderr, "Error ICI 1 \n");
+    (void) fflush(stderr);
+       // BUG ICI, VOIR PK CA MERDE LA ?
+       errcode = MPI_Probe(*source, *tag, MPI_COMM_WORLD, &status);
+  (void) fprintf(stderr, "Error ICI 2 \n");
+    (void) fflush(stderr);
+
+  if (errcode != MPI_SUCCESS){
+  (void) fprintf(stderr, "Error ICI 3 \n");
+    (void) fflush(stderr);
+
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_recv -MPI_Probe-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  (void) fprintf(stderr, "Error ICI 4 \n");
+    (void) fflush(stderr);
+
+  errcode = MPI_Get_count(&status, MPI_INT, &n);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_recv -MPI_Get_count-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int i;
+    (void) fprintf(stderr, "MPI_RECV: %d\n", n);       
+    (void) fflush(stderr);     
+  }    
+#endif /* DEBUG */  
+  if ((pack = (int *) malloc(n * sizeof(int))) == NULL){
+    (void) fprintf(stderr, "Error malloc in mpi_recv\n");
+    (void) fflush(stderr);
+    *res = MPI_ERR_OTHER;
+    return; 
+  }
+  (void) fprintf(stderr, "Error ICI 5 \n");
+    (void) fflush(stderr);
+
+  errcode = MPI_Recv(pack, n, MPI_INT, *source, *tag, 
+                    MPI_COMM_WORLD, &status);
+  (void) fprintf(stderr, "Error ICI 6 \n");
+    (void) fflush(stderr);
+
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_recv -MPI_Recv-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    free(pack);
+    return;
+  }
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int i;
+    (void) fprintf(stderr, "MPI_RECV: ");      
+    for (i = 0; i < n; ++i) {
+      (void) fprintf(stderr, "%d:", 
+                    pack[i]);
+    }
+    (void) fprintf(stderr, "\n");
+    (void) fflush(stderr);     
+  }    
+#endif /* DEBUG */  
+  errcode = build_buff_type(n, pack, &buff_type, &l);
+  free(pack);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_recv -build_buff_type-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  if ((l/sizeof(double)) > *maxsize){ 
+    (void) fprintf(stderr, "Error in mpi_recv: Not enough memory: available=%d:needed=%d\n", *maxsize, *size);
+    (void) fflush(stderr);
+    *res = MPI_ERR_OTHER;
+    return;
+  }
+
+  errcode = MPI_Type_commit(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Type_commit-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  
+  errcode = MPI_Recv(beginvar, 1, buff_type, *source, *tag,
+                    MPI_COMM_WORLD, &status);
+  stat[0] = status.MPI_SOURCE;
+  stat[1] = status.MPI_TAG;
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_recv -MPI_Recv-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+#ifdef DEBUG
+  if (debuglevel >= 10) {
+    int i;
+    char *ptr = (char*) beginvar;
+    (void) fprintf(stderr, "SEND:");   
+    for (i = 0; i < l; ++i) {
+      (void) fprintf(stderr, "%d:", ptr[i]);
+    }
+    (void) fprintf(stderr, "\n");      
+    (void) fflush (stderr);    
+  }    
+#endif /* DEBUG */
+
+
+  errcode = MPI_Type_free(&buff_type);
+  if (errcode != MPI_SUCCESS){
+    MPI_Error_string(errcode, error_msg, &error_msg_length);
+    MPI_Error_class(errcode, &errclass);
+    (void) fprintf(stderr, "Error mpi_send -MPI_Type_free-: %d:%s\n", 
+                  errclass, error_msg);
+    (void) fflush(stderr);
+    *res = errcode;
+    return;
+  }
+  *size = l/sizeof(double);    
+  *res = errcode;
+} 
diff --git a/scilab/modules/mpi/src/c/s_mpi_recv.h b/scilab/modules/mpi/src/c/s_mpi_recv.h
new file mode 100644 (file)
index 0000000..29116df
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "build_buff_type.h"
+/**
+ * TODO : comment
+ *
+ *
+ */
+void C2F(s_mpi_recv)(double * const beginvar,   /* I/O */
+               const int * const maxsize, /* INPUT */
+               int * const size,          /* OUTPUT */
+               const int * const source,  /* INPUT */
+               const int * const tag,     /* INPUT */
+               const int * const comm,    /* INPUT */
+               int stat[2], int *res);   /* OUTPUT */
diff --git a/scilab/modules/mpi/src/c/s_mpi_send.c b/scilab/modules/mpi/src/c/s_mpi_send.c
new file mode 100644 (file)
index 0000000..f08d807
--- /dev/null
@@ -0,0 +1,113 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include "sci_mpi.h"
+#include "s_mpi_send.h"
+#include "build_buff_type.h"
+
+void C2F(s_mpi_send)(int *pack, int *n, double *buff, int *dest, int *tag, int *comm, int *res){
+       int errcode, errclass;  /* Error mgmt */
+       char error_msg[MPI_MAX_ERROR_STRING];
+       int error_msg_length;
+       int l;                  /* size of the buff to send in bytes */
+  
+       MPI_Datatype buff_type;
+
+       MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+#ifdef DEBUG
+       if (debuglevel >= 5) {    
+               int *ptr_int = (int *)buff;
+               (void) fprintf(stderr, "MPI_SEND: n : %d\ndest :%d\ntag : %d\ncomm : %d^npack[0] %d\npack[1] %d\nptr_int[0] %d\nptr_int[1] %d\nptr_int[2] %d\nptr_int[3] %d\nbuff[2] %f\nbuff[3] %f\n", 
+                                          *n, *dest, *tag, *comm, 
+                                          pack[0], pack[1], 
+                                          ptr_int[0],ptr_int[1],
+                                          ptr_int[2],ptr_int[3],
+                                          buff[2],buff[3]);
+               (void) fflush (stderr); 
+       }
+#endif /* DEBUG */
+
+#ifdef DEBUG
+       if (debuglevel >= 10) {
+               int i;
+               (void) fprintf(stderr, "MPI_SEND: %d|", *n);    
+               for (i = 0; i < *n; ++i) {
+                       (void) fprintf(stderr, "%d:", 
+                                                  pack[i]);
+               }
+               (void) fprintf(stderr, "\n");
+               (void) fflush(stderr);  
+       }       
+#endif /* DEBUG */
+  
+       errcode = build_buff_type(*n, pack, &buff_type, &l);
+       if (errcode != MPI_SUCCESS){
+               MPI_Error_string(errcode, error_msg, &error_msg_length);
+               MPI_Error_class(errcode, &errclass);
+               (void) fprintf(stderr, "Error mpi_send -build_buff_type-: %d:%s\n", 
+                                          errclass, error_msg);
+               (void) fflush(stderr);
+               *res = errcode;
+               return;
+       }
+       errcode = MPI_Type_commit(&buff_type);
+       if (errcode != MPI_SUCCESS){
+               MPI_Error_string(errcode, error_msg, &error_msg_length);
+               MPI_Error_class(errcode, &errclass);
+               (void) fprintf(stderr, "Error mpi_send -MPI_Type_commit-: %d:%s\n", 
+                                          errclass, error_msg);
+               (void) fflush(stderr);
+               *res = errcode;
+               return;
+       }
+    
+       /* Send the packing vector. The recv
+          part must make a call to probe
+          firts to have its size. */
+       errcode = MPI_Send(pack, *n, MPI_INT, *dest, *tag, MPI_COMM_WORLD);  
+       if (errcode != MPI_SUCCESS){
+               MPI_Error_string(errcode, error_msg, &error_msg_length);
+               MPI_Error_class(errcode, &errclass);
+               (void) fprintf(stderr, "Error mpi_send -MPI_Send-: %d:%s\n", 
+                                          errclass, error_msg);
+               (void) fflush(stderr);
+               *res = errcode;
+               return;
+       }
+       /* Send the data... */
+       errcode = MPI_Send(buff, 1, buff_type, *dest, *tag, MPI_COMM_WORLD);  
+       if (errcode != MPI_SUCCESS){
+               MPI_Error_string(errcode, error_msg, &error_msg_length);
+               MPI_Error_class(errcode, &errclass);
+               (void) fprintf(stderr, "Error mpi_send -MPI_Send-: %d:%s\n", 
+                                          errclass, error_msg);
+               (void) fflush(stderr);
+               *res = errcode;
+               return;
+       }
+  
+#ifdef DEBUG
+       if (debuglevel >= 10) {
+               int i;
+               char *ptr = (char*) buff;
+               (void) fprintf(stderr, "SEND:");        
+               for (i = 0; i < l; ++i) {
+                       (void) fprintf(stderr, "%d:",ptr[i]);
+               }
+               (void) fprintf(stderr, "\n");   
+               (void) fflush (stderr); 
+       }       
+#endif /* DEBUG */
+       errcode = MPI_Type_free(&buff_type);
+       if (errcode != MPI_SUCCESS){
+               MPI_Error_string(errcode, error_msg, &error_msg_length);
+               MPI_Error_class(errcode, &errclass);
+               (void) fprintf(stderr, "Error mpi_send -MPI_Type_free-: %d:%s\n", 
+                                          errclass, error_msg);
+               (void) fflush(stderr);
+               *res = errcode;
+               return;
+       }
+       *res = MPI_SUCCESS;
+} 
diff --git a/scilab/modules/mpi/src/c/s_mpi_send.h b/scilab/modules/mpi/src/c/s_mpi_send.h
new file mode 100644 (file)
index 0000000..d9dff62
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * @author INRIA Lorraine - 1999
+ * @author Sylvestre LEDRU <sylvestre.ledru@inria.fr> INRIA Rocquencourt - 2007
+ */
+#include <stdio.h>
+
+
+void C2F(s_mpi_send)(int *pack, int *n,
+               double *buff,
+               int *dest,
+               int *tag,
+               int *comm,
+                                        int *res);
diff --git a/scilab/modules/mpi/src/c/sci_mpi.h b/scilab/modules/mpi/src/c/sci_mpi.h
new file mode 100644 (file)
index 0000000..80937e5
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright (c) 1999 by Inria Lorraine.  All Rights Reserved */
+
+/***
+       NAME 
+       MPI feature into Scilab
+   PURPOSE
+     provide point-to-point communication between MPI process.
+   NOTES
+
+   HISTORY
+     fleury - Mar 12, 1999: Created.
+     $Log: mpi_pp.c,v $
+     Revision 1.3  1999/10/19 06:42:32  fleury
+     Mise a jour de l archive du LORIA.
+     WARNING: modif de type inconnue....
+
+     Revision 1.2  1999/03/19 18:01:02  fleury
+     Send & Recv OK.
+     TODO: finalize.
+     TODO: prendre en compte les communicators
+     TODO: prendre en compte les status
+     TODO: error handler in MPI.
+     TODO: test sur #ex.
+     TODO: mpi_mp.c (-;
+
+     Revision 1.1  1999/03/19 11:07:51  fleury
+     Ajout de l interface MPI.
+     ceci est un premier ajout qui marche
+     TODO: pouvoir lancer des scilex avec/sans fenetre
+     TODO: gérer les Communicators
+
+***/
+
+#ifndef __SCIMPI
+#define __SCIMPI
+#include <stdlib.h>
+#include <mpi.h>
+//#include "mpi/mpi.h"
+#include "machine.h"
+
+#define SCI_MPI_MAX_COMMUNICATORS    256
+#define SCI_MPI_MAX_PENDING_REQUESTS 256
+#define SCI_MPI_MAX_PACKING_VECT_SIZE 1024
+
+typedef struct pending_req {
+  MPI_Request req_header;
+  MPI_Request req_body;
+  void* ptr_header;
+  void* ptr_body;
+} Pending_Req;
+
+extern int packing_vect[SCI_MPI_MAX_PACKING_VECT_SIZE];
+
+
+MPI_Comm tab_comm[SCI_MPI_MAX_COMMUNICATORS];
+//int current_comm = 0;
+
+Pending_Req tab_req[SCI_MPI_MAX_PENDING_REQUESTS];
+//int current_req = 0;
+
+#define debuglevel 10
+
+#endif /* __SCIMPI */
diff --git a/scilab/modules/mpi/src/c/testPDGEMM-MPI.c b/scilab/modules/mpi/src/c/testPDGEMM-MPI.c
new file mode 100644 (file)
index 0000000..9fddcbf
--- /dev/null
@@ -0,0 +1,87 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#define MMAX 1408
+
+double dclock()
+{
+   double time;
+   struct timeval t;
+
+   gettimeofday(&t,NULL);
+   time = (double)t.tv_sec + 1.0e-6*(double)t.tv_usec;
+   return(time);
+
+}
+
+void main(int argc, char*argv[]){
+  int
+M1,M2,M11,M21,R,MYPROW1,MYPCOL1,CTXT1,MYID,ICTXT,CTXT2,MYPROW2,MYPCOL2;
+  int MYPROW,MYPCOL,NPROW,NPCOL1,NPROW1,NPCOL2,NPROW2,NPCOL,INFO,NBP,
+I,J,k;
+  double tim1,tim2,timtot;
+  int twoone,onetwo;
+  int M,DEM;
+  double *A,*B,*C,*T,*T1,*T2;
+  double alpha=1.0,beta=0.0;
+  int DESCC1[9],DESCC2[9],DESCIC[9];
+  FILE *str, *dge,*win;
+
+  int zero=0,UN=1,TWO=2,FOUR=4;
+  char Ori='r',All='A',No='n';
+
+  NBP=4;
+  NPROW1=2;
+  NPCOL1=2;
+  NPROW2=2;
+  NPCOL2=2;
+  NPCOL=4;
+  CTXT1=-1;
+  CTXT2=-1;
+
+
+  blacs_pinfo_(&MYID, &NBP);
+  blacs_get_(&zero, &zero, &ICTXT);
+  blacs_gridinit_(&ICTXT,&Ori,&TWO,&TWO);
+  blacs_gridinfo_(&ICTXT,&NPROW,&NPCOL,&MYPROW,&MYPCOL);
+
+  A=(double*)malloc(MMAX*MMAX*sizeof(double)/4);
+  B=(double*)malloc(MMAX*MMAX*sizeof(double)/4);
+  C=(double*)malloc(MMAX*MMAX*sizeof(double)/4);
+/*   for (M=128;M<MMAX+1;M+=128) */
+/*     { */
+  M=MMAX;
+  DEM=M/2;
+  R=M/4;
+  descset_(&DESCC1,&M,&M,&R,&R,&zero,&zero,&ICTXT,&DEM);
+  blacs_barrier_(&ICTXT, &All);
+
+  for(J=0;J<DEM;J++)
+    for (I=0;I<DEM;I++)
+      {
+        A[I+(DEM*J)]=MYID+0.0;
+        B[I+(DEM*J)]=MYID+1.0;
+      }
+  blacs_barrier_(&ICTXT, &All);
+  /* **************** DEBUT DE PDGEMM ************* */
+  tim2=0.0;
+  for (k=0;k<10;k++)
+    {
+      tim1=dclock();
+
+pdgemm_(&No,&No,&M,&M,&M,&alpha,A,&UN,&UN,DESCC1,B,&UN,&UN,DESCC1,&beta,C,
+
+&UN,&UN,DESCC1);
+      tim1=dclock()-tim1;
+      blacs_barrier_(&ICTXT, &All);
+      tim2+=tim1;
+    }
+  if (MYID==0)
+    {
+      /*          fprintf(dge,"%d %lf\n",M,tim2/k); */
+      printf("dge, %d %lf\n",M,tim2/k);
+    }
+  /* **************** FIN DE PDGEMM ************* */
+  /*    }  */
+}
diff --git a/scilab/modules/mpi/src/fortran/intmpi.f b/scilab/modules/mpi/src/fortran/intmpi.f
new file mode 100644 (file)
index 0000000..3d9ba84
--- /dev/null
@@ -0,0 +1,46 @@
+c     $Log: INTMPI.f,v $
+c     Revision 1.4  1999/09/14 12:41:13  fleury
+c     Mise a jour pour la version de scilabp
+c      - macro de blacs_init: permet de demarrer une grille blacs a partir
+c     de la console scilex
+c      - script de demarage de scilabp: initialise les blacs et se met en
+c     mode recv/exec
+c
+c     Modif ds pvm
+c      - pvm_start prend en argument un fichier de config pvm
+c
+c     Modif des conversion de complexe
+c
+c     Modif des blacs
+c      - suppression des _ ds le nom des funct car ca fout la merde sous gcc
+c
+c     Modif ds l interface MPI
+c      - TODO: a reprendre pour le nom des function et pour le lancement des
+c     prg
+c
+
+c  interface function 
+c   ********************
+       subroutine intmpi
+       include 'stack.h'
+       rhs = max(0,rhs)
+c
+       goto (1,2,3,4,5,6,7,8) fin
+       return
+1      call intsmpi_send('mpi_send')
+       return
+2      call intsmpi_recv('mpi_recv')
+       return
+3      call intsmpi_isend('mpi_isend')
+       return
+4      call intsmpi_irecv('mpi_irecv')
+       return
+5      call intsmpi_init('mpi_init')
+       return
+6      call intsmpi_finalize('mpi_finalize')
+       return
+7      call intsmpi_comm_rank('mpi_comm_rank')
+       return
+8      call intsmpi_comm_size('mpi_comm_size')
+       return
+       end
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_comm_rank.f b/scilab/modules/mpi/src/fortran/intsmpi_comm_rank.f
new file mode 100644 (file)
index 0000000..a4e9851
--- /dev/null
@@ -0,0 +1,66 @@
+c SCILAB function : mpi_comm_rank, fin = 7
+       subroutine intsmpi_comm_rank(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       logical checkrhs,checklhs,cremat,getscalar
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,0,1)) return
+       if(.not.checklhs(fname,1,2)) return
+c       checking variable comm (number 1)
+c       
+       if(rhs .le. 0) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr1,lc1)) return
+        stk(lr1)= 0
+       endif
+       if(.not.getscalar(fname,top,top-rhs+1,lr1)) return
+c     
+c       cross variable size checking
+c     
+       call entier(1,stk(lr1),istk(iadr(lr1)))
+       if(.not.cremat(fname,top+1,0,1,1,lw2,loc2)) return
+       if(.not.cremat(fname,top+2,0,1,1,lw3,loc3)) return
+       call MPI_COMM_RANK(istk(iadr(lr1)),stk(lw2),stk(lw3))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+2
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: myid
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw2)),-1,stk(lrs),-1)
+       endif
+c     
+       if(lhs .ge. 2) then
+c       --------------output variable: res
+        top=topl+2
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw3)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       if(lhs .ge. 2) then
+        call copyobj(fname,topl+2,topk+2)
+       endif
+       top=topk+lhs
+       return
+       end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_comm_size.f b/scilab/modules/mpi/src/fortran/intsmpi_comm_size.f
new file mode 100644 (file)
index 0000000..4a8756b
--- /dev/null
@@ -0,0 +1,66 @@
+c SCILAB function : mpi_comm_size, fin = 8
+       subroutine intsmpi_comm_size(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       logical checkrhs,checklhs,cremat,getscalar
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,0,1)) return
+       if(.not.checklhs(fname,1,2)) return
+c       checking variable comm (number 1)
+c       
+       if(rhs .le. 0) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr1,lc1)) return
+        stk(lr1)= 0
+       endif
+       if(.not.getscalar(fname,top,top-rhs+1,lr1)) return
+c     
+c       cross variable size checking
+c     
+       call entier(1,stk(lr1),istk(iadr(lr1)))
+       if(.not.cremat(fname,top+1,0,1,1,lw2,loc2)) return
+       if(.not.cremat(fname,top+2,0,1,1,lw3,loc3)) return
+       call MPI_COMM_SIZE(istk(iadr(lr1)),stk(lw2),stk(lw3))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+2
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: numprocs
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw2)),-1,stk(lrs),-1)
+       endif
+c     
+       if(lhs .ge. 2) then
+c       --------------output variable: res
+        top=topl+2
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw3)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       if(lhs .ge. 2) then
+        call copyobj(fname,topl+2,topk+2)
+       endif
+       top=topk+lhs
+       return
+       end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_finalize.f b/scilab/modules/mpi/src/fortran/intsmpi_finalize.f
new file mode 100644 (file)
index 0000000..2157e7f
--- /dev/null
@@ -0,0 +1,45 @@
+c SCILAB function : mpi_finalize, fin = 6
+       subroutine intsmpi_finalize(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       logical checkrhs,checklhs,cremat
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,0,0)) return
+       if(.not.checklhs(fname,1,1)) return
+c     
+c       cross variable size checking
+c     
+       if(.not.cremat(fname,top+1,0,1,1,lw1,loc1)) return
+       call MPI_FINALIZE(stk(lw1))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+1
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: res
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw1)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       top=topk+lhs
+       return
+       end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_init.f b/scilab/modules/mpi/src/fortran/intsmpi_init.f
new file mode 100644 (file)
index 0000000..73b82c8
--- /dev/null
@@ -0,0 +1,46 @@
+
+c SCILAB function : mpi_init, fin = 5
+       subroutine intsmpi_init(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       logical checkrhs,checklhs,cremat
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,0,0)) return
+       if(.not.checklhs(fname,1,1)) return
+c     
+c       cross variable size checking
+c     
+       if(.not.cremat(fname,top+1,0,1,1,lw1,loc1)) return
+       call MPI_INIT(stk(lw1))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+1
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: res
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw1)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       top=topk+lhs
+       return
+       end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_irecv.f b/scilab/modules/mpi/src/fortran/intsmpi_irecv.f
new file mode 100644 (file)
index 0000000..8fdcaa3
--- /dev/null
@@ -0,0 +1,74 @@
+c SCILAB function : mpi_irecv, fin = 4
+       subroutine intsmpi_irecv(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       logical checkrhs,checklhs,getscalar,cremat
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,2,3)) return
+       if(.not.checklhs(fname,1,2)) return
+c       checking variable source (number 1)
+c       
+       if(.not.getscalar(fname,top,top-rhs+1,lr1)) return
+c       checking variable tag (number 2)
+c       
+       if(.not.getscalar(fname,top,top-rhs+2,lr2)) return
+c       checking variable comm (number 3)
+c       
+       if(rhs .le. 2) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr3,lc3)) return
+        stk(lr3)= MPI_COMM_WORLD
+       endif
+       if(.not.getscalar(fname,top,top-rhs+3,lr3)) return
+c     
+c       cross variable size checking
+c     
+       call entier(1,stk(lr1),istk(iadr(lr1)))
+       call entier(1,stk(lr2),istk(iadr(lr2)))
+       call entier(1,stk(lr3),istk(iadr(lr3)))
+       if(.not.cremat(fname,top+1,0,1,1,lw4,loc4)) return
+       if(.not.cremat(fname,top+2,0,1,1,lw5,loc5)) return
+       call scimpiirecv(istk(iadr(lr1)),istk(iadr(lr2)),istk(iadr(lr3)),
+     $ stk(lw4),stk(lw5))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+2
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: request
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw4)),-1,stk(lrs),-1)
+       endif
+c     
+       if(lhs .ge. 2) then
+c       --------------output variable: res
+        top=topl+2
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw5)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       if(lhs .ge. 2) then
+        call copyobj(fname,topl+2,topk+2)
+       endif
+       top=topk+lhs
+       return
+       end
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_isend.f b/scilab/modules/mpi/src/fortran/intsmpi_isend.f
new file mode 100644 (file)
index 0000000..e053634
--- /dev/null
@@ -0,0 +1,110 @@
+c SCILAB function : mpi_isend, fin = 3
+       subroutine intsmpi_isend(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       integer address, n
+       logical checkrhs,checklhs,getscalar,cremat
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,3,4)) return
+       if(.not.checklhs(fname,1,2)) return
+c       checking variable dest (number 2)
+c       
+       if(.not.getscalar(fname,top,top-rhs+2,lr2)) return
+c       checking variable tag (number 3)
+c       
+       if(.not.getscalar(fname,top,top-rhs+3,lr3)) return
+c       checking variable comm (number 4)
+c       
+       if(rhs .le. 3) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr4,lc4)) return
+        stk(lr4)= MPI_COMM_WORLD
+       endif
+       if(.not.getscalar(fname,top,top-rhs+4,lr4)) return
+c     construct the pack vector for the variable number 1
+c     set adress where to put the pack vector and its max
+c     allowable size
+       beginvar=lstk(top)
+       maxsize=lstk(bot) - beginvar
+       address = top-rhs+1
+c       write(*,*) 'call varpack'
+       call varpak(address,stk(beginvar),n,maxsize,ierr)
+c       write(*,*) 'callback varpack'
+       if(ierr .gt. 0) then 
+          buf = fname // ' Unknow type or not yet implemented' 
+          call error(999)
+          return
+       endif
+c
+c     Check if maxsize has been enough
+       if(n.gt.maxsize) then
+          err=n-maxsize
+          call error(17)
+          return
+       endif 
+c
+c     set correct size for the pack vect
+       lstk(top+1)=lstk(top)+n
+
+
+c     
+c       cross variable size checking
+c     
+       call entier(1,stk(lr2),istk(iadr(lr2)))
+       call entier(1,stk(lr3),istk(iadr(lr3)))
+c     WARNING: si on met la ligne en dessous, ce ECRASE la 5ieme case
+c       tableau varpack. 
+c     The question is WHY?????
+c       call entier(1,stk(lr4),istk(iadr(lr4)))
+       if(.not.cremat(fname,top+1,0,1,1,lw7,loc7)) return
+       if(.not.cremat(fname,top+2,0,1,1,lw8,loc8)) return
+       call scimpiisend(stk(beginvar),n,
+     $      stk(lstk(address)),
+     $      istk(iadr(lr2)),
+     $      istk(iadr(lr3)),
+     $      istk(iadr(lr4)),
+     $      stk(lw7),
+     $      stk(lw8))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+2
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: request
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw7)),-1,stk(lrs),-1)
+       endif
+c     
+       if(lhs .ge. 2) then
+c       --------------output variable: res
+        top=topl+2
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw8)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       if(lhs .ge. 2) then
+        call copyobj(fname,topl+2,topk+2)
+       endif
+       top=topk+lhs
+       return
+       end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_recv.f b/scilab/modules/mpi/src/fortran/intsmpi_recv.f
new file mode 100644 (file)
index 0000000..075f7df
--- /dev/null
@@ -0,0 +1,88 @@
+c SCILAB function : mpi_recv, fin = 2
+       subroutine intsmpi_recv(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c      
+       integer iadr, sadr
+       integer beginvar, maxsize, n
+       integer source, tag, comm, status(2), result
+       integer topk,rhsk
+       logical checkrhs,checklhs,getscalar,cremat
+c     
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,2,3)) return
+       if(.not.checklhs(fname,1,3)) return
+c     checking variable source (number 1)
+c       
+       if(.not.getscalar(fname,top,top-rhs+1,lr1)) return
+       source = stk(lr1)       
+c     checking variable tag (number 2)
+c       
+       if(.not.getscalar(fname,top,top-rhs+2,lr2)) return
+       tag = stk(lr2)
+c     checking variable comm (number 3)
+c       
+       if(rhs .le. 2) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr3,lc3)) return
+        stk(lr3)= MPI_COMM_WORLD
+       endif
+       if(.not.getscalar(fname,top,top-rhs+3,lr3)) return
+       comm = stk(lr3)
+c
+c     free input variable at the top of the stack
+       top=top-rhs+1
+c
+c     set adress where to put the received variable and its max
+c     allowable size
+       beginvar=lstk(top)
+       maxsize=lstk(bot)-beginvar
+c
+c     receive the variable
+       call scimpirecv(stk(beginvar), maxsize, n,
+     $      source, tag, comm, status, result)
+c     ATTENTION scimpirecv ne doit pas ecrire plus de maxsize double
+c     dans stk(beginvar)
+       if(err .gt. 0) then 
+          buf = fname // ' Internal Error' 
+          call error(999)
+          return
+       endif
+c
+c     Check if maxsize has been enough
+       if(n.gt.maxsize) then
+          err=n-maxsize
+          call error(17)
+          return
+       endif 
+c
+c     set correct size for the received variable
+       lstk(top+1)=lstk(top)+n
+c     MA MODIF: j'incremente top ici et non pas apres la creation de
+c     la variable de retour...
+       top=top+1
+c
+c     
+c     create variable status at the top of the returned variables
+      if(.not.cremat(fname,top,0,1,7,lrs,lcs)) return
+c     set value of the status variable
+      call int2db(2,status,-1,stk(lrs),-1)
+      top=top+1
+c     create variable status at the top of the returned variables
+      if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+c     set value of the status variable
+      stk(lrs)=result
+c     clear res & status variable if lhs result 1
+      if(lhs.eq.1) top=top-2
+c     clear res variable if lhs result 2
+      if(lhs.eq.2) top=top-1
+      return
+      end
+c
diff --git a/scilab/modules/mpi/src/fortran/intsmpi_send.f b/scilab/modules/mpi/src/fortran/intsmpi_send.f
new file mode 100644 (file)
index 0000000..92e4adb
--- /dev/null
@@ -0,0 +1,101 @@
+c SCILAB function : mpi_send, fin = 1
+       subroutine intsmpi_send(fname)
+c
+       character*(*) fname
+       include 'stack.h'
+c
+       integer iadr, sadr
+       integer topk,rhsk,topl
+       integer address,n,beginvar
+       logical checkrhs,checklhs,getscalar,cremat
+       iadr(l)=l+l-1
+       sadr(l)=(l/2)+1
+       rhs = max(0,rhs)
+c
+       topk = top 
+       rhsk = rhs 
+       if(.not.checkrhs(fname,3,4)) return
+       if(.not.checklhs(fname,1,1)) return
+c       checking variable buff (number 1)
+c       
+c       if(.not.getmat(fname,top,top-rhs+1,it1,m1,n1,lr1,lc1)) return
+c       checking variable dest (number 2)
+c       
+       if(.not.getscalar(fname,top,top-rhs+2,lr2)) return
+c       checking variable tag (number 3)
+c       
+       if(.not.getscalar(fname,top,top-rhs+3,lr3)) return
+c       checking variable comm (number 4)
+c       
+       if(rhs .le. 3) then
+        top = top+1
+        rhs = rhs+1
+        if(.not.cremat(fname,top,0,1,1,lr4,lc4)) return
+        stk(lr4)= MPI_COMM_WORLD
+       endif
+       if(.not.getscalar(fname,top,top-rhs+4,lr4)) return
+
+c     construct the pack vector for the variable number 1
+c     set adress where to put the pack vector and its max
+c     allowable size
+       beginvar=lstk(top)
+       maxsize=lstk(bot) - beginvar
+       address = top-rhs+1
+c       write(*,*) 'call varpack'
+       call varpak(address,stk(beginvar),n,maxsize,ierr)
+c       write(*,*) 'callback varpack'
+       if(ierr .gt. 0) then 
+          buf = fname // ' Unknow type or not yet implemented' 
+          call error(999)
+          return
+       endif
+c
+c     Check if maxsize has been enough
+      if(n.gt.maxsize) then
+         err=n-maxsize
+         call error(17)
+         return
+      endif 
+c
+c     set correct size for the pack vect
+      lstk(top+1)=lstk(top)+n
+
+
+c     
+c       cross variable size checking
+c     
+c       call entier(1,stk(lr2),istk(iadr(lr2)))
+c       call entier(1,stk(lr3),istk(iadr(lr3)))
+c     WARNING: si on met la ligne en dessous, ce ECRASE la 5ieme case
+c       tableau varpack. 
+c     The question is WHY?????
+c       call entier(1,stk(lr4),istk(iadr(lr4)))
+       if(.not.cremat(fname,top+1,0,1,1,lw7,loc7)) return
+       call scimpisend(stk(beginvar),n,
+     $      stk(lstk(address)),
+     $      istk(iadr(lr2)),
+     $      istk(iadr(lr3)),
+     $      istk(iadr(lr4)),
+     $      stk(lw7))
+       if(err .gt. 0) then 
+        buf = fname // ' Internal Error' 
+        call error(999)
+        return
+       endif
+c
+       topk=top-rhs
+       topl=top+1
+c     
+       if(lhs .ge. 1) then
+c       --------------output variable: res
+        top=topl+1
+        if(.not.cremat(fname,top,0,1,1,lrs,lcs)) return
+        call int2db(1*1,istk(iadr(lw7)),-1,stk(lrs),-1)
+       endif
+c     Putting in order the stack
+       if(lhs .ge. 1) then
+        call copyobj(fname,topl+1,topk+1)
+       endif
+       top=topk+lhs
+       return
+       end
diff --git a/scilab/modules/mpi/src/fortran/mpi_init.f b/scilab/modules/mpi/src/fortran/mpi_init.f
new file mode 100644 (file)
index 0000000..32366a6
--- /dev/null
@@ -0,0 +1,16 @@
+      subroutine scimpiinit(ierr)
+      include "mpif.h"
+      call MPI_INIT(ierr)
+      end
+
+
+      subroutine scimpicommrank(comm, myid, ierr)
+      include "mpif.h"
+      call MPI_COMM_RANK(comm, myid, ierr)
+      end
+
+
+      subroutine scimpicommsize(comm, numprocs, ierr)
+      include "mpif.h"
+      call MPI_COMM_SIZE(comm, numprocs, ierr)
+      end