Skip to content

Commit

Permalink
test: cleanup
Browse files Browse the repository at this point in the history
Remove BG deadwoods from test programs

Add misaligned header comments

Refactor printing of launcher path
  • Loading branch information
dongahn committed Jul 18, 2018
1 parent 5bfca23 commit d24cc6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 62 deletions.
39 changes: 8 additions & 31 deletions test/src/fe_launch_middleware.cxx
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
/*
* $Header: $
*--------------------------------------------------------------------------------
* Copyright (c) 2008-2010, Lawrence Livermore National Security, LLC. Produced
*at
* Copyright (c) 2008, Lawrence Livermore National Security, LLC. Produced at
* the Lawrence Livermore National Laboratory. Written by Dong H. Ahn
*<[email protected]>.
* LLNL-CODE-409469. All rights reserved.
* <[email protected]>. LLNL-CODE-409469. All rights reserved.
*
* This file is part of LaunchMON. For details, see
* https://computing.llnl.gov/?set=resources&page=os_projects
*
* Please also read LICENSE.txt -- Our Notice and GNU Lesser General Public
*License.
* License.
*
*
* This program is free software; you can redistribute it and/or modify it under
*the
* terms of the GNU General Public License (as published by the Free Software
* Foundation) version 2.1 dated February 1999.
* the terms of the GNU General Public License (as published by the Free
* Software Foundation) version 2.1 dated February 1999.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
*ANY
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or
* ANY WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
*along
* with this program; if not, write to the Free Software Foundation, Inc., 59
*Temple
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*--------------------------------------------------------------------------------
*
*
*
* Update Log:
* Jul 18 2018 DHA: Add IBM JSM Spectrum support
* Jun 01 2012 DHA: Copied from 0.8-middleware-support branch and merged
Expand Down Expand Up @@ -142,17 +134,7 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup("--exe");
launcher_argv[6] = strdup(argv[1]);
// manually fill the block
// launcher_argv[7] = strdup("--block");
// launcher_argv[8] = strdup("R00-M0-N04");
// manually fill the corner
// launcher_argv[9] = strdup("--corner");
// launcher_argv[10] = strdup("R00-M0-N04-J07");
// manually fill the shape
// launcher_argv[11] = strdup("--shape");
// launcher_argv[12] = strdup("1x1x1x1x1");
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if ((rmenv_str == std::string("RC_bgq_slurm"))) {
launcher_argv = (char **)malloc(7 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
Expand All @@ -162,8 +144,6 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup(argv[1]);
launcher_argv[6] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n",
"mylauncher");
} else if ((rmenv_str == std::string("RC_bglrm")) ||
(rmenv_str == std::string("RC_bgprm"))) {
launcher_argv = (char **)malloc(8 * sizeof(char *));
Expand All @@ -175,7 +155,6 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup("-exe");
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_slurm")) {
numprocs_opt = string("-n") + string(argv[2]);
numnodes_opt = string("-N") + string(argv[3]);
Expand Down Expand Up @@ -205,15 +184,13 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup(argv[2]);
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_mpiexec_hydra")) {
launcher_argv = (char **)malloc(5 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
launcher_argv[1] = strdup("-n");
launcher_argv[2] = strdup(argv[2]);
launcher_argv[3] = strdup(argv[1]);
launcher_argv[4] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_ibm_spectrum")) {
numprocs_opt = string("-p") + string(argv[2]);
launcher_argv = (char **) malloc (4*sizeof(char*));
Expand Down
18 changes: 2 additions & 16 deletions test/src/fe_launch_smoketest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,7 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup("--exe");
launcher_argv[6] = strdup(argv[1]);
// manually fill the block
// launcher_argv[7] = strdup("--block");
// launcher_argv[8] = strdup("R00-M0-N04");
// manually fill the corner
// launcher_argv[9] = strdup("--corner");
// launcher_argv[10] = strdup("R00-M0-N04-J07");
// manually fill the shape
// launcher_argv[11] = strdup("--shape");
// launcher_argv[12] = strdup("1x1x1x1x1");
// launcher_argv[13] = NULL;
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if ((rmenv_str == std::string("RC_bgq_slurm"))) {
launcher_argv = (char **)malloc(7 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
Expand All @@ -189,8 +178,6 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup(argv[1]);
launcher_argv[6] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n",
"mylauncher");
} else if ((rmenv_str == std::string("RC_bglrm")) ||
(rmenv_str == std::string("RC_bgprm"))) {
launcher_argv = (char **)malloc(8 * sizeof(char *));
Expand All @@ -202,7 +189,6 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup("-exe");
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_slurm")) {
numprocs_opt = string("-n") + string(argv[2]);
numnodes_opt = string("-N") + string(argv[3]);
Expand Down Expand Up @@ -232,15 +218,13 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup(argv[2]);
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_mpiexec_hydra")) {
launcher_argv = (char **)malloc(5 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
launcher_argv[1] = strdup("-n");
launcher_argv[2] = strdup(argv[2]);
launcher_argv[3] = strdup(argv[1]);
launcher_argv[4] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_ibm_spectrum")) {
numprocs_opt = string("-p") + string(argv[2]);
launcher_argv = (char **) malloc (4*sizeof(char*));
Expand All @@ -254,6 +238,8 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}

fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);

if ((rc = LMON_fe_init(LMON_VERSION)) != LMON_OK) {
fprintf(stdout, "[LMON FE] FAILED\n");
return EXIT_FAILURE;
Expand Down
17 changes: 2 additions & 15 deletions test/src/fe_launch_usrpayload_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,7 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup("--exe");
launcher_argv[6] = strdup(argv[1]);
// manually fill the block
// launcher_argv[7] = strdup("--block");
// launcher_argv[8] = strdup("R00-M0-N04");
// manually fill the corner
// launcher_argv[9] = strdup("--corner");
// launcher_argv[10] = strdup("R00-M0-N04-J07");
// manually fill the shape
// launcher_argv[11] = strdup("--shape");
// launcher_argv[12] = strdup("1x1x1x1x1");
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if ((rmenv_str == std::string("RC_bgq_slurm"))) {
launcher_argv = (char **)malloc(7 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
Expand All @@ -222,8 +212,6 @@ int main(int argc, char *argv[]) {
launcher_argv[4] = strdup(argv[2]);
launcher_argv[5] = strdup(argv[1]);
launcher_argv[6] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n",
"mylauncher");
} else if ((rmenv_str == std::string("RC_bglrm")) ||
(rmenv_str == std::string("RC_bgprm"))) {
launcher_argv = (char **)malloc(8 * sizeof(char *));
Expand All @@ -235,7 +223,6 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup("-exe");
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_slurm")) {
numprocs_opt = string("-n") + string(argv[2]);
numnodes_opt = string("-N") + string(argv[3]);
Expand Down Expand Up @@ -265,15 +252,13 @@ int main(int argc, char *argv[]) {
launcher_argv[5] = strdup(argv[2]);
launcher_argv[6] = strdup(argv[1]);
launcher_argv[7] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_mpiexec_hydra")) {
launcher_argv = (char **)malloc(5 * sizeof(char *));
launcher_argv[0] = strdup(mylauncher);
launcher_argv[1] = strdup("-n");
launcher_argv[2] = strdup(argv[2]);
launcher_argv[3] = strdup(argv[1]);
launcher_argv[4] = NULL;
fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);
} else if (rmenv_str == std::string("RC_ibm_spectrum")) {
numprocs_opt = string("-p") + string(argv[2]);
launcher_argv = (char **) malloc (4*sizeof(char*));
Expand All @@ -283,6 +268,8 @@ int main(int argc, char *argv[]) {
launcher_argv[3] = NULL;
}

fprintf(stdout, "[LMON_FE] launching the job/daemons via %s\n", mylauncher);

if ((rc = LMON_fe_init(LMON_VERSION)) != LMON_OK) {
fprintf(stdout, "[LMON FE] LMON_fe_init FAILED\n");
return EXIT_FAILURE;
Expand Down

0 comments on commit d24cc6a

Please sign in to comment.