| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #!@REALBASH@
- # StarPU --- Runtime system for heterogeneous multicore architectures.
- #
- # Copyright (C) 2020-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
- #
- # StarPU is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Lesser General Public License as published by
- # the Free Software Foundation; either version 2.1 of the License, or (at
- # your option) any later version.
- #
- # StarPU is distributed in the hope that it will be useful, but
- # WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- #
- # See the GNU Lesser General Public License in COPYING.LGPL for more details.
- #
- exampledir=@STARPU_SRC_DIR@/starpupy/examples
- modpath=@STARPU_BUILD_DIR@/src/.libs:
- pypath=@STARPU_BUILD_DIR@/starpupy/src/build:$PYTHONPATH
- LOADER=@PYTHON@
- read_arg()
- {
- do_shift=0
- if test "$1" == "--valgrind"
- then
- export PYTHONMALLOC=malloc
- LOADER="valgrind --track-origins=yes @PYTHON@"
- do_shift=1
- elif test "$1" == "--gdb"
- then
- LOADER="gdb --args @PYTHON@"
- do_shift=1
- elif test "$1" == "--mpirun"
- then
- if test "$MPI_LAUNCHER"
- then
- LOADER="$MPI_LAUNCHER @PYTHON@"
- else
- LOADER="mpiexec -np 2 @PYTHON@"
- fi
- do_shift=1
- fi
- }
- for x in $*
- do
- read_arg $x
- if test $do_shift == 1
- then
- shift
- fi
- done
- for x in $LOADER_ARGS
- do
- read_arg $x
- done
- examplefile=$1
- if test -f $examplefile
- then
- pythonscript=$examplefile
- elif test -f $exampledir/$examplefile
- then
- pythonscript=$exampledir/$examplefile
- else
- echo "Error. Python script $examplefile not found in current directory or in $exampledir"
- exit 1
- fi
- shift
- set -x
- PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath $LOADER $pythonscript $*
|