source: codes/icosagcm/devel/Python/test/python.sh @ 717

Last change on this file since 717 was 717, checked in by dubos, 6 years ago

devel/unstructured : more flexible wrapper to execute test cases

  • Property svn:executable set to *
File size: 625 bytes
Line 
1#!/bin/bash
2# please do not move this script as relies on ../.. being DYNAMICO_ROOT
3# usage : ./python.sh mode [n] script script_args
4# mode is 'serial' or mpi
5# if mode is 'mpi' then argument [n] specifies the number of MPI processes
6
7function cmd_serial()
8{
9    LD_PRELOAD=$PYTHON_PRELOAD python -u $*
10}
11
12function cmd_mpi()
13{
14    NB_MPI=$1
15    shift
16    mpirun -np $NB_MPI python -u $*
17}
18
19TEST=$PWD
20DYNAMICO_ROOT=$(cd -P $(dirname $0)/../.. ; pwd)
21
22cd $DYNAMICO_ROOT
23. arch.env
24. arch.path
25cd $DYNAMICO_ROOT/Python//env
26. $CURRENT_ARCH.env
27
28cd $TEST
29
30export OMP_STACKSIZE=128M
31ulimit -s unlimited
32
33CMD=$1
34shift
35cmd_$CMD $*
Note: See TracBrowser for help on using the repository browser.