[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet s.popinet at niwa.co.nz
Fri May 15 02:52:06 UTC 2009


The following commit has been merged in the upstream branch:
commit b1ef74c9b22e6553f369c7cab254138ef8b0dbd9
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Tue Jun 28 11:27:16 2005 +1000

    Removed obsolete MPI tests
    
    darcs-hash:20050628012716-fbd8f-7a2b56067fdbbde91fe23db49fdf1ab443ef7efb.gz

diff --git a/configure.in b/configure.in
index 3f7fb0b..47d6335 100644
--- a/configure.in
+++ b/configure.in
@@ -428,7 +428,6 @@ test/advection/Makefile
 test/advection/graphic/Makefile
 test/advection/order/Makefile
 test/euler/Makefile
-test/mpi/Makefile
 test/ocean/Makefile
 doc/Makefile
 doc/tutorial/Makefile
diff --git a/test/Makefile.am b/test/Makefile.am
index 84b1794..7dfdbc2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,3 +1,3 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = poisson advection euler mpi ocean
+SUBDIRS = poisson advection euler ocean
diff --git a/test/mpi/Makefile.am b/test/mpi/Makefile.am
deleted file mode 100644
index ab1fba9..0000000
--- a/test/mpi/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-INCLUDES = -I$(top_srcdir)/src -I$(includedir) -DG_LOG_DOMAIN=\"Gfs-test\"\
-            $(GTS_CFLAGS)
-LDADD = $(GFS2D_LIBS)
-AM_CFLAGS = -DFTT_2D=1
-
-EXTRA_DIST = match.c read.c test.dom stationary.sh stationary1.sh restart.sh \
-	stationary2.sh restartbox.sh
-
-if HAVE_MPI
-
-noinst_PROGRAMS = match read
-
-TESTS = match.sh read.sh restart.sh restartbox.sh \
-	stationary.sh stationary1.sh stationary2.sh
-else
-
-TESTS = restart.sh restartbox.sh stationary1.sh stationary2.sh
-
-endif
-
-match.sh:
-	@echo "#!/bin/sh" > match.sh
-	@echo "mpirun -np 2 ./match" >> match.sh
-	@chmod +x match.sh
-
-read.sh:
-	@echo "#!/bin/sh" > read.sh
-	@echo "mpirun -np 3 ./read test.dom" >> read.sh
-	@chmod +x read.sh
diff --git a/test/mpi/compare.sh b/test/mpi/compare.sh
deleted file mode 100755
index 39f2b4a..0000000
--- a/test/mpi/compare.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-# compares two files containing columns of numbers
-#
-# 1: file1
-# 2: file2
-# 3: relative tolerance
-
-max=`awk -v file=$2 '
-BEGIN {
-    max = 0.;
-}
-{
-    for (i = 1; i <= NF; i++)
-	val1[i] = $i;
-    getline < file
-    for (i = 1; i <= NF; i++) {
-	v1 = $i - val1[i];
-	v1 = v1 > 0. ? v1 : -v1;
-	v2 = ($i + val1[i])/2.;
-	v2 = v2 > 0. ? v2 : -v2;
-	if (v2 > 1e-9 && v1/v2 > max)
-	    max = v1/v2;
-    }
-}
-END {print max}' < $1`
-
-echo $max
-if test `expr $max "<=" $3` = 1; then
-    exit 1
-fi
-
diff --git a/test/mpi/match.c b/test/mpi/match.c
deleted file mode 100644
index b39b7ed..0000000
--- a/test/mpi/match.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Gerris - The GNU Flow Solver
- * Copyright (C) 2001 National Institute of Water and Atmospheric Research
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "config.h"
-#ifdef HAVE_GETOPT_H
-#  include <getopt.h>
-#endif /* HAVE_GETOPT_H */
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-#include "graphic.h"
-#include "domain.h"
-#ifdef HAVE_MPI
-#  include "mpi_boundary.h"
-#else  /* not HAVE_MPI */
-#  error "need MPI support for this program"
-#endif /* not HAVE_MPI */
-#include "init.h"
-
-#if 0
-static gboolean refine (FttCell * cell, guint * maxlevel)
-{
-  if (ftt_cell_level (cell) < *maxlevel)
-    return TRUE;
-  return FALSE;
-}
-#else
-static gboolean refine (FttCell * cell, guint * maxlevel)
-{
-  gdouble probability = 0.5;
-
-  if (ftt_cell_level (cell) < *maxlevel && 
-      (gdouble) rand () < probability*(gdouble) RAND_MAX)
-    return TRUE;
-  return FALSE;
-}
-#endif
-
-int main (int argc, char * argv[])
-{
-  GfsDomain * domain;
-  GfsBox * box;
-  GfsBoundaryMpi * bright, * bleft;
-  int rank, size;
-  guint maxlevel = 6;
-  FILE * fp;
-  char fname[80];
-
-  gfs_init (&argc, &argv);
-
-  atexit ((void (*)(void)) MPI_Finalize);
-  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
-  MPI_Comm_size (MPI_COMM_WORLD, &size);
-
-  if (size != 2) {
-    fprintf (stderr, "match: must be run with exactly 2 processes\n");
-    return 1;
-  }
-
-  domain = GFS_DOMAIN (gts_graph_new (GTS_GRAPH_CLASS (gfs_domain_class ()), 
-				     GTS_GNODE_CLASS (gfs_box_class ()),
-				     gts_gedge_class ()));
-  box = gfs_box_new (gfs_box_class ());
-  gts_container_add (GTS_CONTAINER (domain), GTS_CONTAINEE (box));
-
-  bright = gfs_boundary_mpi_new (gfs_boundary_mpi_class (), box,
-				FTT_RIGHT, rank == 0 ? 1 : 0, 0);
-  bleft = gfs_boundary_mpi_new (gfs_boundary_mpi_class (), box,
-			       FTT_LEFT, rank == 0 ? 1 : 0, 0);
-
-  maxlevel += rank;
-  ftt_cell_refine (box->root, (FttCellRefineFunc) refine, &maxlevel,
-		   (FttCellInitFunc) gfs_cell_init, NULL);
-
-  if (rank == 1) {
-    FttCellChildren child;
-
-    ftt_cell_children (box->root, &child);
-    ftt_cell_destroy (child.c[0], (FttCellCleanupFunc) gfs_cell_cleanup, NULL);
-    ftt_cell_destroy (child.c[1], (FttCellCleanupFunc) gfs_cell_cleanup, NULL);
-  }
-
-  gfs_domain_match (domain);
-  gfs_domain_bc (domain, FTT_TRAVERSE_LEAFS, -1, gfs_p);
-
-  sprintf (fname, "/tmp/match.%d", rank);
-  fp = fopen (fname, "wt");
-  gfs_draw_cells (box->root, FTT_TRAVERSE_LEAFS, -1, fp);
-  gfs_draw_cells (GFS_BOUNDARY (bright)->root, FTT_TRAVERSE_LEAFS, -1, fp);
-  gfs_draw_cells (GFS_BOUNDARY (bleft)->root, FTT_TRAVERSE_LEAFS, -1, fp);
-  fclose (fp);
-
-  return 0;
-}
diff --git a/test/mpi/read.c b/test/mpi/read.c
deleted file mode 100644
index 4e5ec9d..0000000
--- a/test/mpi/read.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Gerris - The GNU Flow Solver
- * Copyright (C) 2001 National Institute for Water and Atmospheric research
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include "config.h"
-#ifdef HAVE_GETOPT_H
-#  include <getopt.h>
-#endif /* HAVE_GETOPT_H */
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-#include "graphic.h"
-#include "domain.h"
-#include "init.h"
-#include "variable.h"
-
-#if 1
-static gboolean refine (FttCell * cell, guint * maxlevel)
-{
-  if (ftt_cell_level (cell) < *maxlevel)
-    return TRUE;
-  return FALSE;
-}
-#else
-static gboolean refine (FttCell * cell, guint * maxlevel)
-{
-  gdouble probability = 0.5;
-
-  if (ftt_cell_level (cell) < *maxlevel && 
-      (gdouble) rand () < probability*(gdouble) RAND_MAX)
-    return TRUE;
-  return FALSE;
-}
-#endif
-
-static void refine_all (GfsBox * box, guint * maxlevel)
-{
-  ftt_cell_refine (box->root, (FttCellRefineFunc) refine, maxlevel,
-		   (FttCellInitFunc) gfs_cell_init, NULL);
-}
-
-static void draw_cells (GfsBox * box, FILE * fp)
-{
-  FttDirection d;
-
-  gfs_draw_cells (box->root, FTT_TRAVERSE_LEAFS, -1, fp);
-  for (d = 0; d < FTT_NEIGHBORS; d++)
-    if (GFS_IS_BOUNDARY (box->neighbor[d]))
-      gfs_draw_cells (GFS_BOUNDARY (box->neighbor[d])->root, 
-		     FTT_TRAVERSE_LEAFS, -1, fp);
-}
-
-int main (int argc, char * argv[])
-{
-  GfsDomain * domain;
-  FILE * fptr;
-  GtsFile * fp;
-  char fname[80];
-  guint maxlevel = 2;
-  GtsRange range;
-  GfsNorm norm;
-  GfsVariable * c;
-
-  gfs_init (&argc, &argv);
-
-  if (argc != 2) {
-    fprintf (stderr, "usage: read FILE\n");
-    return 1;
-  }
-  fptr = fopen (argv[1], "rt");
-  if (fptr == NULL) {
-    fprintf (stderr, "read: unable to open file `%s'\n", argv[1]);
-    return 1;
-  }
-
-  fp = gts_file_new (fptr);
-  if ((domain = gfs_domain_read (fp)) == NULL) {
-    fprintf (stderr, "read: %s:%d:%d: %s\n",
-	     argv[1], fp->line, fp->pos, fp->error);
-    return 1;
-  }
-  gts_file_destroy (fp);
-  fclose (fptr);
-
-  maxlevel += domain->pid;
-  gts_container_foreach (GTS_CONTAINER (domain),
-			 (GtsFunc) refine_all, &maxlevel);
-  gfs_domain_match (domain);
-
-#if 0
-  sprintf (fname, "/tmp/read.%d", domain->pid);
-  fp = fopen (fname, "wt");
-  gts_container_foreach (GTS_CONTAINER (domain), (GtsFunc) draw_cells, fp);
-  //  gts_graph_write (GTS_GRAPH (domain), fp);
-  fclose (fp);
-#endif
-
-  c = gfs_variable_from_name (domain->variables, "C");
-  gfs_domain_bc (domain, FTT_TRAVERSE_LEAFS, -1, c);
-
-  range = gfs_domain_stats_variable (domain, c, FTT_TRAVERSE_LEAFS, -1);
-  norm = gfs_domain_norm_variable (domain, c, FTT_TRAVERSE_LEAFS, -1);
-
-  return 0;
-}
diff --git a/test/mpi/restart.sh b/test/mpi/restart.sh
deleted file mode 100755
index f15a30a..0000000
--- a/test/mpi/restart.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#! /bin/sh
-# Tests that a simulation can be correctly restarted from a saved 
-# simulation file
-
-modules=$HOME/adds/lib/gerris
-output=`mktemp /tmp/output.XXXXXX`
-sim=`mktemp /tmp/sim.XXXXXX`
-input=`mktemp /tmp/input.XXXXXX`
-cat > $input <<EOF
-1 2 FlDomain FlBox FlGEdge {} {
-  FlApproxProjectionParams {
-    tolerance = 1e-3
-    nrelax    = 4
-    minlevel  = 0
-    nitermax  = 100
-  }
-  FlProjectionParams {
-    tolerance = 1e-3
-    nrelax    = 4
-    minlevel  = 0
-    nitermax  = 100
-  }
-  FlTime { end = 0.2 }
-  FlRefine 6
-  GModule $modules/libperiodic_flow.so
-  FlInitNonStationary {}
-  FlOutputSimulation { start = 0.1 } $sim {}
-  FlOutputNonStationaryError { start = 0.1 step = 0.01 } stdout
-}
-FlBox {}
-1 1 0
-1 1 2
-EOF
-../../src/gerris $input > $output
-
-output_restart=`mktemp /tmp/output.XXXXXX`
-../../src/gerris $sim > $output_restart
-
-rm -f $input $sim
-
-if ./compare.sh $output_restart $output 0.1; then
-    rm -f $output $output_restart
-    exit 1
-fi
-rm -f $output $output_restart
-
diff --git a/test/mpi/restartbox.sh b/test/mpi/restartbox.sh
deleted file mode 100755
index 784baff..0000000
--- a/test/mpi/restartbox.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#! /bin/sh
-# Tests that a simulation can be correctly restarted from a saved 
-# simulation file (with a refined box inside)
-
-modules=$HOME/adds/lib/gerris
-output=`mktemp /tmp/output.XXXXXX`
-sim=`mktemp /tmp/sim.XXXXXX`
-input=`mktemp /tmp/input.XXXXXX`
-cat > $input <<EOF
-16 32 FlSimulation FlBox FlGEdge { rootlevel = 2 x = -0.375 y = -0.375 } {
-  FlTime { i = 0 t = 0 end = 0.2 }
-  FlAdvectionParams {
-  cfl      = 0.8
-  gradient = fl_center_gradient
-  flux     = fl_face_velocity_advection_flux
-}
-  FlTracerAdvectionParams {
-  cfl      = 0.8
-  gradient = fl_center_van_leer_gradient
-  flux     = fl_face_advection_flux
-}
-  FlApproxProjectionParams {
-  tolerance = 0.001
-  nrelax    = 4
-  minlevel  = 0
-  nitermax  = 100
-}
-  FlProjectionParams {
-  tolerance = 0.001
-  nrelax    = 4
-  minlevel  = 0
-  nitermax  = 100
-}
-  GModule $modules/libperiodic_flow.so
-  GModule $modules/libtesting.so
-  FlRefine 5
-  FlRefineBox 6
-  FlInitNonStationary { }
-  FlOutputSimulation { start = 0.1 } $sim { variables = P,C,U,V }
-  FlOutputNonStationaryError { start = 0.1 step = 0.01 } stdout
-}
-FlBox { id = 12 pid = 11 size = 256 } NULL NULL NULL NULL
-FlBox { id = 2 pid = 0 size = 256 } NULL NULL NULL NULL
-FlBox { id = 7 pid = 5 size = 256 } NULL NULL NULL NULL
-FlBox { id = 11 pid = 10 size = 64 } NULL NULL NULL NULL
-FlBox { id = 6 pid = 4 size = 64 } NULL NULL NULL NULL
-FlBox { id = 10 pid = 9 size = 64 } NULL NULL NULL NULL
-FlBox { id = 15 pid = 14 size = 256 } NULL NULL NULL NULL
-FlBox { id = 5 pid = 3 size = 64 } NULL NULL NULL NULL
-FlBox { id = 16 pid = 15 size = 64 } NULL NULL NULL NULL
-FlBox { id = 9 pid = 8 size = 64 } NULL NULL NULL NULL
-FlBox { id = 14 pid = 13 size = 64 } NULL NULL NULL NULL
-FlBox { id = 4 pid = 2 size = 64 } NULL NULL NULL NULL
-FlBox { id = 8 pid = 7 size = 64 } NULL NULL NULL NULL
-FlBox { id = 13 pid = 12 size = 64 } NULL NULL NULL NULL
-FlBox { id = 3 pid = 1 size = 64 } NULL NULL NULL NULL
-FlBox { id = 1 pid = 6 size = 64 } NULL NULL NULL NULL
-1 3 3
-4 1 0
-6 1 3
-7 1 1
-2 12 3
-2 15 0
-3 2 0
-7 2 3
-3 13 3
-5 3 0
-4 5 3
-10 4 3
-9 4 0
-5 16 3
-5 15 1
-6 13 2
-10 6 0
-14 6 1
-7 9 0
-14 7 3
-12 8 0
-15 8 3
-16 8 1
-11 8 2
-9 15 3
-11 9 3
-10 16 2
-11 10 0
-14 11 0
-13 12 0
-14 12 2
-16 13 0
-EOF
-../../src/gerris $input > $output
-
-output_restart=`mktemp /tmp/output.XXXXXX`
-../../src/gerris $sim > $output_restart
-
-rm -f $input $sim
-
-if ./compare.sh $output_restart $output 0.15; then
-    rm -f $output $output_restart
-    exit 1
-fi
-rm -f $output $output_restart
-
diff --git a/test/mpi/stationary.sh b/test/mpi/stationary.sh
deleted file mode 100755
index 86883df..0000000
--- a/test/mpi/stationary.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/sh
-#
-# Test MPI run with 4 process
-# 
-
-modules=$HOME/adds/lib/gerris
-
-input=`mktemp /tmp/input.XXXXXX`
-
-output=`mktemp /tmp/output.XXXXXX`
-cat > $input <<EOF
-1 2 FlDomain FlBox FlGEdge {} {
-  FlTime { end = 1.0 }
-  FlRefine 6
-  GModule $modules/libperiodic_flow.so
-  FlInitStationary {} 2
-  FlOutputStationaryError { step = 0.05 } stdout 2
-}
-FlBox {}
-1 1 0
-1 1 2
-EOF
-../../src/gerris $input > $output
-
-output_mpi=`mktemp /tmp/output.XXXXXX`
-cat > $input <<EOF
-4 8 FlDomain FlBox FlGEdge {} {
-  FlTime { end = 1.0 }
-  FlRefine 5
-  GModule $modules/libperiodic_flow.so
-  FlInitStationary {} 1
-  FlOutputStationaryError { step = 0.05 } stdout 1
-}
-FlBox {pid=0}
-FlBox {pid=1}
-FlBox {pid=2}
-FlBox {pid=3}
-1 2 0
-2 1 0
-4 3 0
-3 4 0
-1 4 2
-4 1 2
-2 3 2
-3 2 2
-EOF
-mpirun -np 4 ../../src/gerris $input > $output_mpi
-
-rm -f $input
-
-if ./compare.sh $output $output_mpi 1.; then
-    rm -f $output $output_mpi
-    exit 1
-fi
-rm -f $output $output_mpi
diff --git a/test/mpi/stationary1.sh b/test/mpi/stationary1.sh
deleted file mode 100755
index 447f28e..0000000
--- a/test/mpi/stationary1.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-#
-# Tests the fl_domain_split() function
-#
-
-modules=$HOME/adds/lib/gerris
-
-input=`mktemp /tmp/input.XXXXXX`
-
-output=`mktemp /tmp/output.XXXXXX`
-cat > $input <<EOF
-1 2 FlDomain FlBox FlGEdge {} {
-  FlTime { end = 1.0 }
-  FlRefine 6
-  GModule $modules/libperiodic_flow.so
-  FlInitStationary {} 2
-  FlOutputStationaryError { step = 0.05 } stdout 2
-}
-FlBox {}
-1 1 0
-1 1 2
-EOF
-../../src/gerris $input > $output
-
-input_split=`mktemp /tmp/input.XXXXXX`
-../../src/gerris -s 1 $input > $input_split
-output_split=`mktemp /tmp/output.XXXXXX`
-../../src/gerris $input_split > $output_split
-rm -f $input $input_slit
-
-if ./compare.sh $output $output_split 0.02; then
-    rm -f $output $output_split
-    exit 1
-fi
-rm -f $output $output_split
diff --git a/test/mpi/stationary2.sh b/test/mpi/stationary2.sh
deleted file mode 100755
index debdfe9..0000000
--- a/test/mpi/stationary2.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-#
-# Tests the fl_domain_split() function (2 splits)
-#
-
-modules=$HOME/adds/lib/gerris
-
-input=`mktemp /tmp/input.XXXXXX`
-
-output=`mktemp /tmp/output.XXXXXX`
-cat > $input <<EOF
-1 2 FlDomain FlBox FlGEdge {} {
-  FlTime { end = 1.0 }
-  FlRefine 6
-  GModule $modules/libperiodic_flow.so
-  FlInitStationary {} 2
-  FlOutputStationaryError { step = 0.05 } stdout 2
-}
-FlBox {}
-1 1 0
-1 1 2
-EOF
-../../src/gerris $input > $output
-
-input_split=`mktemp /tmp/input.XXXXXX`
-../../src/gerris -s 2 $input > $input_split
-output_split=`mktemp /tmp/output.XXXXXX`
-../../src/gerris $input_split > $output_split
-rm -f $input $input_slit
-
-if ./compare.sh $output $output_split 0.02; then
-    rm -f $output $output_split
-    exit 1
-fi
-rm -f $output $output_split
diff --git a/test/mpi/test.dom b/test/mpi/test.dom
deleted file mode 100644
index 560377e..0000000
--- a/test/mpi/test.dom
+++ /dev/null
@@ -1,14 +0,0 @@
-6 7 FlDomain FlBox FlGEdge {} {}
-FlBox {id=1 pid=0} NULL FlBoundaryInflow NULL NULL
-FlBox {id=2 pid=0} NULL NULL NULL NULL
-FlBox {id=3 pid=1} NULL NULL NULL NULL
-FlBox {id=4 pid=1} NULL NULL NULL NULL
-FlBox {id=5 pid=2} NULL NULL NULL NULL
-FlBox {id=6 pid=2} NULL NULL NULL NULL
-2 1 2
-2 3 0
-3 4 0
-5 4 3
-5 6 1
-1 6 0
-3 6 2

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list