mpi-selector.sh.in 782 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/sh
# Copyright (c) 2007 Cisco Systems, Inc.  All rights reserved.
#
# File installed for Bourne-shell startups to select which MPI
# installation to use.  Not using "alternatives" because we want to be
# able to set per-user level defaults, not just system-wide defaults.

mpi_selector_dir="@MPI_SELECTOR_DATADIR@"
mpi_selector_homefile="$HOME/@MPI_SELECTOR_HOME_FILE@"
mpi_selector_sysfile="@MPI_SELECTOR_SYSCONFDIR@/@MPI_SELECTOR_SYSCONFIG_FILE@"

mpi_selection=
if test -f "$mpi_selector_homefile"; then
    mpi_selection=`cat $mpi_selector_homefile`
elif test -f "$mpi_selector_sysfile"; then
    mpi_selection=`cat $mpi_selector_sysfile`
fi

if test "$mpi_selection" != "" -a -f "$mpi_selector_dir/$mpi_selection.sh"; then
    . "$mpi_selector_dir/$mpi_selection.sh"
fi