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

Last change on this file since 942 was 942, checked in by dubos, 5 years ago

devel : split DySL from Python

  • Property svn:executable set to *
File size: 992 bytes
Line 
1#!/bin/bash
2# usage : ./python.sh mode [n] script script_args
3# mode is 'serial' or mpi
4# if mode is 'mpi' then argument [n] specifies the number of MPI processes
5
6# This script relies on ../.. being DYNAMICO_ROOT
7# If you move it, set DYNAMICO_ROOT accordingly in the script or before calling the script
8
9function cmd_serial()
10{
11    LD_PRELOAD=$PYTHON_PRELOAD python -u $*
12}
13
14function cmd_gdb()
15{
16    set -x
17    LD_PRELOAD=$PYTHON_PRELOAD gdb --args python -u $*
18}
19
20function cmd_mpi()
21{
22    NB_MPI=$1
23    shift
24    rm -f xios_client*.*
25    mpirun --mca mpi_warn_on_fork 0 -np $NB_MPI python -u $* 2>&1 | tee dynamico.log
26}
27
28TEST=$PWD
29DYNAMICO_ROOT=$(cd -P $(dirname $0)/../.. ; pwd) # change/remove this line if you move this script
30
31cd $DYNAMICO_ROOT
32
33cp -i -u Python/dynamico/*.py lib/dynamico/
34cp -i -u Python/dynamico/dev/*.py lib/dynamico/dev/
35
36. arch.env
37. arch.path
38cd arch
39. arch-${CURRENT_ARCH}.dev
40
41cd $TEST
42
43export OMP_STACKSIZE=128M
44ulimit -s unlimited
45
46CMD=$1
47shift
48cmd_$CMD $*
Note: See TracBrowser for help on using the repository browser.