#! /bin/sh

mpe_pgm_name="`echo $0 | sed 's%.*/\([^/]*\)$%\1%g'`"

# Determine if this is invoked from standalone MPE or MPICH2
case ${mpe_pgm_name} in
    mpe*)
    # if mpecc and mpefc, standalone MPE
    mpe_hpfx="    -"
    mpe_hpst="     "
    ;;
    mpi*)
    # if mpicc and mpif77/mpif90, MPICH2
    mpe_hpfx="    -mpe="
    mpe_hpst="         "
    ;;
    *)
    # Set unrecognized mpe_pgm_name as standalone MPE.
    mpe_hpfx="    -"
    mpe_hpst="     "
    ;;
esac

cat <<EOF

Available MPE profiling options for "${mpe_pgm_name}" :

${mpe_hpfx}mpilog     : Automatic MPI and MPE user-defined states logging.
${mpe_hpst}             This links against -llmpe -lmpe.

${mpe_hpfx}mpitrace   : Trace MPI program with printf.
${mpe_hpst}             This links against -ltmpe.

${mpe_hpfx}mpianim    : Animate MPI program in real-time.
${mpe_hpst}             This links against -lampe -lmpe.

${mpe_hpfx}mpicheck   : Check MPI Program with the Collective & Datatype
${mpe_hpst}             Checking library.  This links against -lmpe_collchk.

${mpe_hpfx}graphics   : Use MPE graphics routines with X11 library.
${mpe_hpst}             This links against -lmpe -l<X11 libraries>.

${mpe_hpfx}log        : MPE user-defined states logging.
${mpe_hpst}             This links against -lmpe.

${mpe_hpfx}nolog      : Nullify MPE user-defined states logging.
${mpe_hpst}             This links against -lmpe_null.

${mpe_hpfx}help       : Print this help page.
EOF

exit 1
