Skip to content

Commit

Permalink
enable support for various VOL connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbez committed Aug 17, 2023
1 parent fef9000 commit 54192b5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/h5bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ def prepare_vol(self, vol):
if 'LD_PRELOAD' in self.vol_environment:
self.logger.debug('LD_PRELOAD: %s', self.vol_environment['LD_PRELOAD'])

def has_vol(self, vol):
"""Check if a VOL connector has been defined."""
if 'connector' in vol:
return True

return False

def enable_vol(self, vol):
"""Enable VOL by setting the connector."""
if 'connector' in vol:
Expand Down Expand Up @@ -357,7 +364,7 @@ def run_pattern(self, id, operation, setup, vol):
# Disable any user-defined VOL connectors as we will be handling that
self.disable_vol(vol)

if configuration['MODE'] in ['ASYNC', 'LOG']:
if self.has_vol(vol):
self.enable_vol(vol)

configuration_file = '{}/{}/h5bench.cfg'.format(self.directory, id)
Expand Down Expand Up @@ -437,7 +444,7 @@ def run_pattern(self, id, operation, setup, vol):

end = time.time()

if configuration['MODE'] in ['ASYNC', 'LOG']:
if self.has_vol(vol):
self.disable_vol(vol)

if self.validate:
Expand Down Expand Up @@ -632,7 +639,7 @@ def run_amrex(self, id, setup, vol):
# Disable any user-defined VOL connectors as we will be handling that
self.disable_vol(vol)

if configuration['mode'] in ['ASYNC', 'LOG']:
if self.has_vol(vol):
self.enable_vol(vol)

binary = self.H5BENCH_AMREX_ASYNC
Expand Down Expand Up @@ -699,7 +706,7 @@ def run_amrex(self, id, setup, vol):

end = time.time()

if configuration['mode'] in ['ASYNC', 'LOG']:
if self.has_vol(vol):
self.disable_vol(vol)

self.logger.info('Runtime: {:.7f} seconds (elapsed time, includes allocation wait time)'.format(end - start))
Expand Down

0 comments on commit 54192b5

Please sign in to comment.