#!/usr/bin/env bash

source /project/project_465000527/perf_tools/extrae/extrae_user_fx/etc/extrae.sh

# The RUNDIR is the PWD of trace.sh, which is now regardless of callers location.
export RUNDIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)

export LD_PRELOAD=${EXTRAE_HOME}/lib/libmpitracef.so
export EXTRAE_CONFIG_FILE="$RUNDIR/extrae.xml"
export EXTRAE_SKIP_AUTO_LIBRARY_INITIALIZE=1

echo "Extrae ENABLED!"

$*
