From 1876077c6ea15e723a97fecfe65ab5fc88742012 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 25 Jun 2009 13:32:23 +0000 Subject: [PATCH] finish the first tesh file of SMPI example git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6359 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/smpi/Makefile.am | 14 ++++++++------ examples/smpi/bcast.tesh | 22 ++++++++++++++++++++-- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/examples/smpi/Makefile.am b/examples/smpi/Makefile.am index 45d03f48b2..63415a39d3 100644 --- a/examples/smpi/Makefile.am +++ b/examples/smpi/Makefile.am @@ -1,16 +1,18 @@ -# Copyright (c) 2004-2007. The SimGrid team. All right reserved. +# Copyright (c) 2004-2009. 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: +# HOW TO ADD A NEW EXAMPLE: +# # - add the binary name into the noinst_PROGRAMS variable # - add a rule to compile the program, inspired from the existing ones +# - add a tesh file running it in several conditions. +# Write the file taking the others as example, and after reading +# /tools/tesh/README.tesh +# - List the tesh file in the TESTS variable so that it gets tested on make check noinst_PROGRAMS = bcast bcbench compute compute2 compute3 first second mvmul ring_c split #reduce Not working yet (FIXME) @@ -39,7 +41,7 @@ mvmul: mvmul.c $(top_builddir)/src/smpi/smpicc $^ -o $@ # List the tesh files below -TESTS = +TESTS = bcast.tesh # No need to change anything after that line TESTS_ENVIRONMENT = $(top_builddir)/tools/tesh/tesh diff --git a/examples/smpi/bcast.tesh b/examples/smpi/bcast.tesh index 822b37a2c5..3584c6d8aa 100644 --- a/examples/smpi/bcast.tesh +++ b/examples/smpi/bcast.tesh @@ -1,8 +1,16 @@ +# define a variable for the command line since it's so long +# (since we use it only in rewriting in this file, defining it once is enough) +! setenv cmdline=../../src/smpi/smpirun -quiet -hostfile hostfile -platform ../msg/small_platform.xml + # use the tested library, not the installed one +# (since we want to pass it to the child, it has to be redefined before each command) ! setenv LD_LIBRARY_PATH=../../src/.libs -! setenv cmdline=../../src/smpi/smpirun -quiet -hostfile hostfile -platform ../msg/small_platform.xml -! output ignore +# Ignore the output since it contains timing information depending on the host speed +# (FIXME: add an option to SIMIX to not display this timing) +! output display + +# Go for the first test p Test Broadcast with less processes than hosts $ ${cmdline} -np 3 ./bcast > [rank 0] -> Tremblay @@ -16,8 +24,18 @@ $ ${cmdline} -np 3 ./bcast > node 2 has value 17 after broadcast > [0.000000] [smpi_kernel/INFO] simulation time 0.00343892 + + +# second test p Test Broadcast with as much processes than hosts +! output display +! setenv LD_LIBRARY_PATH=../../src/.libs $ ${cmdline} -np 6 ./bcast + + +# Another test p Test Broadcast with more processes than hosts +! output display +! setenv LD_LIBRARY_PATH=../../src/.libs $ ${cmdline} -np 12 ./bcast -- 2.20.1