Skip to content

Commit

Permalink
Merge pull request open-mpi#466 from rhc54/topic/cleanup
Browse files Browse the repository at this point in the history
Cleanup several bugs that prevented the Python client from executing cleanly:
  • Loading branch information
rhc54 authored Aug 27, 2016
2 parents 0a8f18f + 6e3f5a9 commit 2c92b26
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 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
12 changes: 6 additions & 6 deletions pylib/Stages/Reporter/IUDatabase.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ def execute(self, log, keyvals, testDef):
return
try:
if cmds['pwfile'] is not None:
if os.path.exists(cmds['pwfile'][0]):
f = open(cmds['pwfile'][0], 'r')
if os.path.exists(cmds['pwfile']):
f = open(cmds['pwfile'], 'r')
password = f.readline().strip()
f.close()
else:
log['status'] = 1;
log['stderr'] = "Password file " + cmds['pwfile'][0] + " does not exist"
log['stderr'] = "Password file " + cmds['pwfile'] + " does not exist"
return
elif cmds['password'] is not None:
password = cmds['password']
except KeyError:
try:
if cmds['password'] is not None:
password = cmds['password'][0]
password = cmds['password']
except KeyError:
pass
#
Expand Down Expand Up @@ -340,7 +340,7 @@ def _submit_test_build(self, logger, lg, metadata, s, url, httpauth=None):
for entry in full_log:
if 'compiler' in entry:
data['compiler_name'] = entry['compiler']['compiler']
data['compiler_version'] = entry['compiler']['version']
data['compiler_version'] = entry['compiler']['version']
break
else:
data['compiler_name'] = None
Expand Down Expand Up @@ -481,7 +481,7 @@ def _submit_install(self, logger, lg, metadata, s, url, httpauth=None):
for entry in full_log:
if 'compiler' in entry:
data['compiler_name'] = entry['compiler']['compiler']
data['compiler_version'] = entry['compiler']['version']
data['compiler_version'] = entry['compiler']['version']
break
else:
data['compiler_name'] = None
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
8 changes: 4 additions & 4 deletions pylib/Tools/Launcher/OpenMPI.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,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 +276,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 2c92b26

Please sign in to comment.