#!/bin/bash # StarPU --- Runtime system for heterogeneous multicore architectures. # # Copyright (C) 2014-2015 Université Bordeaux # # 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. # Script for running starpu-mpi application in simgrid mode prefix=@prefix@ SMPIRUN=@smpirun_path@ STARPU_DATADIR=@datarootdir@ MPI_PLATFORM="" MPI_HOSTFILE="" NP="" while true; do case "$1" in "-platform") MPI_PLATFORM=$2 if [ ! -r "$MPI_PLATFORM" ]; then echo "$MPI_PLATFORM can't be read" exit 1 fi shift 2 ;; "-hostfile") MPI_HOSTFILE=$2 if [ ! -r "$MPI_HOSTFILE" ]; then echo "$MPI_HOSTFILE can't be read" exit 1 fi shift 2 ;; "-np") NP=$2 shift 2 ;; *) break ;; esac done if [ -z "$MPI_PLATFORM" ] || [ -z "$MPI_HOSTFILE" ]; then echo "$0 -platform PLATFORM -hostfile HOSTFILE [ -np N ] [ ... ] program [ args ]" exit 2 fi PLATFORM=$(mktemp /tmp/StarPU-MPI-platform-XXXXXXXX.xml) [ -n "$STARPU_PERF_MODEL_DIR" ] || STARPU_PERF_MODEL_DIR=$HOME/.starpu/sampling [ -n "$STARPU_HOSTNAME" ] || STARPU_HOSTNAME=$(hostname) NODE_PLATFORM=$STARPU_PERF_MODEL_DIR/bus/${STARPU_HOSTNAME}.platform.xml [ -n "$NP" ] || NP=$(grep -v "^$" $MPI_HOSTFILE | wc -l) ( cat << \EOF EOF tail -n +3 $MPI_PLATFORM | grep -v ' EOF ) > $PLATFORM STACKSIZE=$(ulimit -s) [ "$STACKSIZE" != unlimited ] || STACKSIZE=8192 $SMPIRUN -platform $PLATFORM -hostfile $MPI_HOSTFILE "$@" --cfg=smpi/privatize_global_variables:yes --cfg=contexts/stack_size:$STACKSIZE rm -f $PLATFORM