Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:recipes:openmm [2024-07-29 13:56] – bkang | technical:recipes:openmm [2024-07-29 14:50] (current) – [VALET Package Definition] bkang | ||
---|---|---|---|
Line 15: | Line 15: | ||
These commands create any missing directories. | These commands create any missing directories. | ||
- | ===== Create | + | ===== Create Virtualenv ===== |
The Python distribution will form the basis for the anaconda virtualenv, so add it to the environment: | The Python distribution will form the basis for the anaconda virtualenv, so add it to the environment: | ||
Line 22: | Line 22: | ||
[(my_workgroup: | [(my_workgroup: | ||
Adding package `anaconda/ | Adding package `anaconda/ | ||
- | (base) [(my_workgroup: | ||
</ | </ | ||
- | Notice | + | The virtual environment is first populated with all packages that **do not** require OpenMM. |
- | The '' | + | <WRAP center round important 60%> |
+ | The two channel options are present | ||
+ | </ | ||
<code bash> | <code bash> | ||
- | (base) [frey@login00 ~]$ conda search | + | $ conda create --prefix=$WORKDIR/ |
- | Loading channels: done | + | Solving environment: done |
- | # Name | + | : |
- | tensorflow | + | Proceed ([y]/n)? y |
- | tensorflow | + | : |
- | tensorflow | + | Preparing transaction: |
- | tensorflow | + | Verifying transaction: |
- | tensorflow | + | Executing transaction: |
- | tensorflow | + | # |
- | tensorflow | + | # To activate this environment, |
- | tensorflow | + | # |
- | tensorflow | + | # $ conda activate |
- | + | # | |
- | (base) [frey@login00 ~]$ conda search ' | + | # To deactivate an active environment, use |
- | Loading channels: done | + | # |
- | # Name | + | # $ conda deactivate |
- | tensorflow | + | # |
- | tensorflow | + | |
- | tensorflow | + | |
</ | </ | ||
- | All versions of the TensorFlow virtualenv will be stored in the common base directory, '' | + | |
+ | Before building | ||
<code bash> | <code bash> | ||
- | [(my_workgroup: | + | $ conda activate |
- | 2.2.0-gpu | + | (/ |
- | [(my_workgroup: | + | |
- | + | ||
- | [(my_workgroup: | + | |
- | 2.3.0-intel-python3.8 | + | |
- | [(my_workgroup: | + | |
</ | </ | ||
- | The virtualenvs are created using the '' | ||
- | <code bash> | + | ===== Building OpenMM ===== |
- | (base) [(my_workgroup: | + | |
- | WARNING: A directory already exists at the target location '/ | + | |
- | but it is not a conda environment. | + | |
- | Continue creating environment (y/[n])? y | + | |
- | : | + | With the new virtual environment activated, we can now build OpenMM. |
- | Preparing transaction: | + | <code base> |
- | Verifying transaction: | + | (/ |
- | Executing transaction: | + | Solving environment: |
- | # | + | : |
- | # To activate this environment, | + | Proceed ([y]/n)? y |
- | # | + | : |
- | # | + | Preparing transaction: |
- | # | + | Verifying transaction: |
- | # To deactivate an active environment, | + | Executing transaction: |
- | # | + | |
- | # $ conda deactivate | + | done |
</ | </ | ||
- | We're **not** going to activate that virtualenv -- we will install | + | ===== VALET Package Definition ===== |
+ | |||
+ | The new virtual environment can easily be added to your login shell and job runtime environments using VALET. | ||
+ | Assuming the workgroup does //not// already have a OpenMM VALET package definition, the following text: | ||
+ | |||
+ | <file openmm.vpkg_yaml> | ||
+ | openmm: | ||
+ | prefix: / | ||
+ | description: | ||
+ | flags: | ||
+ | | ||
+ | actions: | ||
+ | - action: source | ||
+ | script: | ||
+ | sh: anaconda-activate-2020.sh | ||
+ | order: failure-first | ||
+ | success: 0 | ||
+ | versions: | ||
+ | " | ||
+ | description: | ||
+ | dependencies: | ||
+ | - anaconda/ | ||
+ | </ | ||
+ | |||
+ | would be added to '' | ||
+ | |||
+ | ===== Using the Virtual Environment ===== | ||
+ | |||
+ | The versions of the virtual environment declared in the VALET package are listed using the '' | ||
<code bash> | <code bash> | ||
- | (base) [(it_nss: | + | $ vpkg_versions openmm |
- | WARNING: A directory already exists at the target location '/ | + | |
- | but it is not a conda environment. | + | |
- | Continue creating environment (y/[n])? y | + | |
- | : | + | Available versions in package (* = default version): |
- | Preparing transaction: | + | [/work/it_css/sw/valet/openmm.vpkg_yaml] |
- | Verifying transaction: | + | openmm |
- | Executing transaction: | + | * 20240726 |
- | # | + | |
- | # To activate this environment, | + | |
- | # | + | |
- | # $ conda activate | + | |
- | # | + | |
- | # To deactivate an active | + | |
- | # | + | |
- | # $ conda deactivate | + | |
</ | </ | ||
- | Ignore that '' | + | You can import openmm, activating the virtual environment is accomplished using the '' |
<code bash> | <code bash> | ||
- | (base) [(my_workgroup: | + | $ vpkg_require openmm/ |
- | [(my_workgroup:user)@login01 ~]$ | + | Adding dependency `anaconda/ |
+ | Adding package `openmm/ | ||
+ | (/ | ||
+ | ~/ | ||
+ | Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:23:07) [GCC 12.3.0] on linux | ||
+ | Type " | ||
+ | >>> | ||
+ | >>> | ||
</ | </ | ||
- | |||
- | Notice the '' | ||
- | |||
- |