Skip to content

Commit

Permalink
Debugging stuff to be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed Nov 28, 2019
1 parent 401309d commit fbb6b32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions payu/envmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def setup(basepath=DEFAULT_BASEPATH):
os.environ['MODULE_VERSION_STACK'] = module_version
os.environ['MODULESHOME'] = moduleshome

print(os.environ)

if 'MODULEPATH' not in os.environ:
module_initpath = os.path.join(moduleshome, 'init', '.modulespath')
with open(module_initpath) as initpaths:
Expand Down Expand Up @@ -82,6 +84,8 @@ def module(command, *args):

cmd = '{0} python {1} {2}'.format(modulecmd, command, ' '.join(args))

print(cmd)

envs, _ = subprocess.Popen(shlex.split(cmd),
stdout=subprocess.PIPE).communicate()
exec(envs)
Expand All @@ -105,6 +109,8 @@ def lib_update(bin_path, lib_name):
# pylint: disable=unbalanced-tuple-unpacking
mod_name, mod_version = fsops.splitpath(lib_path)[2:4]

print(mod_name, mod_version, lib_path)

module('unload', mod_name)
module('load', os.path.join(mod_name, mod_version))
return '{0}/{1}'.format(mod_name, mod_version)
Expand Down
1 change: 1 addition & 0 deletions payu/subcommands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def runcmd(model_type, config_path, init_run, n_runs, lab_path, reproduce):

def runscript():

print('modulepath = {}'.format(os.environ.get('MODULEPATH',None)))
parser = argparse.ArgumentParser()
for arg in arguments:
parser.add_argument(*arg['flags'], **arg['parameters'])
Expand Down

0 comments on commit fbb6b32

Please sign in to comment.