Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set OPENMP=true in load script by default #364

Merged
merged 1 commit into from
Apr 21, 2022
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
13 changes: 10 additions & 3 deletions conda/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def build_spack_env(config, update_spack, machine, compiler, mpi, env_name,

def write_load_compass(template_path, activ_path, conda_base, env_type,
activ_suffix, prefix, env_name, spack_script, machine,
env_vars, env_only, source_path):
env_vars, env_only, source_path, without_openmp):

try:
os.makedirs(activ_path)
Expand All @@ -382,7 +382,14 @@ def write_load_compass(template_path, activ_path, conda_base, env_type,

if not env_only:
env_vars = f'{env_vars}\n' \
f'export USE_PIO2=true'
f'export USE_PIO2=true'
if without_openmp:
env_vars = f'{env_vars}\n' \
f'export OPENMP=false'
else:
env_vars = f'{env_vars}\n' \
f'export OPENMP=true'

env_vars = f'{env_vars}\n' \
f'export HDF5_USE_FILE_LOCKING=FALSE\n' \
f'export LOAD_COMPASS_ENV={script_filename}'
Expand Down Expand Up @@ -726,7 +733,7 @@ def main():
script_filename = write_load_compass(
conda_template_path, activ_path, conda_base, env_type, activ_suffix,
prefix, env_name, spack_script, machine, env_vars, args.env_only,
source_path)
source_path, args.without_openmp)

if args.check:
check_env(script_filename, env_name)
Expand Down
5 changes: 5 additions & 0 deletions conda/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def parse_args(bootstrap):
action='store_true',
help="Whether to include albany in the spack "
"environment")
parser.add_argument("--without_openmp", dest="without_openmp",
action='store_true',
help="If this flag is included, OPENMP=true will not "
"be added to the load script. By default, MPAS "
"builds will be with OpenMP.")
if bootstrap:
parser.add_argument("--local_conda_build", dest="local_conda_build",
type=str,
Expand Down