[Debian-astro-commits] [gyoto] 01/01: Update mpirun calling sequence

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Tue Dec 6 14:48:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit 6f60fd0766f91a915fd3aa2b704b85bcc410562a
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Tue Dec 6 15:45:21 2016 +0100

    Update mpirun calling sequence
    
    Open MPI now requires use of a hostfile; refactor the test suite to
    use one.
---
 debian/tests/control                          |  2 +-
 debian/tests/gyoto                            | 23 ++++++++++++--
 debian/tests/gyoto-lorene                     | 34 ++++++++++++++++-----
 debian/tests/gyoto-lorene-mpi                 | 42 +++++++++++++++++++------
 debian/tests/gyoto-mpi                        | 31 +++++++++++++++++--
 debian/tests/python-gyoto                     | 25 ++++++++++++++-
 debian/tests/python-gyoto-mpi                 | 34 +++++++++++++++++++--
 debian/tests/yorick-gyoto                     | 40 +++++++++++-------------
 debian/tests/yorick-gyoto-mpi                 | 44 ++++++++++++++-------------
 debian/tests/{yorick-gyoto => yorick-gyoto.i} |  3 +-
 10 files changed, 206 insertions(+), 72 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index 2f0f2f1..4168af2 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -11,7 +11,7 @@ Tests: yorick-gyoto
 Depends: yorick-gyoto
 Restrictions: allow-stderr
 
-Test-Command: env OMPI_MCA_orte_rsh_agent=/bin/false orterun --mca btl_tcp_if_include lo /usr/bin/yorick -i debian/tests/yorick-gyoto-mpi
+Tests: yorick-gyoto-mpi
 Depends: yorick-gyoto, gyoto-bin, openmpi-bin
 Restrictions: allow-stderr
 
diff --git a/debian/tests/gyoto b/debian/tests/gyoto
index 8427081..c8bad65 100755
--- a/debian/tests/gyoto
+++ b/debian/tests/gyoto
@@ -1,12 +1,31 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Get list of non-Lorene examples
 EXAMPLES_DIR=/usr/share/doc/libgyoto5/examples
 BASE_NAMES=`basename -s.xml ${EXAMPLES_DIR}/*.xml | sed 's/example-[^ ]*-rotstar3_1//'`
-GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=4 --resolution=32"
 
+# Build Gyoto command line
+GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=4 --resolution=32 --plugins=stdplug"
+# Run each example in this environment
 for base in ${BASE_NAMES} ; do
-    ${GYOTO} ${EXAMPLES_DIR}/${base}.xml \!${ADT_ARTIFACTS}/${base}.fits ;
+    ${GYOTO} \
+		  ${EXAMPLES_DIR}/${base}.xml \
+		  \!${ADT_ARTIFACTS}/${base}.fits ;
 done
 
 exit 0
diff --git a/debian/tests/gyoto-lorene b/debian/tests/gyoto-lorene
index 8615b6f..8f49523 100755
--- a/debian/tests/gyoto-lorene
+++ b/debian/tests/gyoto-lorene
@@ -1,15 +1,27 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Save current directory (must be top of source tree)
 SRC_ROOT=`pwd`
 
+# Compute Lorene metric using Nrotstar "code"
 export HOME_LORENE=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene
-
-
-mkdir -p ${ADTTMP}
-mkdir -p ${ADT_ARTIFACTS}
-
-cd ${ADTTMP}
+mkdir -p ${ADTTMP}/${script}
+cd ${ADTTMP}/${script}
 rm -Rf .check-lorene
 cp -a ${HOME_LORENE}/Codes/Nrotstar ./.check-lorene
 cd .check-lorene
@@ -20,12 +32,18 @@ make
 ./nrotstar
 cd ..
 
+# Get list of Lorene examples
 EXAMPLES_DIR=${SRC_ROOT}/doc/examples
 BASE_NAMES=`basename -s.xml ${EXAMPLES_DIR}/*-rotstar3_1.xml`
-GYOTO="/usr/bin/gyoto -pstdplug,lorene --nprocesses=0 --nthreads=1 --resolution=32"
 
+# Build Gyoto command line
+GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=1 --resolution=32 --plugins=stdplug,lorene"
+
+# Run each example in this environment
 for base in ${BASE_NAMES} ; do
-    ${GYOTO} ${EXAMPLES_DIR}/${base}.xml \!${ADT_ARTIFACTS}/${base}.fits ;
+    ${GYOTO} \
+		  ${EXAMPLES_DIR}/${base}.xml \
+		  \!${ADT_ARTIFACTS}/${base}.fits ;
 done
 
 exit 0
diff --git a/debian/tests/gyoto-lorene-mpi b/debian/tests/gyoto-lorene-mpi
index caae2c7..9f7f96a 100755
--- a/debian/tests/gyoto-lorene-mpi
+++ b/debian/tests/gyoto-lorene-mpi
@@ -1,15 +1,27 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Save current directory (must be top of source tree)
 SRC_ROOT=`pwd`
 
+# Compute Lorene metric using Nrotstar "code"
 export HOME_LORENE=/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/lorene
-
-
-mkdir -p ${ADTTMP}/gyoto-lorene-mpi
-mkdir -p ${ADT_ARTIFACTS}
-
-cd ${ADTTMP}/gyoto-lorene-mpi
+mkdir -p ${ADTTMP}/${script}
+cd ${ADTTMP}/${script}
 rm -Rf .check-lorene
 cp -a ${HOME_LORENE}/Codes/Nrotstar ./.check-lorene
 cd .check-lorene
@@ -20,15 +32,25 @@ make
 ./nrotstar
 cd ..
 
+# Get list of Lorene examples
 EXAMPLES_DIR=${SRC_ROOT}/doc/examples
 BASE_NAMES=`basename -s.xml ${EXAMPLES_DIR}/*-rotstar3_1.xml`
-GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32"
-export GYOTO_PLUGINS="stdplug,lorene"
-export OMPI_MCA_orte_rsh_agent=/bin/false
 
+# Build Gyoto command line
+GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32 --plugins=stdplug,lorene"
+
+# Setup MPI environment to run on localhost with enough slots
+export OMPI_MCA_plm_rsh_agent=/bin/false
+export OMPI_MCA_btl_tcp_if_include=lo
+HOSTFILE="${ADTTMP}"/hostfile.${script}
+echo localhost slots=5 > "${HOSTFILE}"
+MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}"
 
+# Run each example in this environment
 for base in ${BASE_NAMES} ; do
-    orterun --mca btl_tcp_if_include lo ${GYOTO} ${EXAMPLES_DIR}/${base}.xml \!${ADT_ARTIFACTS}/${base}-mpi.fits ;
+    ${MPIRUN_CMD} ${GYOTO} \
+		  ${EXAMPLES_DIR}/${base}.xml \
+		  \!${ADT_ARTIFACTS}/${base}-mpi.fits ;
 done
 
 exit 0
diff --git a/debian/tests/gyoto-mpi b/debian/tests/gyoto-mpi
index dfc6437..d0727e2 100755
--- a/debian/tests/gyoto-mpi
+++ b/debian/tests/gyoto-mpi
@@ -1,14 +1,39 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Get list of non-Lorene examples
 EXAMPLES_DIR=/usr/share/doc/libgyoto5/examples
 BASE_NAMES=`basename -s.xml ${EXAMPLES_DIR}/*.xml | sed 's/example-[^ ]*-rotstar3_1//'`
-GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32"
 
-export OMPI_MCA_orte_rsh_agent=/bin/false
+# Build Gyoto command line
+GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32 --plugins=stdplug"
+
+# Setup MPI environment to run on localhost with enough slots
+export OMPI_MCA_plm_rsh_agent=/bin/false
+export OMPI_MCA_btl_tcp_if_include=lo
+HOSTFILE="${ADTTMP}"/hostfile.${script}
+echo localhost slots=5 > "${HOSTFILE}"
+MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}"
 
+# Run each example in this environment
 for base in ${BASE_NAMES} ; do
-    orterun --mca btl_tcp_if_include lo ${GYOTO} ${EXAMPLES_DIR}/${base}.xml \!${ADT_ARTIFACTS}/${base}-mpi.fits ;
+    ${MPIRUN_CMD} ${GYOTO} \
+		  ${EXAMPLES_DIR}/${base}.xml \
+		  \!${ADT_ARTIFACTS}/${base}-mpi.fits ;
 done
 
 exit 0
diff --git a/debian/tests/python-gyoto b/debian/tests/python-gyoto
index f1597bf..2a7217e 100755
--- a/debian/tests/python-gyoto
+++ b/debian/tests/python-gyoto
@@ -1,17 +1,38 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Save current directory (must be top of source tree)
 SRC_ROOT=`pwd`
 
+# Setup Python example tree structure
 mkdir -p ${ADTTMP}/doc
 cp -a doc/examples ${ADTTMP}/doc/
 mkdir -p ${ADTTMP}/python
 cd ${ADTTMP}/python
 echo "backend : PDF" > matplotlibrc
 cp ${SRC_ROOT}/plugins/python/doc/examples/* ./
+
+# Get list of Python examples
 BASE_NAMES=`basename -s.xml *.xml`
+
+# Build Gyoto command line
 GYOTO="/usr/bin/gyoto --nprocesses=0 --nthreads=1 --resolution=32"
 
+# Run each example in this environment
 for python in python python2 python3 `pyversions -s` `py3versions -s` ; do
     echo "**** Testing Python version: $python ****" 
     unset GYOTO_PLUGINS
@@ -20,7 +41,9 @@ for python in python python2 python3 `pyversions -s` `py3versions -s` ; do
     mkdir -p ${ADT_ARTIFACTS}/$python
     export GYOTO_PLUGINS=$python,stdplug
     for base in ${BASE_NAMES} ; do
-	${GYOTO} ${base}.xml \!${ADT_ARTIFACTS}/${python}/${base}.fits ;
+	${GYOTO} \
+		      ${base}.xml \
+		      \!${ADT_ARTIFACTS}/${python}/${base}.fits ;
     done ;
 done
 
diff --git a/debian/tests/python-gyoto-mpi b/debian/tests/python-gyoto-mpi
index 4a9812b..64cb524 100755
--- a/debian/tests/python-gyoto-mpi
+++ b/debian/tests/python-gyoto-mpi
@@ -1,27 +1,55 @@
 #!/bin/sh
 set -e
 
+# Name of this script
+script=`basename "$0"`
+
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
+
+# Save current directory (must be top of source tree)
 SRC_ROOT=`pwd`
 
+# Setup Python example tree structure
 mkdir -p ${ADTTMP}/doc
 cp -a doc/examples ${ADTTMP}/doc/
 mkdir -p ${ADTTMP}/python
 cd ${ADTTMP}/python
 echo "backend : PDF" > matplotlibrc
 cp ${SRC_ROOT}/plugins/python/doc/examples/* ./
+
+# Get list of Python examples
 BASE_NAMES=`basename -s.xml *.xml`
+
+# Build Gyoto command line
 GYOTO="/usr/bin/gyoto --nprocesses=4 --nthreads=1 --resolution=32"
 
-export OMPI_MCA_orte_rsh_agent=/bin/false
+# Setup MPI environment to run on localhost with enough slots
+export OMPI_MCA_plm_rsh_agent=/bin/false
+export OMPI_MCA_btl_tcp_if_include=lo
+HOSTFILE="${ADTTMP}"/hostfile.${script}
+echo localhost slots=5 > "${HOSTFILE}"
+MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}"
 
+# Run each example in this environment
 for python in python python2 python3 `pyversions -s` `py3versions -s` ; do
     echo "**** Testing Python version: $python ****" 
     unset GYOTO_PLUGINS
-    orterun --mca btl_tcp_if_include lo $python ${SRC_ROOT}/python/example-mpi.py ;
+    ${MPIRUN_CMD} $python ${SRC_ROOT}/python/example-mpi.py ;
     mkdir -p ${ADT_ARTIFACTS}/${python}-mpi
     export GYOTO_PLUGINS=$python,stdplug
     for base in ${BASE_NAMES} ; do
-	 orterun --mca btl_tcp_if_include lo ${GYOTO} ${base}.xml \!${ADT_ARTIFACTS}/${python}-mpi/${base}.fits ;
+	${MPIRUN_CMD} ${GYOTO} \
+		      ${base}.xml \
+		      \!${ADT_ARTIFACTS}/${python}-mpi/${base}.fits ;
     done ;
 done
 
diff --git a/debian/tests/yorick-gyoto b/debian/tests/yorick-gyoto
index 4617060..f22c7b1 100755
--- a/debian/tests/yorick-gyoto
+++ b/debian/tests/yorick-gyoto
@@ -1,26 +1,22 @@
-#!/usr/bin/yorick -i
+#!/bin/sh
+set -e
 
-// ensure mkdirp is defined
-#include "pathfun.i"
+# Name of this script
+script=`basename "$0"`
 
-// get or set a few variables
-SRC_ROOT=cd(".");
-ADTTMP=get_env("ADTTMP");
-GYOTO_EXAMPLES_DIR=SRC_ROOT+"doc/examples/";
-GYOTO_CHECK_NODISPLAY="true"
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
 
-// no X11 display
-batch, 1;
-__xytitles=xytitles; __fma=fma; __winkill=winkill; __pli=pli; __plg=plg;
-__pause=pause; __window=window;
-xytitles = fma = winkill = pli = plg = pause = window = noop;
+# Run yorick script
+unset OMPI_COMM_WORLD_SIZE
+/usr/bin/yorick -i ./debian/tests/yorick-gyoto.i
 
-// get scripts
-mkdirp, ADTTMP;
-cd, ADTTMP;
-system, "cp -f " + SRC_ROOT +"yorick/*.i ./";
-
-// run upstream test suite
-#include "check.i"
-
-quit;
+exit 0
diff --git a/debian/tests/yorick-gyoto-mpi b/debian/tests/yorick-gyoto-mpi
old mode 100755
new mode 100644
index 486b8da..59a5f00
--- a/debian/tests/yorick-gyoto-mpi
+++ b/debian/tests/yorick-gyoto-mpi
@@ -1,26 +1,28 @@
-#!/usr/bin/yorick -i
+#!/bin/sh
+set -e
 
-// ensure mkdirp is defined
-#include "pathfun.i"
+# Name of this script
+script=`basename "$0"`
 
-// get or set a few variables
-SRC_ROOT=cd(".");
-ADTTMP=get_env("ADTTMP");
-GYOTO_EXAMPLES_DIR=SRC_ROOT+"doc/examples/";
-GYOTO_CHECK_NODISPLAY="true"
+# Handle case of manually running this script
+if [ "$ADTTMP" = "" ]; then
+    ADTTMP=`mktemp -d --tmpdir "$script"-XXX`;
+    echo "ADTTMP is $ADTTMP";
+fi
+if [ "$ADT_ARTIFACTS" = "" ] ; then
+    ADT_ARTIFACTS=${ADTTMP}/artifacts
+fi
+mkdir -p "${ADTTMP}"
+mkdir -p "${ADT_ARTIFACTS}"
 
-// no X11 display
-batch, 1;
-__xytitles=xytitles; __fma=fma; __winkill=winkill; __pli=pli; __plg=plg;
-__pause=pause; __window=window;
-xytitles = fma = winkill = pli = plg = pause = window = noop;
+# Setup MPI environment to run on localhost with enough slots
+export OMPI_MCA_plm_rsh_agent=/bin/false
+export OMPI_MCA_btl_tcp_if_include=lo
+HOSTFILE="${ADTTMP}"/hostfile.${script}
+echo localhost slots=9 > "${HOSTFILE}"
+MPIRUN_CMD="mpirun.openmpi -np 1 --hostfile ${HOSTFILE}"
 
-// get scripts
-mkdirp, ADTTMP;
-cd, ADTTMP;
-system, "cp -f " + SRC_ROOT +"yorick/*.i ./";
+# Run yorick script
+${MPIRUN_CMD} /usr/bin/yorick -i ./debian/tests/yorick-gyoto.i
 
-// run upstream test suite
-#include "check-mpi.i"
-
-quit;
+exit 0
diff --git a/debian/tests/yorick-gyoto b/debian/tests/yorick-gyoto.i
similarity index 86%
copy from debian/tests/yorick-gyoto
copy to debian/tests/yorick-gyoto.i
index 4617060..322edb6 100755
--- a/debian/tests/yorick-gyoto
+++ b/debian/tests/yorick-gyoto.i
@@ -21,6 +21,7 @@ cd, ADTTMP;
 system, "cp -f " + SRC_ROOT +"yorick/*.i ./";
 
 // run upstream test suite
-#include "check.i"
+check_i=get_env("OMPI_COMM_WORLD_SIZE")?"check-mpi.i":"check.i";
+include, check_i;
 
 quit;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list