Skip to content

Commit

Permalink
correcting issues with gasnet and openshmem unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-clmsn committed Apr 13, 2024
1 parent f1e0b2c commit 0aa14d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 deletions.
4 changes: 2 additions & 2 deletions cmake/HPX_AddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function(add_hpx_test category name)
if(_add_test)
set(_full_name "${category}.distributed.gasnet.${name}")
add_test(NAME "${_full_name}" COMMAND ${cmd} "-p" "gasnet" "-r"
"amudprun" ${args}
"srun" ${args}
)
set_tests_properties(
"${_full_name}"
Expand Down Expand Up @@ -231,7 +231,7 @@ function(add_hpx_test category name)
if(_add_test)
set(_full_name "${category}.distributed.openshmem.${name}")
add_test(NAME "${_full_name}" COMMAND ${cmd} "-p" "openshmem" "-r"
"oshrun" ${args}
"srun" ${args}
)
if(${name}_TIMEOUT)
set_tests_properties(
Expand Down
35 changes: 3 additions & 32 deletions cmake/templates/hpxrun.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,6 @@ def run_none(cmd, localities, nodes, verbose):
subproc(cmd)


def run_amudprun(cmd, localities, nodes, verbose):
assert len(nodes) == localities, "Number of localities must match number of nodes."
os.environ['GASNET_SPAWNFN'] = 'S'
os.environ['GASNET_SSH_SERVERS'] = ' '.join([ str(node) for node in nodes ])
os.environ['SSH_SERVERS'] = os.environ['GASNET_SSH_SERVERS']
os.environ['GASNET_ROUTE_OUTPUT'] = '0'

exec_cmd = ['amudprun', '-np', len(nodes), cmd]

if verbose:
print('Executing command: ' + ' '.join(exec_cmd))
subproc(exec_cmd)

# Run with mpiexec
# This is executing mpiexec with the "-np" option set to the number of localities
def run_mpi(cmd, localities, verbose):
Expand All @@ -209,21 +196,7 @@ def run_mpi(cmd, localities, verbose):
print('Executing command: ' + ' '.join(exec_cmd))
subproc(exec_cmd)

def run_amudprun(cmd, localities, nodes, verbose):
assert len(nodes) == localities, "Number of localities must match number of nodes."
os.environ['GASNET_SPAWNFN'] = 'S'
os.environ['GASNET_SSH_SERVERS'] = ' '.join([ str(node) for node in nodes ])
os.environ['SSH_SERVERS'] = os.environ['GASNET_SSH_SERVERS']
os.environ['GASNET_ROUTE_OUTPUT'] = '0'

exec_cmd = ['amudprun', '-np', len(nodes), cmd]

if verbose:
print('Executing command: ' + ' '.join(exec_cmd))
subproc(exec_cmd)

# Run with oshrun
# This is executing amudprun with the "-np" option set to the number of localities
def run_oshrun(cmd, localities, verbose):
exec_cmd = ['oshrun', '-np', str(localities)] + cmd
if verbose:
Expand Down Expand Up @@ -253,8 +226,6 @@ def run(cmd, runwrapper, localities, nodes, verbose):
if runwrapper == 'mpi':
assert nodes is None, "nodes option only valid with tcp parcelport."
run_mpi(cmd, localities, verbose)
if runwrapper == 'amudprun':
run_amudprun(cmd, localities, nodes, verbose)
if runwrapper == 'oshrun':
assert nodes is None, "nodes option only valid with tcp parcelport."
run_oshrun(cmd, localities, verbose)
Expand Down Expand Up @@ -324,7 +295,7 @@ def check_options(parser, options, args):
sys.exit(1)

check_valid_runwrapper = (lambda x:
x == 'none' or x == 'mpi' or x == 'srun' or x =='jsrun' or x == 'amudprun' or x == 'oshrun');
x == 'none' or x == 'mpi' or x == 'srun' or x =='jsrun' or x == 'oshrun');
if not check_valid_runwrapper(options.runwrapper):
print('Error: Runwrapper option not valid\n', sys.stderr)
parser.print_help()
Expand Down Expand Up @@ -403,13 +374,13 @@ Used by the tcp parcelport only.
parser.add_option('-p', '--parcelport'
, action='store', type='string'
, dest='parcelport', default=default_env('HPXRUN_PARCELPORT', 'tcp')
, help='Which parcelport to use (Options are: mpi, lci, openshmem, gasnet, tcp) '
, help='Which parcelport to use (Options are: mpi, lci, openshmem, tcp) '
'(environment variable HPXRUN_PARCELPORT')

parser.add_option('-r', '--runwrapper'
, action='store', type='string'
, dest='runwrapper', default=default_env('HPXRUN_RUNWRAPPER', 'none')
, help='Which runwrapper to use (Options are: none, mpi, oshrun, amudprun, srun, jsrun) '
, help='Which runwrapper to use (Options are: none, mpi, oshrun, srun, jsrun) '
'(environment variable HPXRUN_RUNWRAPPER)')

parser.add_option('-e', '--expected'
Expand Down

0 comments on commit 0aa14d0

Please sign in to comment.