From 459186cedeee2fb7608b344e28ddf76f3a88e285 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 4 Sep 2024 11:34:27 -0600 Subject: [PATCH] SCRIPTS: Better support for parallel not in ACCESS/bin --- packages/seacas/scripts/epup.in | 21 ++++++++++++++++++--- packages/seacas/scripts/pconjoin.in | 16 +++++++++++++--- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/packages/seacas/scripts/epup.in b/packages/seacas/scripts/epup.in index fa9a25be5d..4457f6f126 100644 --- a/packages/seacas/scripts/epup.in +++ b/packages/seacas/scripts/epup.in @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright(C) 1999-2020 National Technology & Engineering Solutions +# Copyright(C) 1999-2024 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # @@ -15,6 +15,10 @@ Usage: epup --subcycle ...normal epu options... ->->-> Send email to gdsjaar@sandia.gov for epup support.<-<-<- + Uses: GNU Parallel, + O. Tange (2018): GNU Parallel 2018, Mar 2018, ISBN 9781387509881, + DOI https://doi.org/10.5281/zenodo.1146014 + EPU_USAGE_EOF exit 1 } @@ -49,7 +53,8 @@ cycles=-1 pushd $(dirname "${0}") > /dev/null basedir=$(pwd -P) popd > /dev/null -if [ -x ${basedir}/epu -a -x ${basedir}/parallel -a -x ${basedir}/getopt.seacas ]; then + +if [ -x ${basedir}/epu -a -x ${basedir}/getopt.seacas ]; then ACCESS_BIN=$basedir elif [ "$ACCESS" == "" ]; then ACCESS_BIN=@ACCESSDIR@/bin @@ -57,8 +62,18 @@ else ACCESS_BIN=${ACCESS}/bin fi +if command -v ${basedir}/parallel >/dev/null 2>&1; then + PARALLEL=$basedir/parallel +elif command -v parallel >/dev/null 2>&1; then + PARALLEL=parallel +elif command -v ${ACCESS_BIN}/parallel >/dev/null 2>&1; then + PARALLEL=${ACCESS_BIN}/parallel +else + echo "ERROR: Could not find an executable named \"parallel\" for use with the script" + exit 1 +fi + EPU=${ACCESS_BIN}/epu -PARALLEL=${ACCESS_BIN}/parallel SEQ="seq -w" if [ $# -eq 0 ] ; then usage diff --git a/packages/seacas/scripts/pconjoin.in b/packages/seacas/scripts/pconjoin.in index d3364b96a6..e77d470799 100644 --- a/packages/seacas/scripts/pconjoin.in +++ b/packages/seacas/scripts/pconjoin.in @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions +# Copyright(C) 1999-2024 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # @@ -79,7 +79,7 @@ cycles=-1 pushd $(dirname "${0}") > /dev/null basedir=$(pwd -P) popd > /dev/null -if [ -x ${basedir}/conjoin -a -x ${basedir}/parallel -a -x ${basedir}/getopt.seacas ]; then +if [ -x ${basedir}/conjoin -a -x ${basedir}/getopt.seacas ]; then ACCESS_BIN=$basedir elif [ "$ACCESS" == "" ]; then ACCESS_BIN=@ACCESSDIR@/bin @@ -87,8 +87,18 @@ else ACCESS_BIN=${ACCESS}/bin fi +if command -v ${basedir}/parallel >/dev/null 2>&1; then + PARALLEL=$basedir/parallel +elif command -v parallel >/dev/null 2>&1; then + PARALLEL=parallel +elif command -v ${ACCESS_BIN}/parallel >/dev/null 2>&1; then + PARALLEL=${ACCESS_BIN}/parallel +else + echo "ERROR: Could not find an executable named \"parallel\" for use with the script" + exit 1 +fi + CONJOIN=${ACCESS_BIN}/conjoin -PARALLEL=${ACCESS_BIN}/parallel SEQ="seq -w" if [ $# -eq 0 ] ; then usage