Skip to content

Commit

Permalink
Add unload_module function back (#48)
Browse files Browse the repository at this point in the history
This was originally removed from NERSC fork but is added back. The
assumption was that darshan and cray-libsci were being unloaded but
they were not. This should fix the import errors
  • Loading branch information
mamelara committed May 15, 2019
1 parent e697b38 commit dcbb042
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/spack/spack/build_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
from spack.util.environment import system_dirs
from spack.error import NoLibrariesError, NoHeadersError
from spack.util.executable import Executable
from spack.util.module_cmd import load_module, get_path_from_module
from spack.util.module_cmd import (load_module, get_path_from_module,
unload_module)
from spack.util.log_parse import parse_log_events, make_log_context


Expand Down
5 changes: 5 additions & 0 deletions lib/spack/spack/util/module_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def module(*args):
return str(module_p.communicate()[0].decode())


def unload_module(mod):
"""Takes a module name and removes the module"""
module("unload", mod)


def load_module(mod):
"""Takes a module name and removes modules until it is possible to
load that module. It then loads the provided module. Depends on the
Expand Down

0 comments on commit dcbb042

Please sign in to comment.