examples/gras/pmm/Makefile
examples/gras/all2all/Makefile
examples/amok/Makefile
+ examples/smpi/Makefile
])
AC_CONFIG_FILES([
EXTRA_DIST= platforms/prop.xml \
platforms/metaxml.xml platforms/metaxml-random.xml
-SUBDIRS= msg gras amok simdag java
+SUBDIRS= msg gras amok simdag java smpi
include $(top_srcdir)/acmacro/dist-files.mk
--- /dev/null
+# Copyright (c) 2004-2007. The SimGrid team. All right reserved.
+
+# This file is part of the SimGrid project. This is free software:
+# You can redistribute and/or modify it under the terms of the
+# GNU LGPL (v2.1) licence.
+
+
+#INCLUDES = -I$(top_srcdir)/include
+#AM_CFLAGS = -g
+
+# For each test and/or example:
+# - add the binary name into the noinst_PROGRAMS variable
+# - add a rule to compile the program, inspired from the existing ones
+
+noinst_PROGRAMS = bcast bcbench compute compute2 compute3 first second mvmul ring_c split
+#reduce Not working yet (FIXME)
+
+bcast: bcast.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+bcbench: bcbench.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+compute: compute.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+compute2: compute2.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+compute3: compute3.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+first: mvmul.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+second: second.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+reduce: reduce.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+ring_c: ring_c.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+split: split.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+mvmul: mvmul.c
+ $(top_builddir)/src/smpi/smpicc $^ -o $@
+
+# List the tesh files below
+TESTS =
+
+# No need to change anything after that line
+TESTS_ENVIRONMENT = $(top_builddir)/tools/tesh/tesh
+EXTRA_DIST = $(TESTS)
+CLEANFILES = *~
+
+include $(top_srcdir)/acmacro/dist-files.mk
--- /dev/null
+#include <stdio.h>
+#include <mpi.h>
+
+#define INIT_VALUE 3
+#define TARGET_VALUE 42
+
+int main (int argc, char **argv) {
+ int size, rank;
+ int value = INIT_VALUE;
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ if (0 == rank) {
+ value = TARGET_VALUE;
+ }
+ fprintf(stderr,"node %d has value %d before broadcast\n", rank, value);
+ MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
+ fprintf(stderr,"node %d has value %d after broadcast\n", rank, value);
+ if (value != TARGET_VALUE) {
+ fprintf(stderr,"node %d don't have the target value after broadcast!!\n", rank);
+ exit(1);
+ }
+ MPI_Finalize();
+ return 0;
+}
--- /dev/null
+# use the tested library, not the installed one
+! setenv LD_LIBRARY_PATH=../../src/.libs
+! setenv cmdline=../../src/smpi/smpirun -quiet -hostfile hostfile -platform ../msg/small_platform.xml
+
+! output ignore
+p Test Broadcast with less processes than hosts
+$ ${cmdline} -np 3 ./bcast
+> [rank 0] -> Tremblay
+> [rank 1] -> Jupiter
+> [rank 2] -> Fafard
+> node 1 has value 3 before broadcast
+> node 0 has value 17 before broadcast
+> node 2 has value 3 before broadcast
+> node 1 has value 17 after broadcast
+> node 0 has value 17 after broadcast
+> node 2 has value 17 after broadcast
+> [0.000000] [smpi_kernel/INFO] simulation time 0.00343892
+
+p Test Broadcast with as much processes than hosts
+$ ${cmdline} -np 6 ./bcast
+
+p Test Broadcast with more processes than hosts
+$ ${cmdline} -np 12 ./bcast
--- /dev/null
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+
\ No newline at end of file
#define MPI_INT (smpi_mpi_global->mpi_int)
#define MPI_LAND (smpi_mpi_global->mpi_land)
-#define MPI_SUM (smpi_mpi_glboal->mpi_sum)
+#define MPI_SUM (smpi_mpi_global->mpi_sum)
// MPI macros
#define MPI_Init(a, b) SMPI_MPI_Init(a, b)
include/simix/simix.h include/simix/datatypes.h \
simix/private.h \
\
- smpi/private.h
+ smpi/private.h \
+ smpi/README
#LIBRARY_VERSION= 0:0:0
# | | |
+++ /dev/null
-#include <stdio.h>
-#include <mpi.h>
-
-int main (int argc, char **argv) {
- int size, rank;
- int value = 3;
- MPI_Init(&argc, &argv);
- MPI_Comm_size(MPI_COMM_WORLD, &size);
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- if (0 == rank) {
- value = 17;
- }
- printf("node %d has value %d\n", rank, value);
- MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
- printf("node %d has value %d\n", rank, value);
- MPI_Finalize();
- return 0;
-}
smpi_message_free, smpi_message_reset);
smpi_global->process_count = SIMIX_process_count();
- fprintf(stderr,"There is %d processes\n",smpi_global->process_count);
+ DEBUG1("There is %d processes",smpi_global->process_count);
// sender/receiver processes
smpi_global->main_processes = xbt_new(smx_process_t, smpi_global->process_count);
xbt_fifo_free(actions_failed);
xbt_fifo_free(actions_done);
- INFO1("simulation time %g", SIMIX_get_clock());
-
smpi_global_destroy();
+ INFO1("simulation time %g", SIMIX_get_clock());
+
SIMIX_clean();
return 0;
#include "xbt/asserts.h"
#define sleep(x) smpi_sleep(x)
#define gettimeofday(x, y) smpi_gettimeofday(x, y)
+int smpi_run_simulation(int *argc, char **argv);
HEADER
# very simplistic transform, will probably want full parser for next version
grep -v "mpi.h" < ${SOURCE} | perl -pe 's/main/smpi_simulated_main/;' >> ${TMPSOURCE}
fi
}
-INCLUDEARGS=""
-LINKARGS="-L@libdir@ -lsimgrid -lsmpi "
+INCLUDEARGS="-I @top_srcdir@/include "
+LINKARGS="-L@top_builddir@/src/.libs -L@libdir@ -lsimgrid -lsmpi "
CMDLINE=""
while [ -n "$1" ]; do
LINKARGS=""
CMDLINE="${CMDLINE} -c "
elif [ "${ARG%.c}" != "${ARG}" ]; then
- INCLUDEARGS="-I . -I .. -I ../include -I @includedir@ "
+ INCLUDEARGS="${INCLUDEARGS} -I . -I .. -I ../include -I @includedir@ "
SRCFILE="$(realpath ${ARG})"
modsource ${SRCFILE}
CMDLINE="${CMDLINE} ${TMPDIR}${SRCFILE} "
fi
done
-CMDLINE="${CC} ${INCLUDEARGS} ${CMDLINE} ${LINKARGS}"
+CMDLINE="${CC} ${INCLUDEARGS} ${CFLAGS} ${CMDLINE} ${LINKARGS}"
-#echo "${CMDLINE}"
+echo "${CMDLINE}"
${CMDLINE}
-rm -rf ${TMPDIR}
+echo rm -rf ${TMPDIR}
shift 1
;;
+ "-quiet")
+ QUIET="true"
+ shift 1
+ ;;
+
"-help" | "--help" | "-h")
echo "usage:"
- echo "$0 [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
+ echo "$0 [-quiet] [-np <numprocs>] -platform <xmldesc> -hostfile <hostfile> [-map] program [program-options]"
echo "or (deprecated usage):"
- echo "$0 [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
+ echo "$0 [-quiet] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]"
echo
exit
;;
APPLICATIONFOOT
##-------------------------------- end DEFAULT APPLICATION --------------------------------------
-echo ${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
+if [ -z "${QUIET}" ] ; then
+ echo ${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
+fi
${EXEC} ${PLATFORMTMP} ${APPLICATIONTMP}
-echo "[$0] cleaning up temp files"
+if [ -z "${QUIET}" ] ; then
+ echo "[$0] cleaning up temp files"
+fi
if [ -z "${PLATFORM}" ]; then
rm ${PLATFORMTMP}
fi