Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hpcbench/benchmark/babelstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def execution_matrix(self, context):

def _command(self, device):
cmd = [
find_executable(self.executable),
find_executable(self.executable, required=False),
'--device',
device
] + self.options
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/custream.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def execution_matrix(self, context):
for nthreads in self.blocksizes:
yield dict(
category=CUDAStream.name,
command=[find_executable(self.executable),
command=[find_executable(self.executable, required=False),
'-b', nthreads],
metas=dict(blocksizes=nthreads),
)
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/hpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def options(self):
@property
def command(self):
return [
find_executable(self.executable),
find_executable(self.executable, required=False),
] + self.options

def execution_matrix(self, context):
Expand Down
11 changes: 6 additions & 5 deletions hpcbench/benchmark/imb.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,17 @@ def execution_matrix(self, context):
for pair in IMB.host_pairs(context):
yield dict(
category=category,
command=[
find_executable(self.executable),
category
] + arguments,
command=[find_executable(self.executable,
required=False),
category] + arguments,
srun_nodes=pair,
)
else:
yield dict(
category=category,
command=[self.executable, category] + arguments,
command=[find_executable(self.executable,
required=False),
category] + arguments,
srun_nodes=self.srun_nodes
)

Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/ior.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _execution_matrix(self, api):
cmd = dict(
category=api,
command=[
find_executable(self.executable),
find_executable(self.executable, required=False),
'-a', api,
'-b', str(self.block_size),
] + self.options,
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def execution_matrix(self, context):
yield dict(
category=Iperf.DEFAULT_DEVICE,
command=self.mpirun + [
find_executable(self.executable),
find_executable(self.executable, required=False),
'-c',
self.server,
'-J',
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/nvidia.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def execution_matrix(self, context):
@property
def _command(self):
cmd = [
find_executable(self.executable),
find_executable(self.executable, required=False),
'--device',
str(self.device),
'--mode',
Expand Down
6 changes: 4 additions & 2 deletions hpcbench/benchmark/osu.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def execution_matrix(self, context):
context.logger.warn('Category %s does not support '
'SLURM implicit nodes', category)
else:
executable = find_executable(self.executable(category))
executable = find_executable(self.executable(category),
required=False)
for pair in OSU.host_pairs(context):
yield dict(
category=category,
Expand All @@ -266,7 +267,8 @@ def execution_matrix(self, context):
else:
yield dict(
category=category,
command=[find_executable(self.executable(category))]
command=[find_executable(self.executable(category),
required=False)]
+ arguments,
srun_nodes=self.srun_nodes
)
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/shoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def execution_matrix(self, context):
@property
def command(self):
return [
find_executable(self.executable), '-cuda',
find_executable(self.executable, required=False), '-cuda',
'-d', self.device,
'-s', self.size,
] + self.options
Expand Down
2 changes: 1 addition & 1 deletion hpcbench/benchmark/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def execution_matrix(self, context):
for thread in self.threads:
yield dict(
category=Stream.name,
command=[find_executable(self.executable)],
command=[find_executable(self.executable, required=False)],
metas=dict(threads=thread),
environment=dict(
OMP_NUM_THREADS=thread,
Expand Down
5 changes: 4 additions & 1 deletion hpcbench/toolbox/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def find_executable(name, names=None, required=True):
>>> find_executable('sed', names=['gsed'])

required: If True, then the function raises an Exception
if the program is not found.
if the program is not found else the function returns name if
the program is not found.
"""
path_from_env = os.environ.get(name.upper())
if path_from_env is not None:
Expand All @@ -47,6 +48,8 @@ def find_executable(name, names=None, required=True):
return eax
if required:
raise NameError('Could not find %s executable' % name)
else:
return name


def physical_cpus():
Expand Down
6 changes: 3 additions & 3 deletions tests/toolbox/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ def test_process_find(self):
os.environ['ELLESSE'] = '/usr/bin/elesse'
try:
self.assertEqual(find_executable('ellesse'), '/usr/bin/elesse')
self.assertIsNone(find_executable('elaisse', ['elesse'],
required=False))
self.assertEqual(find_executable('elaisse', ['elesse'],
required=False), 'elaisse')
finally:
os.environ.pop('ELLESSE')

def test_process_not_found(self):
self.assertIsNone(find_executable('ellesse', required=False))
self.assertEqual(find_executable('ellesse', required=False), 'ellesse')
with self.assertRaises(NameError):
find_executable('ellesse')
find_executable('ellesse', ['elaisse'])