Skip to content

Commit

Permalink
ornl crusher/opencl changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adw62 committed Sep 6, 2022
1 parent 62e3e84 commit 3e40114
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 43 deletions.
8 changes: 4 additions & 4 deletions TIES_MD/TIES.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from simtk.openmm import Vec3

from functools import partial
from multiprocess import Pool
from multiprocess.pool import ThreadPool as Pool
import numpy as np

import os
Expand Down Expand Up @@ -61,7 +61,7 @@ class TIES(object):
'''
def __init__(self, cwd, exp_name='complex', run_type='class', devices=None, rep_id=None, windows_mask=None,
periodic=True, lam=None, platform='CUDA', **kwargs):
periodic=True, platform='CUDA', lam=None, **kwargs):
nice_print('TIES')

if run_type == 'class' and kwargs == {}:
Expand All @@ -76,8 +76,8 @@ def __init__(self, cwd, exp_name='complex', run_type='class', devices=None, rep_
' for molecular dynamics. PLoS computational biology, 13(7), p.e1005659.\n')

#check all the config file args we need are present
args_list = ['engine', 'temperature', 'pressure', 'sampling_per_window', 'equili_per_window', 'methods',
'total_reps', 'split_run', 'elec_edges', 'ster_edges', 'global_lambdas', 'constraint_file',
args_list = ['engine', 'temperature', 'pressure', 'sampling_per_window', 'equili_per_window',
'methods', 'total_reps', 'split_run', 'elec_edges', 'ster_edges', 'global_lambdas', 'constraint_file',
'constraint_column', 'input_type', 'cell_basis_vec1', 'cell_basis_vec2', 'cell_basis_vec3']

# check we have all required arguments
Expand Down
2 changes: 1 addition & 1 deletion TIES_MD/alch.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def build_simulation(self, system, device_id):
if self.platform == 'CUDA':
properties = {'CudaPrecision': 'mixed', 'CudaDeviceIndex': device_id}
elif self.platform == 'OpenCL':
properties = {'OpenCLPrecision': 'mixed', 'OpenCLDeviceIndex': device_id}
properties = {'OpenCLPrecision': 'mixed', 'OpenCLDeviceIndex': device_id, 'OpenCLPlatformIndex': '0'}
elif self.platform == 'CPU':
properties = {}
else:
Expand Down
11 changes: 9 additions & 2 deletions TIES_MD/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
TIES_MD
Command line input should be used as follows...
Usage:
TIES_MD [--devices=LIST] [--run_type=STRING] [--config_file=STRING] [--rep_id=INT] [--windows_mask=LIST] [--exp_name=STR]...
TIES_MD [--platform=STRING] [--devices=LIST] [--run_type=STRING] [--config_file=STRING] [--rep_id=INT] [--windows_mask=LIST] [--exp_name=STR]...
"""

def main(argv=None):
Expand Down Expand Up @@ -95,6 +95,13 @@ def main(argv=None):
else:
devices = None

if args['--platform']:
if not_openmm:
raise ValueError(not_openmm_msg.format('--platform'))
platform = args['--platform']
else:
platform = 'CUDA'

if args['--rep_id']:
if not_openmm:
raise ValueError(not_openmm_msg.format('--rep_id'))
Expand All @@ -107,5 +114,5 @@ def main(argv=None):
# removed this as an option there is no need to expose it for now
periodic = True

TIES(input_folder, exp_name, run_type, devices, rep_id, mask, periodic, **args_dict)
TIES(input_folder, exp_name, run_type, devices, rep_id, mask, periodic, platform, **args_dict)

2 changes: 1 addition & 1 deletion TIES_MD/doc/source/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API
---

Here we detail all the options in the API and what should be passed. The options that were previously on the command line
can be passed into the TIES class. A minimal evocation would looks like::
can be passed into the TIES class. A minimal evocation would look like::

from TIES_MD import TIES
import os
Expand Down
11 changes: 6 additions & 5 deletions TIES_MD/doc/source/binding_free_energies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for how to do this. With ``TIES20`` installed you can use the API as follows to
hybrid.prepare_inputs(protein=protein)


This will build all the input needed to run these a BFE for the :math:`{ΔΔ G}` between ligandA and
This will build all the input needed to run a BFE calculation for the :math:`{ΔΔ G}` between ligandA and
ligandB. However, in order to run at this point the user must execute their own HPC submission scripts or run via the
command line on a cluster. We can however build own submission scripts and or change any of the simulation setting
as detailed in the next section.
Expand Down Expand Up @@ -145,10 +145,11 @@ the ``ties/ties-ligandA-ligandB/(lig/com)`` directory run::
Then modify the analysis.cfg file such the legs option is now to ``legs = lig, com`` (the two legs of our cycle). Note,
configured like this the :math:`{ΔΔ G}` is computed as the :math:`{Δ G}` of the ligand simulation minus the :math:`{Δ G}`
of the complex simulation, take care this gives you the same :math:`{ΔΔ G}` as you want to compare to in experiment
and it depends on which ligand is ligandA/B in the cycle. running::
and it depends on which ligand is ligandA/B in the cycle. Running the following command will once again give
a ``results.dat`` file as output::

ties_ana

will once again give a ``results.dat`` file as out put this is the same as in the :ref:`Tutorial` section but it now
contains the :math:`{ΔΔ G}` of each transformation and the associated SEM. The print out on the terminal will detail
the individual :math:`{Δ G}` results for each thermodynamic leg.
``results.dat`` file file will have the same format as in the :ref:`Tutorial` section but it now
contains the :math:`{ΔΔ G}` of each transformation and the associated standard error of the mean (SEM). The print out on
the terminal will detail the individual :math:`{Δ G}` results for each thermodynamic leg.
2 changes: 1 addition & 1 deletion docs/API.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1>TIES MD API<a class="headerlink" href="#ties-md-api" title="Permalink to thi
<section id="api">
<h2>API<a class="headerlink" href="#api" title="Permalink to this heading"></a></h2>
<p>Here we detail all the options in the API and what should be passed. The options that were previously on the command line
can be passed into the TIES class. A minimal evocation would looks like:</p>
can be passed into the TIES class. A minimal evocation would look like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">TIES_MD</span> <span class="kn">import</span> <span class="n">TIES</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="n">md</span> <span class="o">=</span> <span class="n">TIES</span><span class="p">(</span><span class="n">cwd</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="s1">&#39;./my_ties_sims&#39;</span><span class="p">))</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/_sources/API.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API
---

Here we detail all the options in the API and what should be passed. The options that were previously on the command line
can be passed into the TIES class. A minimal evocation would looks like::
can be passed into the TIES class. A minimal evocation would look like::

from TIES_MD import TIES
import os
Expand Down
11 changes: 6 additions & 5 deletions docs/_sources/binding_free_energies.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for how to do this. With ``TIES20`` installed you can use the API as follows to
hybrid.prepare_inputs(protein=protein)


This will build all the input needed to run these a BFE for the :math:`{ΔΔ G}` between ligandA and
This will build all the input needed to run a BFE calculation for the :math:`{ΔΔ G}` between ligandA and
ligandB. However, in order to run at this point the user must execute their own HPC submission scripts or run via the
command line on a cluster. We can however build own submission scripts and or change any of the simulation setting
as detailed in the next section.
Expand Down Expand Up @@ -145,10 +145,11 @@ the ``ties/ties-ligandA-ligandB/(lig/com)`` directory run::
Then modify the analysis.cfg file such the legs option is now to ``legs = lig, com`` (the two legs of our cycle). Note,
configured like this the :math:`{ΔΔ G}` is computed as the :math:`{Δ G}` of the ligand simulation minus the :math:`{Δ G}`
of the complex simulation, take care this gives you the same :math:`{ΔΔ G}` as you want to compare to in experiment
and it depends on which ligand is ligandA/B in the cycle. running::
and it depends on which ligand is ligandA/B in the cycle. Running the following command will once again give
a ``results.dat`` file as output::

ties_ana

will once again give a ``results.dat`` file as out put this is the same as in the :ref:`Tutorial` section but it now
contains the :math:`{ΔΔ G}` of each transformation and the associated SEM. The print out on the terminal will detail
the individual :math:`{Δ G}` results for each thermodynamic leg.
``results.dat`` file file will have the same format as in the :ref:`Tutorial` section but it now
contains the :math:`{ΔΔ G}` of each transformation and the associated standard error of the mean (SEM). The print out on
the terminal will detail the individual :math:`{Δ G}` results for each thermodynamic leg.
34 changes: 17 additions & 17 deletions docs/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #3D7B7B; font-style: italic } /* Comment */
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #9C6500 } /* Comment.Preproc */
.highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #E40000 } /* Generic.Error */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */
.highlight .go { color: #717171 } /* Generic.Output */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
Expand All @@ -33,15 +33,15 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #687822 } /* Name.Attribute */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #767600 } /* Name.Label */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
Expand All @@ -58,11 +58,11 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #A45A77 } /* Literal.String.Regex */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
Expand Down
11 changes: 6 additions & 5 deletions docs/binding_free_energies.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h2>Setup<a class="headerlink" href="#setup" title="Permalink to this heading">
<span class="n">hybrid</span><span class="o">.</span><span class="n">prepare_inputs</span><span class="p">(</span><span class="n">protein</span><span class="o">=</span><span class="n">protein</span><span class="p">)</span>
</pre></div>
</div>
<p>This will build all the input needed to run these a BFE for the <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> between ligandA and
<p>This will build all the input needed to run a BFE calculation for the <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> between ligandA and
ligandB. However, in order to run at this point the user must execute their own HPC submission scripts or run via the
command line on a cluster. We can however build own submission scripts and or change any of the simulation setting
as detailed in the next section.</p>
Expand Down Expand Up @@ -219,13 +219,14 @@ <h2>BFE Analysis<a class="headerlink" href="#bfe-analysis" title="Permalink to t
<p>Then modify the analysis.cfg file such the legs option is now to <code class="docutils literal notranslate"><span class="pre">legs</span> <span class="pre">=</span> <span class="pre">lig,</span> <span class="pre">com</span></code> (the two legs of our cycle). Note,
configured like this the <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> is computed as the <span class="math notranslate nohighlight">\({Δ G}\)</span> of the ligand simulation minus the <span class="math notranslate nohighlight">\({Δ G}\)</span>
of the complex simulation, take care this gives you the same <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> as you want to compare to in experiment
and it depends on which ligand is ligandA/B in the cycle. running:</p>
and it depends on which ligand is ligandA/B in the cycle. Running the following command will once again give
a <code class="docutils literal notranslate"><span class="pre">results.dat</span></code> file as output:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ties_ana</span>
</pre></div>
</div>
<p>will once again give a <code class="docutils literal notranslate"><span class="pre">results.dat</span></code> file as out put this is the same as in the <a class="reference internal" href="tutorial.html#tutorial"><span class="std std-ref">Tutorial</span></a> section but it now
contains the <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> of each transformation and the associated SEM. The print out on the terminal will detail
the individual <span class="math notranslate nohighlight">\({Δ G}\)</span> results for each thermodynamic leg.</p>
<p><code class="docutils literal notranslate"><span class="pre">results.dat</span></code> file file will have the same format as in the <a class="reference internal" href="tutorial.html#tutorial"><span class="std std-ref">Tutorial</span></a> section but it now
contains the <span class="math notranslate nohighlight">\({ΔΔ G}\)</span> of each transformation and the associated standard error of the mean (SEM). The print out on
the terminal will detail the individual <span class="math notranslate nohighlight">\({Δ G}\)</span> results for each thermodynamic leg.</p>
</section>
</section>

Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 3e40114

Please sign in to comment.