13 from BaseMTTUtility
import *
23 BaseMTTUtility.__init__(self)
31 lines = testDef.printOptions(self.
options)
40 if version_str
is None:
42 log[
'version'] =
'Unknown'
51 if 'Open MPI' in version_str:
53 version = version_str.split(
'Open MPI v')[1].split(
', ')[0]
65 elif 'MVAPICH2' in version_str:
67 version = version_str.split(
'MVAPICH2 Version')[1].split(
':')[1].split(
"'")[0].split(
"\\t")[1]
71 elif 'Intel' in version_str:
73 version = version_str.split(
'Intel(R) MPI Library ')[1].split(
' ')[0]
75 elif 'CRAY MPICH' in version_str:
77 version = version_str.split(
'CRAY MPICH version ')[1].split(
' ')[0]
80 log[
'name'] = str(name)
81 log[
'version'] = str(version)
85 os.chdir(testDef.options[
'scratchdir'])
88 fh = open(
"mpi_get_version.c",
"r")
91 fh = open(
"mpi_get_version.c",
"w")
93 /* This program is automatically generated by MPIVersion.py
94 * of MPI Testing Tool (MTT). Any changes you make here may
96 * Copyrights and licenses of this file are the same as for the MTT.
100 int main(int argc, char **argv) {
103 MPI_Get_library_version(version, &resultlen);
104 printf("%s\\n", version);
108 status, _, _, _ = testDef.execmd.execute(
None, shlex.split(
'mpicc -o mpi_get_version mpi_get_version.c'), testDef)
110 status, _, _, _ = testDef.execmd.execute(
None, shlex.split(
'cc -o mpi_get_version mpi_get_version.c'), testDef)
115 status, stdout, _, _ = testDef.execmd.execute(
None, shlex.split(
'sh -c "mpiexec ./mpi_get_version |uniq -c"'), testDef)
117 status, stdout, _, _ = testDef.execmd.execute(
None, shlex.split(
'sh -c "aprun ./mpi_get_version |uniq -c"'), testDef)
119 status, stdout, _, _ = testDef.execmd.execute(
None, shlex.split(
'sh -c "./mpi_get_version |uniq -c"'), testDef)
126 return "\n".join(stdout)