Skip to content

Commit

Permalink
Cleanup several bugs that prevented the Python client from executing …
Browse files Browse the repository at this point in the history
…cleanly:

* do not require a .ini file just to ask for --list-stages and other info cmds

* move the compiler output line to debug prints

* properly parse the OMPI cmd line into a list

* properly call MPI_Finalize at the end of mpi_get_version so we don't segfault
  • Loading branch information
Ralph Castain committed Aug 26, 2016
1 parent 0a8f18f commit 30a7d6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyclient/pymtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# define the cmd line arguments
parser = argparse.ArgumentParser(description="usage: %prog [options] testfile1 testfile2 ...")

parser.add_argument('ini_files', action='append', metavar='FILE', nargs='+', help = ".ini file to be used")
parser.add_argument('ini_files', action='append', metavar='FILE', nargs='*', help = ".ini file to be used")

infoGroup = parser.add_argument_group('InfoGroup','Informational Options')
infoGroup.add_argument("-v", "--version",
Expand Down
2 changes: 1 addition & 1 deletion pylib/Tools/Build/Autotools.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def execute(self, log, keyvals, testDef):
compilerLog = {}
plugin.execute(compilerLog, testDef)
log['compiler'] = compilerLog
print(log['compiler'])
testDef.logger.verbose_print(log['compiler'])

# Find MPI information for IUDatabase plugin
plugin = None
Expand Down
9 changes: 5 additions & 4 deletions pylib/Tools/Launcher/OpenMPI.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def execute(self, log, keyvals, testDef):
# transfer the findings into our local storage
keys = list(self.options.keys())
optkeys = list(myopts.keys())
print ("OMPI OPTIONS: " + myopts['command'])
for optkey in optkeys:
for key in keys:
if key == optkey:
Expand Down Expand Up @@ -228,8 +229,8 @@ def execute(self, log, keyvals, testDef):
# get the "skip" exit status
skipStatus = int(cmds['skipped'])
# assemble the command
cmdargs = [cmds['command']]
if cmds['np'] is not None:
cmdargs = cmds['command'].split()
if ['np'] is not None:
cmdargs.append("-np")
cmdargs.append(cmds['np'])
if cmds['hostfile'] is not None:
Expand Down Expand Up @@ -276,8 +277,8 @@ def execute(self, log, keyvals, testDef):
log['numSkip'] = numSkip
log['numFail'] = numFail
try:
log['np'] = cmds['np']
log['np'] = cmds['np']
except KeyError:
log['np'] = None
log['np'] = None
os.chdir(cwd)
return
9 changes: 5 additions & 4 deletions pylib/Utilities/MPIVersion.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def execute(self, log, testDef):
log['name'] = 'None'
log['version'] = 'Unknown'
return

name = None
version = None

Expand All @@ -60,7 +60,7 @@ def execute(self, log, testDef):
name = 'MVAPICH2'
version = version_str.split('MVAPICH2 Version')[1].split(':')[1].split('\n')[0].strip()
# Intel MPI
# Example Output:
# Example Output:
# Intel(R) MPI Library 5.1.3 for Linux* OS
elif 'Intel' in version_str:
name = 'Intel MPI'
Expand All @@ -87,10 +87,11 @@ def get_version_string(self, testDef):
#include <stdio.h>
int main(int argc, char **argv) {
MPI_Init(NULL, NULL);
char version[1000];
char version[3000];
int resultlen;
MPI_Get_library_version(version, &resultlen);
printf("%s\\n", version);
MPI_Finalize();
return 0;
}""")
fh.close()
Expand All @@ -107,7 +108,7 @@ def get_version_string(self, testDef):
if os.path.exists("mpi_get_version.c"): os.remove("mpi_get_version.c")
os.chdir("..")
return None

if os.path.exists("mpi_get_version"): os.remove("mpi_get_version")
if os.path.exists("mpi_get_version.c"): os.remove("mpi_get_version.c")
os.chdir("..")
Expand Down

0 comments on commit 30a7d6b

Please sign in to comment.