Last change
on this file since 1037 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
|
Rev | Line | |
---|
[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] | 9 | function cmd_serial() |
---|
| 10 | { |
---|
[959] | 11 | python -u $* |
---|
[717] | 12 | } |
---|
| 13 | |
---|
[759] | 14 | function cmd_gdb() |
---|
| 15 | { |
---|
| 16 | set -x |
---|
| 17 | LD_PRELOAD=$PYTHON_PRELOAD gdb --args python -u $* |
---|
| 18 | } |
---|
| 19 | |
---|
[717] | 20 | function 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 | |
---|
| 28 | TEST=$PWD |
---|
[942] | 29 | DYNAMICO_ROOT=$(cd -P $(dirname $0)/../.. ; pwd) # change/remove this line if you move this script |
---|
[617] | 30 | |
---|
[717] | 31 | cd $DYNAMICO_ROOT |
---|
[777] | 32 | |
---|
[825] | 33 | cp -i -u Python/dynamico/*.py lib/dynamico/ |
---|
[983] | 34 | cp -i -u Python/dev/*.py lib/dynamico/dev/ |
---|
[777] | 35 | |
---|
[717] | 36 | . arch.env |
---|
| 37 | . arch.path |
---|
[942] | 38 | cd arch |
---|
| 39 | . arch-${CURRENT_ARCH}.dev |
---|
[717] | 40 | |
---|
| 41 | cd $TEST |
---|
| 42 | |
---|
[676] | 43 | export OMP_STACKSIZE=128M |
---|
[717] | 44 | ulimit -s unlimited |
---|
[676] | 45 | |
---|
[717] | 46 | CMD=$1 |
---|
| 47 | shift |
---|
| 48 | cmd_$CMD $* |
---|
Note: See
TracBrowser
for help on using the repository browser.