From f5c3cfc072ca1fe5887808137cc04a80de3f4019 Mon Sep 17 00:00:00 2001 From: Richard North III Date: Wed, 24 May 2017 10:15:32 -0500 Subject: [PATCH 01/10] Updated wrappers to catch -h and --help Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 4978b0ae1..b64500193 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -161,6 +161,7 @@ my @args = @ARGV; my $want_preproc = 1; my $want_compile = 1; my $want_link = 1; +my $want_help = 0; my $dry_run = 0; my $disable_flags = 1; my $real_flag = 0; @@ -179,7 +180,11 @@ while (scalar(@args) > 0) { $want_compile = 0; $want_link = 0; $real_flag = 1; - } elsif ($arg eq "-S") { + } elsif ($arg eq "-h" || $arg eq "--help"){ + $arg = "--help"; + $want_help = 1; + $real_flag = 1; + }elsif ($arg eq "-S") { $want_link = 0; $real_flag = 1; } elsif ($arg =~ /^-.*/) { @@ -214,6 +219,12 @@ if ($want_link == 1) { push(@exec_argv, split(' ', $linker_flags)); push(@exec_argv, split(' ', $libs)); } +if ($want_help == 1) { + print("== OSHRUN HELP ======================================\n"); + print("OSHRUN_LAUNCHER= $comp\n\n"); + print("== LAUNCHER HELP ====================================\n"); + +} if ($dry_run == 1) { print join(" ", @exec_argv) . "\n"; From 8d3227f832482ffe9dc0c1dcd41da6b1035fc2dc Mon Sep 17 00:00:00 2001 From: Richard North III Date: Wed, 24 May 2017 10:42:52 -0500 Subject: [PATCH 02/10] Updated wrappers to catch -h and --help Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index b64500193..0a10df074 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -223,7 +223,6 @@ if ($want_help == 1) { print("== OSHRUN HELP ======================================\n"); print("OSHRUN_LAUNCHER= $comp\n\n"); print("== LAUNCHER HELP ====================================\n"); - } if ($dry_run == 1) { From 2b2711d4a91f4e7b6bfe6211e9c5f3a428d37a0a Mon Sep 17 00:00:00 2001 From: Richard North III Date: Thu, 25 May 2017 14:54:05 -0500 Subject: [PATCH 03/10] Swapped out "OSHRUN HELP" with "Sandia OpenSHMEM Help" along with lanucher info Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 0a10df074..8d9223eca 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -220,8 +220,8 @@ if ($want_link == 1) { push(@exec_argv, split(' ', $libs)); } if ($want_help == 1) { - print("== OSHRUN HELP ======================================\n"); - print("OSHRUN_LAUNCHER= $comp\n\n"); + print("== Sandia OpenSHMEM Help ======================================\n"); + print("SOS LAUNCHER= $comp\n\n"); print("== LAUNCHER HELP ====================================\n"); } From 9f97cbbc1acd7bad8e3892681b1a0833935aadfc Mon Sep 17 00:00:00 2001 From: Richard North III Date: Thu, 25 May 2017 15:01:50 -0500 Subject: [PATCH 04/10] Fixed output to look more aligned Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 8d9223eca..2e434e40a 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -220,7 +220,7 @@ if ($want_link == 1) { push(@exec_argv, split(' ', $libs)); } if ($want_help == 1) { - print("== Sandia OpenSHMEM Help ======================================\n"); + print("== Sandia OpenSHMEM Help ============================\n"); print("SOS LAUNCHER= $comp\n\n"); print("== LAUNCHER HELP ====================================\n"); } From 4ac674e403a7465dbd66e1257e118176e8009854 Mon Sep 17 00:00:00 2001 From: Richard North III Date: Wed, 31 May 2017 13:07:33 -0500 Subject: [PATCH 05/10] Added "-h" and "--help" options to launchers along with usage for wrappers and launchers Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 13 +++++++++---- src/shmem_launcher_script.in | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 2e434e40a..37baf3933 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -105,6 +105,7 @@ use File::Spec::Functions; my $includedir = "@WRAPPER_COMPILER_INCLUDEDIR@"; my $libdir = "@WRAPPER_COMPILER_LIBDIR@"; +my $wrapperdir = $0; my $lang = "@LANG@"; my $CC = "@WRAPPER_COMPILER_CC@"; @@ -118,6 +119,7 @@ my $include_flag = "-I"; my $libdir_flag = "-L"; my $comp = ""; +my $wrapper = (split(/\//, $wrapperdir))[-1]; my $preproc_flags = $include_flag . $includedir; my $comp_flags = ""; my $comp_flags_prefix = ""; @@ -180,11 +182,11 @@ while (scalar(@args) > 0) { $want_compile = 0; $want_link = 0; $real_flag = 1; - } elsif ($arg eq "-h" || $arg eq "--help"){ + } elsif ($arg eq "-h" || $arg eq "--help") { $arg = "--help"; $want_help = 1; $real_flag = 1; - }elsif ($arg eq "-S") { + } elsif ($arg eq "-S") { $want_link = 0; $real_flag = 1; } elsif ($arg =~ /^-.*/) { @@ -221,8 +223,11 @@ if ($want_link == 1) { } if ($want_help == 1) { print("== Sandia OpenSHMEM Help ============================\n"); - print("SOS LAUNCHER= $comp\n\n"); - print("== LAUNCHER HELP ====================================\n"); + print("SOS WRAPPER= $wrapper\n"); + print("usage: ",$wrapper," [options]... [file]...\n\n"); + print("COMPILER= $comp\n\n"); + print("Options provided by ",$comp," can also be used by ",$wrapper,".\n\n"); + print("== COMPILER HELP ====================================\n"); } if ($dry_run == 1) { diff --git a/src/shmem_launcher_script.in b/src/shmem_launcher_script.in index 860989415..6ca3a1f32 100644 --- a/src/shmem_launcher_script.in +++ b/src/shmem_launcher_script.in @@ -13,6 +13,8 @@ SEARCH_LAUNCHERS="yod mpirun mpiexec srun" LAUNCHER="" +SOS_LAUNCHER_PATH="$0"; +SOS_LAUNCHER=${SOS_LAUNCHER_PATH##*/}; # Users can set the OSHRUN_LAUNCHER environment variable to specify the command # that will be used by oshrun @@ -29,6 +31,21 @@ else done fi +want_help=0; + +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + want_help=1 +fi + +if [ $want_help = 1 ]; then + printf "== Sandia OpenSHMEM Help ============================\n"; + printf "SOS LAUNCHER= ${SOS_LAUNCHER}\n"; + printf "usage: ${SOS_LAUNCHER} [options] [exec] [exec args]\n\n"; + printf "LAUNCHER= ${LAUNCHER}\n\n"; + printf "Options provided by ${LAUNCHER} can also be used by ${SOS_LAUNCHER}.\n\n"; + printf "== LAUNCHER HELP ====================================\n"; +fi + if [ -z "${LAUNCHER}" ]; then echo "`basename $0`: Error, could not find a launcher. Aborting." exit 1 From 7a797181db32e7f6bdc7e9a471ff2482ca4caf57 Mon Sep 17 00:00:00 2001 From: Richard North III Date: Mon, 5 Jun 2017 14:51:22 -0500 Subject: [PATCH 06/10] Updated help message along with other cosmetic changes Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 15 +++++++++------ src/shmem_launcher_script.in | 13 +++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 37baf3933..54880108a 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -105,7 +105,6 @@ use File::Spec::Functions; my $includedir = "@WRAPPER_COMPILER_INCLUDEDIR@"; my $libdir = "@WRAPPER_COMPILER_LIBDIR@"; -my $wrapperdir = $0; my $lang = "@LANG@"; my $CC = "@WRAPPER_COMPILER_CC@"; @@ -119,7 +118,7 @@ my $include_flag = "-I"; my $libdir_flag = "-L"; my $comp = ""; -my $wrapper = (split(/\//, $wrapperdir))[-1]; +my $wrapper = basename($0); my $preproc_flags = $include_flag . $includedir; my $comp_flags = ""; my $comp_flags_prefix = ""; @@ -222,12 +221,16 @@ if ($want_link == 1) { push(@exec_argv, split(' ', $libs)); } if ($want_help == 1) { - print("== Sandia OpenSHMEM Help ============================\n"); - print("SOS WRAPPER= $wrapper\n"); - print("usage: ",$wrapper," [options]... [file]...\n\n"); + print("== ",uc $wrapper," HELP ============================\n"); + print("usage: ",$wrapper," [options]... file...\n\n"); print("COMPILER= $comp\n\n"); + print($wrapper," options:\n"); + print("\t--help | -h Display this information\n"); + print("\t-showme Print the command that would be ran without executing it\n"); + print("\t-E | -M Disable compilation and linking\n"); + print("\t-S Disable linking\n\n"); print("Options provided by ",$comp," can also be used by ",$wrapper,".\n\n"); - print("== COMPILER HELP ====================================\n"); + print("== ",uc $comp," HELP ============================\n"); } if ($dry_run == 1) { diff --git a/src/shmem_launcher_script.in b/src/shmem_launcher_script.in index 6ca3a1f32..fbd8f8c2c 100644 --- a/src/shmem_launcher_script.in +++ b/src/shmem_launcher_script.in @@ -13,8 +13,7 @@ SEARCH_LAUNCHERS="yod mpirun mpiexec srun" LAUNCHER="" -SOS_LAUNCHER_PATH="$0"; -SOS_LAUNCHER=${SOS_LAUNCHER_PATH##*/}; +SOS_LAUNCHER=`basename $0` # Users can set the OSHRUN_LAUNCHER environment variable to specify the command # that will be used by oshrun @@ -38,12 +37,14 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then fi if [ $want_help = 1 ]; then - printf "== Sandia OpenSHMEM Help ============================\n"; - printf "SOS LAUNCHER= ${SOS_LAUNCHER}\n"; + printf "== OSHRUN HELP ============================\n"; printf "usage: ${SOS_LAUNCHER} [options] [exec] [exec args]\n\n"; - printf "LAUNCHER= ${LAUNCHER}\n\n"; + printf "OSHRUN_LAUNCHER= ${SOS_LAUNCHER}\n\n"; + printf "Selected Launcher= ${LAUNCHER}\n\n"; + printf "${SOS_LAUNCHER} options:\n"; + printf "\t--help | -h Display this information\n\n"; printf "Options provided by ${LAUNCHER} can also be used by ${SOS_LAUNCHER}.\n\n"; - printf "== LAUNCHER HELP ====================================\n"; + printf "== ${LAUNCHER} HELP ====================================\n" | tr [a-z] [A-Z]; fi if [ -z "${LAUNCHER}" ]; then From 5afd70ff655823cbcc3eed646befc00c1544a39c Mon Sep 17 00:00:00 2001 From: Richard North III Date: Tue, 6 Jun 2017 15:13:31 -0500 Subject: [PATCH 07/10] Added recommended changes along with more cosmetic cleanup Signed-off-by: Richard North III --- src/shmem_compiler_script.in | 21 +++++++++++---------- src/shmem_launcher_script.in | 12 ++++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index 54880108a..fda56af5e 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -100,7 +100,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use File::Basename; +use File::Basename qw(basename); use File::Spec::Functions; my $includedir = "@WRAPPER_COMPILER_INCLUDEDIR@"; @@ -171,7 +171,7 @@ my @appargs = (); while (scalar(@args) > 0) { my $arg = shift(@args); - if ($arg eq "-showme") { + if ($arg eq "-showme" || $arg eq "-show") { $dry_run = 1; } else { if ($arg eq "-c") { @@ -221,16 +221,17 @@ if ($want_link == 1) { push(@exec_argv, split(' ', $libs)); } if ($want_help == 1) { - print("== ",uc $wrapper," HELP ============================\n"); - print("usage: ",$wrapper," [options]... file...\n\n"); - print("COMPILER= $comp\n\n"); + print("== ",uc $wrapper," HELP ===================================\n"); + print("usage: ",$wrapper," [",$wrapper,"_options] [compiler_arguments]\n\n"); + print("COMPILER = $comp\n\n"); print($wrapper," options:\n"); - print("\t--help | -h Display this information\n"); - print("\t-showme Print the command that would be ran without executing it\n"); - print("\t-E | -M Disable compilation and linking\n"); - print("\t-S Disable linking\n\n"); + print("\t--help | -h Display this information\n"); + print("\t-showme | -show Print the command that would be run without executing it\n"); + print("\t-E | -M Disable compilation and linking\n"); + print("\t-S Disable linking\n"); + print("\t-c Compile and assemble. Disable linking\n\n"); print("Options provided by ",$comp," can also be used by ",$wrapper,".\n\n"); - print("== ",uc $comp," HELP ============================\n"); + print("== ",uc $comp," HELP =====================================\n"); } if ($dry_run == 1) { diff --git a/src/shmem_launcher_script.in b/src/shmem_launcher_script.in index fbd8f8c2c..e7858c612 100644 --- a/src/shmem_launcher_script.in +++ b/src/shmem_launcher_script.in @@ -37,10 +37,14 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then fi if [ $want_help = 1 ]; then - printf "== OSHRUN HELP ============================\n"; - printf "usage: ${SOS_LAUNCHER} [options] [exec] [exec args]\n\n"; - printf "OSHRUN_LAUNCHER= ${SOS_LAUNCHER}\n\n"; - printf "Selected Launcher= ${LAUNCHER}\n\n"; + printf "== OSHRUN HELP ====================================\n"; + printf "usage: ${SOS_LAUNCHER} [oshrun_options] [launcher_arguments]\n\n"; + if [ -z "${OSHRUN_LAUNCHER}" ]; then + printf "OSHRUN_LAUNCHER = (none)\n\n"; + else + printf "OSHRUN_LAUNCHER = ${OSHRUN_LAUNCHER}\n\n"; + fi + printf "Selected launcher: ${LAUNCHER}\n\n"; printf "${SOS_LAUNCHER} options:\n"; printf "\t--help | -h Display this information\n\n"; printf "Options provided by ${LAUNCHER} can also be used by ${SOS_LAUNCHER}.\n\n"; From 8e0f81a69e16d015f4bcb7fd0e68e02fd79b6359 Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Wed, 7 Jun 2017 10:41:56 -0400 Subject: [PATCH 08/10] If passing -h, don't set passed arg to --help Signed-off-by: David M. Ozog --- src/shmem_compiler_script.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index fda56af5e..da3af17f4 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -182,7 +182,6 @@ while (scalar(@args) > 0) { $want_link = 0; $real_flag = 1; } elsif ($arg eq "-h" || $arg eq "--help") { - $arg = "--help"; $want_help = 1; $real_flag = 1; } elsif ($arg eq "-S") { From 22381e45e5c3bc7ddf9ac3a6006f5cb3dbcdd9d1 Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Wed, 7 Jun 2017 11:15:30 -0400 Subject: [PATCH 09/10] Revert commit 8e0f81a69e16d015f4bcb7fd0e68e02fd79b6359 Signed-off-by: David M. Ozog --- src/shmem_compiler_script.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index da3af17f4..fda56af5e 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -182,6 +182,7 @@ while (scalar(@args) > 0) { $want_link = 0; $real_flag = 1; } elsif ($arg eq "-h" || $arg eq "--help") { + $arg = "--help"; $want_help = 1; $real_flag = 1; } elsif ($arg eq "-S") { From f924981cb4f7956e8f93399dd1b96a1bb6e5b16a Mon Sep 17 00:00:00 2001 From: "David M. Ozog" Date: Wed, 7 Jun 2017 11:31:28 -0400 Subject: [PATCH 10/10] Remove support for '-h' in oshcc and friends Signed-off-by: David M. Ozog --- src/shmem_compiler_script.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shmem_compiler_script.in b/src/shmem_compiler_script.in index fda56af5e..1c6996def 100644 --- a/src/shmem_compiler_script.in +++ b/src/shmem_compiler_script.in @@ -181,8 +181,7 @@ while (scalar(@args) > 0) { $want_compile = 0; $want_link = 0; $real_flag = 1; - } elsif ($arg eq "-h" || $arg eq "--help") { - $arg = "--help"; + } elsif ($arg eq "--help") { $want_help = 1; $real_flag = 1; } elsif ($arg eq "-S") { @@ -225,7 +224,7 @@ if ($want_help == 1) { print("usage: ",$wrapper," [",$wrapper,"_options] [compiler_arguments]\n\n"); print("COMPILER = $comp\n\n"); print($wrapper," options:\n"); - print("\t--help | -h Display this information\n"); + print("\t--help Display this information\n"); print("\t-showme | -show Print the command that would be run without executing it\n"); print("\t-E | -M Disable compilation and linking\n"); print("\t-S Disable linking\n");