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

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

devel/Python : centralize logging and command-line argument parsing + update some test cases accordingly

  • Property svn:executable set to *
File size: 801 bytes
RevLine 
[617]1#!/bin/bash
[717]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
[759]12function cmd_gdb()
13{
14    set -x
15    LD_PRELOAD=$PYTHON_PRELOAD gdb --args python -u $*
16}
17
[717]18function cmd_mpi()
19{
20    NB_MPI=$1
21    shift
[790]22    rm -f xios_client*.*
23    mpirun -np $NB_MPI python -u $* | tee dynamico.log
[717]24}
25
26TEST=$PWD
[617]27DYNAMICO_ROOT=$(cd -P $(dirname $0)/../.. ; pwd)
28
[717]29cd $DYNAMICO_ROOT
[777]30
31cp -i -u Python/dynamico/* lib/dynamico/
32
[717]33. arch.env
34. arch.path
[777]35cd $DYNAMICO_ROOT/Python/env
[717]36. $CURRENT_ARCH.env
37
38cd $TEST
39
[676]40export OMP_STACKSIZE=128M
[717]41ulimit -s unlimited
[676]42
[717]43CMD=$1
44shift
45cmd_$CMD $*
Note: See TracBrowser for help on using the repository browser.