Skip to content

Commit

Permalink
Edit module loading config in node_search.sh
Browse files Browse the repository at this point in the history
Instead of always loading a python3 module which may spit
annoying messages to the screen, a check is performed if python3
is already in the path. If so, a module is not loaded.
  • Loading branch information
CodyKank committed Jul 9, 2018
1 parent 9b74286 commit 9bb3276
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
pain to have to load the python 3 module everytime you wanted check the
status of a job, so this bash script sets up the environment temporarily
to run Python 3 scripts. The only configuration needed with this is to
properly specifiy the full path for the actual python 3 script and to edit the
paths for the useful module information to properly grab a version of Python 3.
properly specifiy the full path for the actual python 3 script. Occasionally,
the python3 module which is loaded will also have to be updated depending on
when a module is deprecated.

* node_search was developed for a specific environment. If you are attempting to
use it for your own organization, there may be a few hiccups. In theory, as long
Expand Down
7 changes: 5 additions & 2 deletions node_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
# line 11 must be changed to load a correct version of python. As of July 5, 2018 python/3.6.4
# is the latest version of python.

source /opt/crc/Modules/current/init/bash

module load python/3.6.4
path_to_python3=$(which python3 2>/dev/null)
if [ ! -x "$path_to_python3" ] ; then
source /opt/crc/Modules/current/init/bash
module load python/3.6.4
fi


# Calling the node_search.py script. All arugments will be passed into node_search
Expand Down

0 comments on commit 9bb3276

Please sign in to comment.