Commit 20b0488c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'fix_examples' into 'master'

Fix examples

See merge request !5


Former-commit-id: c60ad5a329706e7393f3ee39e9e3e75e1ac5f518
parents 61323405 dc208ade
File mode changed from 100644 to 100755
......@@ -3,6 +3,30 @@
# Set some global stuff
export OMP_WAIT_POLICY=PASSIVE
# Generate the initial conditions if they are not present.
if [ ! -e SodShock/sodShock.hdf5 ]
then
echo "Generating initial conditions for the SodShock example..."
cd SodShock
python makeIC.py
cd ..
fi
if [ ! -e SedovBlast/sedov.hdf5 ]
then
echo "Generating initial conditions for the SedovBlast example..."
cd SedovBlast/
python makeIC_fcc.py
cd ..
fi
if [ ! -e CosmoVolume/cosmoVolume.hdf5 ]
then
echo "Downloading initial conditions for the CosmoVolume example..."
cd CosmoVolume
./getIC.sh
cd ..
fi
# Loop over number of cores
for cpu in {1..32}
do
......@@ -10,11 +34,11 @@ do
# Sod-Shock runs
if [ ! -e SodShock_mindt_${cpu}.dump ]
then
./test_mindt -c 1.0 -t $cpu -f SodShock/sodShock.hdf5 -m 0.1 -w 5000 -d 1.0 > SodShock_${cpu}.dump
./test_mindt -c 1.0 -t $cpu -f SodShock/sodShock.hdf5 -m 0.01 -w 5000 -d 1.0 > SodShock_${cpu}.dump
fi
if [ ! -e SodShock_fixed_${cpu}.dump ]
then
./test_fixdt -r 1000 -t $cpu -f SodShock/sodShock.hdf5 -m 0.0075 -w 5000 -d 1e-4 > SodShock_fixed_${cpu}.dump
./test_fixdt -r 1000 -t $cpu -f SodShock/sodShock.hdf5 -m 0.01 -w 5000 -d 1e-4 > SodShock_fixed_${cpu}.dump
fi
# Sedov blast
......
#!/bin/bash
# Set the number of runs
RUNS=100
# Cores per node
CPN=12
# The queue on which to run
QUEUE=cosma
PROJECT=durham
PREFIX=CosmoVolume
INPUT=$PREFIX/CosmoVolume.hdf5
# Make sure the OMP threads don't go wild
export OMP_WAIT_POLICY=PASSIVE
# Set the library path so that libmetis is found
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cosma/home/nnrw56/lib
# Single-node runs
for cpu in $(seq 1 $CPN)
do
if [ ! -e ${PREFIX}_${QUEUE}_1x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_1x${cpu}.dump -q ${QUEUE} -P ${PROJECT} -x -n 1 -R "span[ptile=1]" ./test_fixdt -r $RUNS -t $cpu -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
done
# Multi-node runs
if [ ! -e ${PREFIX}_${QUEUE}_2x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_2x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 2 -R "span[ptile=1]" mpirun -np 2 ./test_fixdt_mpi -r $RUNS -t $CPN -g "2 1 1" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_4x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_4x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 4 -R "span[ptile=1]" mpirun -np 4 ./test_fixdt_mpi -r $RUNS -t $CPN -g "2 2 1" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_8x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_8x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 8 -R "span[ptile=1]" mpirun -np 8 ./test_fixdt_mpi -r $RUNS -t $CPN -g "2 2 2" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_16x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_16x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 16 -R "span[ptile=1]" mpirun -np 16 ./test_fixdt_mpi -r $RUNS -t $CPN -g "4 2 2" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_32x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_32x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 32 -R "span[ptile=1]" mpirun -np 32 ./test_fixdt_mpi -r $RUNS -t $CPN -g "4 4 2" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_64x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_64x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 64 -R "span[ptile=1]" mpirun -np 64 ./test_fixdt_mpi -r $RUNS -t $CPN -g "4 4 4" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
if [ ! -e ${PREFIX}_${QUEUE}_128x${cpu}.dump ]
then
bsub -oo ${PREFIX}_${QUEUE}_128x${CPN}.dump -q ${QUEUE} -P ${PROJECT} -x -W 02:00 -n 128 -R "span[ptile=1]" mpirun -np 128 ./test_fixdt_mpi -r $RUNS -t $CPN -g "8 4 4" -f ${INPUT} -m 0.705 -w 6000 -z 300 -d 1e-8
fi
......@@ -31,6 +31,9 @@
#include <stddef.h>
#include <hdf5.h>
#include <math.h>
#ifdef WITH_MPI
#include <mpi.h>
#endif
#include "const.h"
#include "cycle.h"
......
......@@ -27,7 +27,7 @@
*/
#ifdef WITH_MPI
extern int engine_rank;
#define error(s, ...) { fprintf( stderr , "[%03i] %s:%s():%i: " s "\n" , engine_rank , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); abort(); }
#define error(s, ...) { fprintf( stderr , "[%03i] %s:%s():%i: " s "\n" , engine_rank , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); MPI_Abort(MPI_COMM_WORLD, -1); }
#else
#define error(s, ...) { fprintf( stderr , "%s:%s():%i: " s "\n" , __FILE__ , __FUNCTION__ , __LINE__ , ##__VA_ARGS__ ); abort(); }
#endif
......
......@@ -23,6 +23,9 @@
#if defined(HAVE_HDF5) && defined(WITH_MPI)
/* Tell hdf5 that we intend to use shared-memory parallel stuff. */
#define H5_HAVE_PARALLEL
/* Some standard headers. */
#include <stdio.h>
......
......@@ -27,6 +27,9 @@
#include <string.h>
#include <stddef.h>
#include <math.h>
#ifdef WITH_MPI
#include <mpi.h>
#endif
#include "const.h"
#include "cycle.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment