From 0481072162008e84d8be49a3483b03fd96217393 Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Thu, 6 Feb 2020 14:19:22 +1100 Subject: [PATCH 1/3] Added is_conda function to fsops and used to detect conda environment and not muck about with LD_LIBRARY_PATH --- payu/cli.py | 9 ++++++--- payu/fsops.py | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/payu/cli.py b/payu/cli.py index 8ca34474..64dfc8f6 100644 --- a/payu/cli.py +++ b/payu/cli.py @@ -18,6 +18,7 @@ import payu import payu.envmod as envmod +from payu.fsops import is_conda from payu.models import index as supported_models import payu.subcommands from payu.scheduler.pbs import generate_command @@ -83,9 +84,11 @@ def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None, """Construct the environment variables used by payu for resubmissions.""" payu_env_vars = {} - # Setup Python dynamic library link - lib_paths = sysconfig.get_config_vars('LIBDIR') - payu_env_vars['LD_LIBRARY_PATH'] = ':'.join(lib_paths) + if not is_conda(): + # Setup Python dynamic library link + lib_paths = sysconfig.get_config_vars('LIBDIR') + payu_env_vars['LD_LIBRARY_PATH'] = ':'.join(lib_paths) + if 'PYTHONPATH' in os.environ: payu_env_vars['PYTHONPATH'] = os.environ['PYTHONPATH'] diff --git a/payu/fsops.py b/payu/fsops.py index 1f0e822b..f365d4df 100644 --- a/payu/fsops.py +++ b/payu/fsops.py @@ -10,6 +10,7 @@ # Standard library import errno import os +import sys # Extensions import yaml @@ -134,3 +135,9 @@ def check_exe_path(payu_path, pbs_script): assert os.path.isfile(pbs_script) return pbs_script + + +def is_conda(): + """Return True if python interpreter is in a conda environment""" + + return os.path.exists(os.path.join(sys.prefix, 'conda-meta')) \ No newline at end of file From a458593b93738f54d0226f8eabfc61a6c5346a9b Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Thu, 6 Feb 2020 14:51:11 +1100 Subject: [PATCH 2/3] PEP8 fix --- payu/fsops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payu/fsops.py b/payu/fsops.py index f365d4df..78a37f6d 100644 --- a/payu/fsops.py +++ b/payu/fsops.py @@ -140,4 +140,4 @@ def check_exe_path(payu_path, pbs_script): def is_conda(): """Return True if python interpreter is in a conda environment""" - return os.path.exists(os.path.join(sys.prefix, 'conda-meta')) \ No newline at end of file + return os.path.exists(os.path.join(sys.prefix, 'conda-meta')) From f49898e43f41518926057f5a7503a6a076e788ad Mon Sep 17 00:00:00 2001 From: Aidan Heerdegen Date: Thu, 6 Feb 2020 15:14:29 +1100 Subject: [PATCH 3/3] Changed default nodesize and memory to 48 and 192GB respectively as these are the default values for gadi --- payu/subcommands/run_cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/payu/subcommands/run_cmd.py b/payu/subcommands/run_cmd.py index a8b67284..72bec5d9 100644 --- a/payu/subcommands/run_cmd.py +++ b/payu/subcommands/run_cmd.py @@ -29,8 +29,8 @@ def runcmd(model_type, config_path, init_run, n_runs, lab_path, reproduce): # TODO: Create drivers for servers platform = pbs_config.get('platform', {}) - max_cpus_per_node = platform.get('nodesize', 16) - max_ram_per_node = platform.get('nodemem', 32) + max_cpus_per_node = platform.get('nodesize', 48) + max_ram_per_node = platform.get('nodemem', 192) # Adjust the CPUs for any model-specific settings # TODO: Incorporate this into the Model driver