1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
usage()
{
cmd=$(basename "$0")
echo ""
echo " $cmd - Coarray Fortran executable launcher for OpenCoarrays"
echo ""
echo " Usage: $cmd [options] ..."
echo ""
echo " Options:"
echo " --help, -h Show this help message"
echo " --version, -v, -V Report version and copyright information"
echo " --wraps, -w, Report the name of the wrapped compiler"
echo ""
echo " Example usage:"
echo ""
echo " $cmd -np 2 foo"
echo " $cmd -v"
echo " $cmd --help"
echo ""
echo " Notes:"
echo " [options] must a CAF executable file, one of the above arguments,"
echo " or an argument to the program name returned by caf --wraps"
echo ""
exit 1
}
# Print useage information if caf is invoked without arguments
if [ $# == 0 ]; then
usage
elif [[ $1 == '-v' || $1 == '-V' || $1 == '--version' ]]; then
echo ""
# shellcheck disable=SC2154
echo "OpenCoarrays Coarray Fortran Executable Launcher (caf version $caf_version)"
echo "Copyright (C) 2015-2016 Sourcery, Inc."
echo ""
echo "OpenCoarrays comes with NO WARRANTY, to the extent permitted by law."
echo "You may redistribute copies of OpenCoarrays under the terms of the"
echo "BSD 3-Clause License. For more information about these matters, see"
echo "the file named LICENSE."
echo ""
elif [[ $1 == '-w' || $1 == '--wraps' ]]; then
mpirun -v
elif [[ $1 == '-h' || $1 == '--help' ]]; then
usage
else
mpirun "$@"
fi
|