Permalink
Browse files

Adjust thread tester for mac plugins

  • Loading branch information...
loriab committed Jun 27, 2018
1 parent 917b31f commit df0e368b4d0995e40713f5f8d0221ebe97f70c32
Showing with 10 additions and 4 deletions.
  1. +2 −2 codemeta.json
  2. +8 −2 psi4/share/psi4/scripts/test_threading.py
@@ -237,15 +237,15 @@
"@type": "Person",
"givenName": "Peter",
"familyName": "Kraus",
"affiliation": "Liebniz University, Hannover, Germany",
"affiliation": "Leibniz University, Hannover, Germany",
"@id": "https://orcid.org/0000-0002-4359-5003",
"@id": "https://github.com/PeterKraus"
},
{
"@type": "Person",
"givenName": "Holger",
"familyName": "Kruse",
"affiliation": "Institute of Biophysics, Czech Republic",
"affiliation": "Institute of Biophysics of the CAS, v.v.i., Czech Republic",
"@id": "https://orcid.org/0000-0002-0560-1513",
"@id": "https://github.com/hokru"
},
@@ -197,20 +197,26 @@ def print_math_ldd(args):
print('Not available w/o `ldd` or `otool`')
return True
cmd = """{} {} | grep -e ':' -e 'mkl' -e 'openblas' -e 'iomp5' -e 'gomp'""".format(lddish, modcore)
cmd = """{} {} | grep -e ':' -e 'mkl' -e 'openblas' -e 'iomp5' -e 'gomp' -e 'libomp'""".format(lddish, modcore)
print('Running {} ...'.format(cmd))
subprocess.call(cmd, shell=True)
lddout = subprocess.getoutput(cmd)
report = {'mkl': lddout.count('libmkl'),
'iomp5': lddout.count('libiomp5'),
'openblas': lddout.count('libopenblas'),
'omp': lddout.count('libomp'),
'gomp': lddout.count('libgomp')}
print(report)
report = {k : bool(v) for k, v in report.items()}
okmkl = report['mkl'] and report['iomp5'] and not report['openblas'] and not report['gomp']
okiomp5 = not report['mkl'] and report['iomp5'] and not report['openblas'] and not report['gomp']
okopenblas = not report['mkl'] and not report['iomp5'] and report['openblas'] and report['gomp']
if args.passfail:
assert okmkl != okopenblas
if sys.platform.startswith('linux'):
assert okmkl != okopenblas
elif sys.platform.startswith('darwin'):
# plugins on Mac won't show mkl through otool (linked to psi4.core)
assert (okmkl != okopenblas) or (okiomp5 != okopenblas)
if __name__ == '__main__':

0 comments on commit df0e368

Please sign in to comment.