@@ -16,12 +16,11 @@ def __init__(self):
1616
1717@rfm .required_version ('>=2.14' )
1818@rfm .parameterized_test (['craype-accel-nvidia35' ], ['craype-accel-nvidia60' ])
19- class Nvidia35ResolveTest (LibSciResolveBaseTest ):
19+ class NvidiaResolveTest (LibSciResolveBaseTest ):
2020 def __init__ (self , module_name ):
2121 super ().__init__ ()
2222 self .descr = 'Module %s resolves libsci_acc' % module_name
2323 self .build_system = 'SingleSource'
24- self .build_system .fflags = ['-Wl,-ypdgemm_' ]
2524
2625 self .module_name = module_name
2726 self .module_version = {
@@ -41,30 +40,36 @@ def __init__(self, module_name):
4140 'PrgEnv-gnu' : 'gnu'
4241 }
4342
43+ # FIXME Flags '-Wl,-ydgemm_' which are passed to the linker do not
44+ # produce any output when xalt/2.7.10 is loaded, thus we use readelf
45+ # to find the dynamic libraries of the executable
46+ # self.build_system.fflags = ['-Wl,-ydgemm_']
47+ self .postbuild_cmd = ['readelf -d %s' % self .executable ]
48+
4449 def setup (self , partition , environ , ** job_opts ):
4550 super ().setup (partition , environ , ** job_opts )
4651
4752 # here lib_name is in the format: libsci_acc_gnu_48_nv35.so or
4853 # libsci_acc_cray_nv35.so
49- regex = (r'libsci_acc_(?P<prgenv>[A-Za-z]+)_((?P<cver>[A-Za-z0-9]+)_)? '
50- r'(?P<version>\S+)(?=(\.a)|( \.so)) ' )
54+ regex = (r'.*\(NEEDED\).* libsci_acc_(?P<prgenv>[A-Za-z]+)_'
55+ r'(( ?P<cver>[A-Za-z0-9]+)_)?(?P<version>\S+) \.so' )
5156 prgenv = self .prgenv_names [self .current_environ .name ]
5257 cver = self .compiler_version .get (self .current_system .name ,
5358 self .compiler_version_default )
5459 mod_name = self .module_version [self .module_name ]
5560
5661 if self .current_environ .name == 'PrgEnv-cray' :
57- cver_sanity = sn .assert_found (regex , self .stderr )
62+ cver_sanity = sn .assert_found (regex , self .stdout )
5863 else :
5964 cver_sanity = sn .assert_eq (
60- sn .extractsingle (regex , self .stderr , 'cver' ), cver )
65+ sn .extractsingle (regex , self .stdout , 'cver' ), cver )
6166
6267 self .sanity_patterns = sn .all ([
6368 sn .assert_eq (
64- sn .extractsingle (regex , self .stderr , 'prgenv' ), prgenv ),
69+ sn .extractsingle (regex , self .stdout , 'prgenv' ), prgenv ),
6570 cver_sanity ,
6671 sn .assert_eq (
67- sn .extractsingle (regex , self .stderr , 'version' ), mod_name )
72+ sn .extractsingle (regex , self .stdout , 'version' ), mod_name )
6873 ])
6974
7075
@@ -76,18 +81,20 @@ def __init__(self):
7681 self .descr = '-mkl Resolves to MKL'
7782 self .valid_prog_environs = ['PrgEnv-intel' ]
7883 self .build_system = 'SingleSource'
79- self .build_system .fflags = ['-Wl,-ydgemm_' , '-mkl' ]
8084
81- # interesting enough, on Dora the linking here is static.
82- # So there is REAL need for the end term (?=(.a)|(.so)).
83- # not sure if we need to check against the version here
84- regex = (r'libmkl_(?P<prgenv>[A-Za-z]+)_(?P<version>\S+)'
85- r'(?=(.a)|(.so))' )
85+ # FIXME Flags '-Wl,-ydgemm_' which are passed to the linker do not
86+ # produce any output when xalt/2.7.10 is loaded, thus we use readelf
87+ # to find the dynamic libraries of the executable
88+ # self.build_system.fflags = ['-Wl,-ydgemm_', '-mkl']
89+ self .build_system .fflags = ['-mkl' ]
90+ self .postbuild_cmd = ['readelf -d %s' % self .executable ]
91+ regex = (r'.*\(NEEDED\).*libmkl_(?P<prgenv>[A-Za-z]+)_(?P<version>\S+)'
92+ r'\.so' )
8693 self .sanity_patterns = sn .all ([
8794 sn .assert_eq (
88- sn .extractsingle (regex , self .stderr , 'prgenv' ), 'intel' ),
95+ sn .extractsingle (regex , self .stdout , 'prgenv' ), 'intel' ),
8996 sn .assert_eq (
90- sn .extractsingle (regex , self .stderr , 'version' ), 'lp64' )
97+ sn .extractsingle (regex , self .stdout , 'version' ), 'lp64' )
9198 ])
9299
93100 self .maintainers = ['AJ' ]
0 commit comments