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

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

devel/Python : minor bugfix after reorganization of Python modules

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