Skip to content

Decoupling WESTPA 1.0 and 2.0

Jeremy Leung edited this page Oct 27, 2021 · 4 revisions

Table of Contents

Running both WESTPA 1.0 and WESTPA 2.0 on the same system

The WESTPA 1.0 actually modifies conda so it sources your westpa.sh when the environment is activated. This might interfere with WESTPA 2.0. You can run the following steps to ensure the WESTPA 1.0 variables are disabled when WESTPA 2.0 is run (and vice versa).

Automatically

As of v2020.05 conda install, these steps are initiated automatically, thus allowing seamless transition between WESTPA 1.0 and 2.0 environments.

Manually

There are three steps to decouple the two installations. Steps 1 and 2 need to be done every time you want to disable WESTPA1.0 and use WESTPA 2.0. Step 3 just needs to be done once. WESTPA 2.0 can simply be disabled by deactivating the associated conda environment.

The steps are as followed:

1. Remove WESTPA1.0's bin from your $PATH

2. unset the WESTPA1.0 variables, and

3. modify your conda so it doesn't source westpa.sh.

Removing WESTPA1.0's bin from $PATH

You can check out your current paths by running:

  echo $PATH

which will output something like:

  /ihome/user/anaconda3/westpa-2020.03/bin:/usr/local/bin:/ihome/user/bin

Notice that the first path points to the WESTPA 1.0 installation. Take note of what that is. Our goal is to remove that from the path. We will first do it to a dummy variable (to ensure it works correctly) then pass it on to $PATH. Modify the third command to your WESTPA 1.0 path.

  export TEST=$PATH
  echo $TEST
  export TEST=${TEST#/ihome/user/anaconda3/westpa-2020.03/bin:}
  echo $TEST

Using the same example, the first echo should output:

  /ihome/user/anaconda3/westpa-2020.03/bin:/usr/local/bin:/ihome/user/bin

and the second echo should output:

  /usr/local/bin:/ihome/user/bin

If that is similar to what you get (i.e. the removal of the WESTPA 1.0 bin path), run the following:

  export PATH=$TEST
  echo $PATH

WESTPA 1.0's path should be removed.

Removing WESTPA 1.0 environment Variables

Run the following commands:

  unset WEST_ROOT
  unset WEST_BIN
  unset WEST_PYTHON

These can also be added into your anaconda install (e.g. ~/anaconda3/etc/conda/deactivate.d/env_vars.sh) and specific environment install (e.g. ~/anaconda3/envs/westpa-2020.03/etc/conda/deactivate.d/env_vars.shso they are deactivated when an environment is deactivated:

  #!/usr/bin/env bash
  unset WEST_ROOT
  unset WEST_BIN
  unset WEST_PYTHON

More information of this process are available in the anaconda user guide.

Removing the auto sourcing of westpa.sh

Move to ~/anaconda3/etc/conda/activate.d/env_vars.sh and comment out the line that sources westpa.sh. You may also wish to disable it on the environment specific version as well (e.g. ~/anaconda3/envs/westpa-2020.03/etc/conda/activate.d/env_vars.sh).

When you want to run WESTPA 1.0, you might have to source the westpa.sh manually. This will require you to do steps 1 and 2 to switch WESTPA 1.0 off.

  source anaconda3/westpa-2020.03/westpa.sh
Clone this wiki locally