Skip to content

Commit

Permalink
Add gasnet-smp runwrapper to hpxrun.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Pansysk75 committed Nov 9, 2023
1 parent 833feac commit 240d266
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmake/HPX_AddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,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"
"gasnet" ${args}
"gasnet-smp" ${args}
)
set_tests_properties("${_full_name}" PROPERTIES RUN_SERIAL TRUE ENVIRONMENT
"PATH=${PROJECT_BINARY_DIR}/_deps/gasnet-src/install/bin:$ENV{PATH}")
Expand Down
24 changes: 16 additions & 8 deletions cmake/templates/hpxrun.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,18 @@ def run_mpi(cmd, localities, verbose):
print('Executing command: ' + ' '.join(exec_cmd))
subproc(exec_cmd)

# Run with amudprun
# This is executing amudprun with the "-np" option set to the number of localities
def run_gasnet(cmd, localities, verbose):
exec_cmd = ['amudprun', '-np', str(localities)] + cmd
if verbose:
print('Executing command: ' + ' '.join(exec_cmd))
subproc(exec_cmd)
os.environ['GASNET_QUIET'] = 'yes'
os.environ['GASNET_ROUTE_OUTPUT'] = '0'
run_mpi(cmd, localities, verbose)

def run_gasnet_smp(cmd, localities, verbose):
os.environ['GASNET_PSHM_NODES'] = str(localities)
os.environ['GASNET_BARRIER'] = 'PSHM'
os.environ['GASNET_QUIET'] = 'yes'
os.environ['GASNET_ROUTE_OUTPUT'] = '0'
# No launcher needed
run_none(cmd, localities, nodes, verbose)

# Run with srun
# This is executing srun with the '-n' option set to the number of localities
Expand Down Expand Up @@ -229,6 +234,9 @@ def run(cmd, runwrapper, localities, nodes, verbose):
if runwrapper == 'gasnet':
assert nodes is None, "nodes option only valid with tcp parcelport."
run_gasnet(cmd, localities, verbose)
if runwrapper == 'gasnet-smp':
assert nodes is None, "nodes option only valid with smp parcelport."
run_gasnet_smp(cmd, localities, verbose)
if runwrapper == 'srun':
assert nodes is None, "nodes option only valid with tcp parcelport."
run_srun(cmd, localities, verbose)
Expand Down Expand Up @@ -294,7 +302,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 == 'gasnet');
x == 'none' or x == 'mpi' or x == 'srun' or x =='jsrun' or x == 'gasnet' or x == 'gasnet-smp');
if not check_valid_runwrapper(options.runwrapper):
print('Error: Runwrapper option not valid\n', sys.stderr)
parser.print_help()
Expand Down Expand Up @@ -379,7 +387,7 @@ Used by the tcp parcelport only.
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, gasnet, srun, jsrun) '
, help='Which runwrapper to use (Options are: none, mpi, gasnet, gasnet-smp, srun, jsrun) '
'(environment variable HPXRUN_RUNWRAPPER)')

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

0 comments on commit 240d266

Please sign in to comment.