Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tcardlab/907875324f346f823db50dee9ca64e4a to your computer and use it in GitHub Desktop.
Save tcardlab/907875324f346f823db50dee9ca64e4a to your computer and use it in GitHub Desktop.
Using OpenMMTools in Google Colab
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "CondaExampleWithOpenMMTools.ipynb",
"version": "0.3.2",
"provenance": [],
"collapsed_sections": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"metadata": {
"id": "gPFd5CO2yosb",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Install Miniconda\n",
"It's the normal procedure, but:\n",
"- We stick to v4.5.4 because it ships with Python 3.6 (same as Google Colab runtime) for compatibility.\n",
"- We install it in `/usr/local`\n",
"\n",
"__Note 1__: If you want to use GPU acceleration, enable it now (before installing anything). Otherwise you will have to repeat everything after enabling GPU acceleration.\n",
"\n",
"__Note 2__: Solving dependencies in such a convoluted environment (`/usr/lib`) can (sometimes) take _a while_ (20 mins in my last attempt). It might be a better idea to use `constructor` ([check here](https://github.com/conda/constructor)) to prebuild a conda installation with all the packages you want if you intend to use them quite often.\n"
]
},
{
"metadata": {
"id": "xXGOv9XLO5UL",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1475
},
"outputId": "d663f0ec-19ec-47d8-8141-c7b3bd7dbae5"
},
"cell_type": "code",
"source": [
"!wget https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh && bash Miniconda3-4.5.4-Linux-x86_64.sh -bfp /usr/local"
],
"execution_count": 7,
"outputs": [
{
"output_type": "stream",
"text": [
"--2019-04-24 12:38:44-- https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh\n",
"Resolving repo.continuum.io (repo.continuum.io)... 104.18.200.79, 104.18.201.79, 2606:4700::6812:c84f, ...\n",
"Connecting to repo.continuum.io (repo.continuum.io)|104.18.200.79|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
"Length: 58468498 (56M) [application/x-sh]\n",
"Saving to: ‘Miniconda3-4.5.4-Linux-x86_64.sh’\n",
"\n",
"Miniconda3-4.5.4-Li 100%[===================>] 55.76M 132MB/s in 0.4s \n",
"\n",
"2019-04-24 12:38:45 (132 MB/s) - ‘Miniconda3-4.5.4-Linux-x86_64.sh’ saved [58468498/58468498]\n",
"\n",
"PREFIX=/usr/local\n",
"installing: python-3.6.5-hc3d631a_2 ...\n",
"Python 3.6.5 :: Anaconda, Inc.\n",
"installing: ca-certificates-2018.03.07-0 ...\n",
"installing: conda-env-2.6.0-h36134e3_1 ...\n",
"installing: libgcc-ng-7.2.0-hdf63c60_3 ...\n",
"installing: libstdcxx-ng-7.2.0-hdf63c60_3 ...\n",
"installing: libffi-3.2.1-hd88cf55_4 ...\n",
"installing: ncurses-6.1-hf484d3e_0 ...\n",
"installing: openssl-1.0.2o-h20670df_0 ...\n",
"installing: tk-8.6.7-hc745277_3 ...\n",
"installing: xz-5.2.4-h14c3975_4 ...\n",
"installing: yaml-0.1.7-had09818_2 ...\n",
"installing: zlib-1.2.11-ha838bed_2 ...\n",
"installing: libedit-3.1.20170329-h6b74fdf_2 ...\n",
"installing: readline-7.0-ha6073c6_4 ...\n",
"installing: sqlite-3.23.1-he433501_0 ...\n",
"installing: asn1crypto-0.24.0-py36_0 ...\n",
"installing: certifi-2018.4.16-py36_0 ...\n",
"installing: chardet-3.0.4-py36h0f667ec_1 ...\n",
"installing: idna-2.6-py36h82fb2a8_1 ...\n",
"installing: pycosat-0.6.3-py36h0a5515d_0 ...\n",
"installing: pycparser-2.18-py36hf9f622e_1 ...\n",
"installing: pysocks-1.6.8-py36_0 ...\n",
"installing: ruamel_yaml-0.15.37-py36h14c3975_2 ...\n",
"installing: six-1.11.0-py36h372c433_1 ...\n",
"installing: cffi-1.11.5-py36h9745a5d_0 ...\n",
"installing: setuptools-39.2.0-py36_0 ...\n",
"installing: cryptography-2.2.2-py36h14c3975_0 ...\n",
"installing: wheel-0.31.1-py36_0 ...\n",
"installing: pip-10.0.1-py36_0 ...\n",
"installing: pyopenssl-18.0.0-py36_0 ...\n",
"installing: urllib3-1.22-py36hbe7ace6_0 ...\n",
"installing: requests-2.18.4-py36he2e5f8d_1 ...\n",
"installing: conda-4.5.4-py36_0 ...\n",
"unlinking: asn1crypto-0.24.0-py37_0\n",
"unlinking: certifi-2018.11.29-py37_0\n",
"unlinking: cffi-1.11.5-py37he75722e_1\n",
"unlinking: chardet-3.0.4-py37_1\n",
"unlinking: conda-4.5.12-py37_0\n",
"unlinking: conda-env-2.6.0-1\n",
"unlinking: cryptography-2.4.2-py37h1ba5d50_0\n",
"unlinking: idna-2.8-py37_0\n",
"unlinking: libgcc-ng-8.2.0-hdf63c60_1\n",
"unlinking: libstdcxx-ng-8.2.0-hdf63c60_1\n",
"unlinking: ncurses-6.1-he6710b0_1\n",
"unlinking: openssl-1.1.1a-h7b6447c_0\n",
"unlinking: pip-18.1-py37_0\n",
"unlinking: pycosat-0.6.3-py37h14c3975_0\n",
"unlinking: pycparser-2.19-py37_0\n",
"unlinking: pyopenssl-18.0.0-py37_0\n",
"unlinking: pysocks-1.6.8-py37_0\n",
"unlinking: python-3.7.1-h0371630_7\n",
"unlinking: readline-7.0-h7b6447c_5\n",
"unlinking: requests-2.21.0-py37_0\n",
"unlinking: ruamel_yaml-0.15.46-py37h14c3975_0\n",
"unlinking: setuptools-40.6.3-py37_0\n",
"unlinking: six-1.12.0-py37_0\n",
"unlinking: sqlite-3.26.0-h7b6447c_0\n",
"unlinking: tk-8.6.8-hbc83047_0\n",
"unlinking: urllib3-1.24.1-py37_0\n",
"unlinking: wheel-0.32.3-py37_0\n",
"unlinking: zlib-1.2.11-h7b6447c_3\n",
"installation finished.\n",
"WARNING:\n",
" You currently have a PYTHONPATH environment variable set. This may cause\n",
" unexpected behavior when running the Python interpreter in Miniconda3.\n",
" For best results, please verify that your PYTHONPATH only points to\n",
" directories of packages that are compatible with the Python interpreter\n",
" in Miniconda3: /usr/local\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "v5DCYIOLEptA",
"colab_type": "code",
"outputId": "e10230de-edcc-4d05-bb8f-e8a3741f91ed",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 2305
}
},
"cell_type": "code",
"source": [
"!conda info --all\n",
"!conda list\n",
"!env | sort"
],
"execution_count": 8,
"outputs": [
{
"output_type": "stream",
"text": [
"\n",
" active environment : None\n",
" user config file : /root/.condarc\n",
" populated config files : \n",
" conda version : 4.5.4\n",
" conda-build version : not installed\n",
" python version : 3.6.5.final.0\n",
" base environment : /usr/local (writable)\n",
" channel URLs : https://repo.anaconda.com/pkgs/main/linux-64\n",
" https://repo.anaconda.com/pkgs/main/noarch\n",
" https://repo.anaconda.com/pkgs/free/linux-64\n",
" https://repo.anaconda.com/pkgs/free/noarch\n",
" https://repo.anaconda.com/pkgs/r/linux-64\n",
" https://repo.anaconda.com/pkgs/r/noarch\n",
" https://repo.anaconda.com/pkgs/pro/linux-64\n",
" https://repo.anaconda.com/pkgs/pro/noarch\n",
" package cache : /usr/local/pkgs\n",
" /root/.conda/pkgs\n",
" envs directories : /usr/local/envs\n",
" /root/.conda/envs\n",
" platform : linux-64\n",
" user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Linux/4.14.79+ ubuntu/18.04 glibc/2.27\n",
" UID:GID : 0:0\n",
" netrc file : None\n",
" offline mode : False\n",
"\n",
"# conda environments:\n",
"#\n",
"base * /usr/local\n",
"\n",
"sys.version: 3.6.5 |Anaconda, Inc.| (default, Apr 29 ...\n",
"sys.prefix: /usr/local\n",
"sys.executable: /usr/local/bin/python\n",
"conda location: /usr/local/lib/python3.6/site-packages/conda\n",
"conda-build: None\n",
"conda-env: /usr/local/bin/conda-env\n",
"user site dirs: \n",
"\n",
"CIO_TEST: <not set>\n",
"CONDA_ROOT: /usr/local\n",
"LD_LIBRARY_PATH: /usr/lib64-nvidia\n",
"LIBRARY_PATH: /usr/local/cuda/lib64/stubs\n",
"PATH: /usr/local/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin\n",
"PYTHONPATH: /env/python\n",
"PYTHONWARNINGS: ignore:::pip._internal.cli.base_command\n",
"REQUESTS_CA_BUNDLE: <not set>\n",
"SSL_CERT_FILE: <not set>\n",
"\n",
"\n",
"WARNING: could not import _license.show_info\n",
"# try:\n",
"# $ conda install -n root _license\n",
"# packages in environment at /usr/local:\n",
"#\n",
"# Name Version Build Channel\n",
"asn1crypto 0.24.0 py36_0 \n",
"ca-certificates 2018.03.07 0 \n",
"certifi 2018.4.16 py36_0 \n",
"cffi 1.11.5 py36h9745a5d_0 \n",
"chardet 3.0.4 py36h0f667ec_1 \n",
"conda 4.5.4 py36_0 \n",
"conda-env 2.6.0 h36134e3_1 \n",
"cryptography 2.2.2 py36h14c3975_0 \n",
"idna 2.6 py36h82fb2a8_1 \n",
"libedit 3.1.20170329 h6b74fdf_2 \n",
"libffi 3.2.1 hd88cf55_4 \n",
"libgcc-ng 7.2.0 hdf63c60_3 \n",
"libstdcxx-ng 7.2.0 hdf63c60_3 \n",
"ncurses 6.1 hf484d3e_0 \n",
"openssl 1.0.2o h20670df_0 \n",
"pip 10.0.1 py36_0 \n",
"pycosat 0.6.3 py36h0a5515d_0 \n",
"pycparser 2.18 py36hf9f622e_1 \n",
"pyopenssl 18.0.0 py36_0 \n",
"pysocks 1.6.8 py36_0 \n",
"python 3.6.5 hc3d631a_2 \n",
"readline 7.0 ha6073c6_4 \n",
"requests 2.18.4 py36he2e5f8d_1 \n",
"ruamel_yaml 0.15.37 py36h14c3975_2 \n",
"setuptools 39.2.0 py36_0 \n",
"six 1.11.0 py36h372c433_1 \n",
"sqlite 3.23.1 he433501_0 \n",
"tk 8.6.7 hc745277_3 \n",
"urllib3 1.22 py36hbe7ace6_0 \n",
"wheel 0.31.1 py36_0 \n",
"xz 5.2.4 h14c3975_4 \n",
"yaml 0.1.7 had09818_2 \n",
"zlib 1.2.11 ha838bed_2 \n",
"CLICOLOR=1\n",
"CLOUDSDK_CONFIG=/content/.config\n",
"COLAB_GPU=1\n",
"CUDA_PKG_VERSION=10-0=10.0.130-1\n",
"CUDA_VERSION=10.0.130\n",
"CUDNN_VERSION=7.5.0.56\n",
"DATALAB_SETTINGS_OVERRIDES={\"kernelManagerProxyPort\":6000,\"kernelManagerProxyHost\":\"172.28.0.3\",\"jupyterArgs\":[\"--ip=\\\"172.28.0.2\\\"\"]}\n",
"DEBIAN_FRONTEND=noninteractive\n",
"__EGL_VENDOR_LIBRARY_DIRS=/usr/lib64-nvidia:/usr/share/glvnd/egl_vendor.d/\n",
"ENV=/root/.bashrc\n",
"GCS_READ_CACHE_BLOCK_SIZE_MB=16\n",
"GIT_PAGER=cat\n",
"GLIBCPP_FORCE_NEW=1\n",
"GLIBCXX_FORCE_NEW=1\n",
"HOME=/root\n",
"HOSTNAME=dd67983c307e\n",
"JPY_PARENT_PID=34\n",
"LANG=en_US.UTF-8\n",
"LD_LIBRARY_PATH=/usr/lib64-nvidia\n",
"LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4\n",
"LIBRARY_PATH=/usr/local/cuda/lib64/stubs\n",
"MPLBACKEND=module://ipykernel.pylab.backend_inline\n",
"NCCL_VERSION=2.4.2\n",
"NO_GCE_CHECK=True\n",
"NVIDIA_DRIVER_CAPABILITIES=compute,utility\n",
"NVIDIA_REQUIRE_CUDA=cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411\n",
"NVIDIA_VISIBLE_DEVICES=all\n",
"OLDPWD=/\n",
"PAGER=cat\n",
"PATH=/usr/local/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin\n",
"PWD=/content\n",
"PYTHONPATH=/env/python\n",
"PYTHONWARNINGS=ignore:::pip._internal.cli.base_command\n",
"SHELL=/bin/bash\n",
"SHLVL=2\n",
"TERM=xterm-color\n",
"TF_FORCE_GPU_ALLOW_GROWTH=true\n",
"_=/usr/bin/env\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "hD2dcnR7y8Ry",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Install needed packages\n",
"Again the normal procedure, just remember to always use `-y` so `conda` does not wait for confirmation. `-q` is useful to prevent interactive outputs (such as the rolling slash /|\\-/|\\-)."
]
},
{
"metadata": {
"id": "3jZucs0Eufuq",
"colab_type": "code",
"outputId": "77b61836-52b1-45fe-af18-3623c57efe23",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 2933
}
},
"cell_type": "code",
"source": [
"!time conda install -y -q -c conda-forge -c omnia/label/cuda100 -c omnia openmmtools"
],
"execution_count": 9,
"outputs": [
{
"output_type": "stream",
"text": [
"Solving environment: ...working... done\n",
"\n",
"## Package Plan ##\n",
"\n",
" environment location: /usr/local\n",
"\n",
" added / updated specs: \n",
" - openmmtools\n",
"\n",
"\n",
"The following packages will be downloaded:\n",
"\n",
" package | build\n",
" ---------------------------|-----------------\n",
" sphinxcontrib-bibtex-0.4.2 | py_0 15 KB conda-forge\n",
" certifi-2019.3.9 | py36_0 149 KB conda-forge\n",
" pbr-5.1.3 | py_0 70 KB conda-forge\n",
" libcblas-3.8.0 | 6_openblas 6 KB conda-forge\n",
" cryptography-2.6.1 | py36h72c5cf5_0 606 KB conda-forge\n",
" pybtex-0.22.2 | py36_0 303 KB conda-forge\n",
" cython-0.29.7 | py36he1b5a44_0 2.2 MB conda-forge\n",
" pyparsing-2.4.0 | py_0 55 KB conda-forge\n",
" bzip2-1.0.6 | h14c3975_1002 415 KB conda-forge\n",
" openmm-7.3.1 |py36_cuda100_rc_2 11.4 MB omnia/label/cuda100\n",
" babel-2.6.0 | py_1 5.6 MB conda-forge\n",
" libnetcdf-4.6.2 | hbdf4f91_1001 1.3 MB conda-forge\n",
" jpeg-9c | h14c3975_1001 251 KB conda-forge\n",
" jinja2-2.10.1 | py_0 91 KB conda-forge\n",
" pytz-2019.1 | py_0 227 KB conda-forge\n",
" numexpr-2.6.9 |py36h637b7d7_1000 194 KB conda-forge\n",
" sphinxcontrib-htmlhelp-1.0.2| py_0 27 KB conda-forge\n",
" openssl-1.1.1b | h14c3975_1 4.0 MB conda-forge\n",
" fftw3f-3.3.4 | 2 1.2 MB omnia/label/cuda100\n",
" sphinxcontrib-applehelp-1.0.1| py_0 28 KB conda-forge\n",
" pandas-0.24.2 | py36hf484d3e_0 11.1 MB conda-forge\n",
" libblas-3.8.0 | 6_openblas 6 KB conda-forge\n",
" mdtraj-1.9.2 |py36hff88cb2_1000 1.9 MB conda-forge\n",
" imagesize-1.1.0 | py_0 6 KB conda-forge\n",
" pyyaml-5.1 | py36h14c3975_0 183 KB conda-forge\n",
" sphinx-2.0.1 | py_0 1.4 MB conda-forge\n",
" packaging-19.0 | py_0 23 KB conda-forge\n",
" blosc-1.16.3 | hf484d3e_0 885 KB conda-forge\n",
" tk-8.6.9 | h84994c4_1001 3.2 MB conda-forge\n",
" pytables-3.5.1 | py36h442f067_1 1.4 MB conda-forge\n",
" liblapack-3.8.0 | 6_openblas 6 KB conda-forge\n",
" mock-2.0.0 | py36_1001 106 KB conda-forge\n",
" python-dateutil-2.8.0 | py_0 219 KB conda-forge\n",
" parmed-3.2.0 | py36_0 1.1 MB omnia\n",
" pybtex-docutils-0.2.1 | py36_1000 8 KB conda-forge\n",
" sphinxcontrib-devhelp-1.0.1| py_0 22 KB conda-forge\n",
" alabaster-0.7.12 | py_0 15 KB conda-forge\n",
" sphinxcontrib-qthelp-1.0.2 | py_0 25 KB conda-forge\n",
" mpiplus-v0.0.1 | py36_1000 22 KB conda-forge\n",
" numpy-1.16.3 | py36he5ce36f_0 4.3 MB conda-forge\n",
" sphinxcontrib-jsmath-1.0.1 | py_0 7 KB conda-forge\n",
" krb5-1.16.3 | h05b26f9_1001 1.4 MB conda-forge\n",
" sphinxcontrib-serializinghtml-1.1.1| py_0 24 KB conda-forge\n",
" sqlite-3.26.0 | h67949de_1001 1.9 MB conda-forge\n",
" python-3.6.7 | h381d211_1004 34.5 MB conda-forge\n",
" lzo-2.10 | h14c3975_1000 319 KB conda-forge\n",
" libcurl-7.64.1 | hda55be3_0 584 KB conda-forge\n",
" oset-0.1.3 | py_1 10 KB conda-forge\n",
" conda-4.6.14 | py36_0 2.1 MB conda-forge\n",
" hdf5-1.10.4 |nompi_h3c11f04_1106 5.3 MB conda-forge\n",
" docutils-0.14 | py36_1001 693 KB conda-forge\n",
" openblas-0.3.5 | h9ac9557_1001 15.8 MB conda-forge\n",
" pygments-2.3.1 | py_0 641 KB conda-forge\n",
" openmmtools-0.18.1 | py36_0 8.9 MB omnia\n",
" libssh2-1.8.2 | h22169c7_2 257 KB conda-forge\n",
" hdf4-4.2.13 | h9a582f1_1002 952 KB conda-forge\n",
" snowballstemmer-1.2.1 | py_1 32 KB conda-forge\n",
" libgfortran-ng-7.3.0 | hdf63c60_0 1.3 MB\n",
" curl-7.64.1 | hf8cf82a_0 128 KB conda-forge\n",
" markupsafe-1.1.1 | py36h14c3975_0 26 KB conda-forge\n",
" latexcodec-1.0.6 | py_0 16 KB conda-forge\n",
" netcdf4-1.5.0.1 | py36had58050_0 537 KB conda-forge\n",
" scipy-1.2.1 | py36h09a28d5_1 18.1 MB conda-forge\n",
" cftime-1.0.3.4 |py36h3010b51_1000 303 KB conda-forge\n",
" ca-certificates-2019.3.9 | hecc5488_0 146 KB conda-forge\n",
" ------------------------------------------------------------\n",
" Total: 147.9 MB\n",
"\n",
"The following NEW packages will be INSTALLED:\n",
"\n",
" alabaster: 0.7.12-py_0 conda-forge \n",
" babel: 2.6.0-py_1 conda-forge \n",
" blosc: 1.16.3-hf484d3e_0 conda-forge \n",
" bzip2: 1.0.6-h14c3975_1002 conda-forge \n",
" cftime: 1.0.3.4-py36h3010b51_1000 conda-forge \n",
" curl: 7.64.1-hf8cf82a_0 conda-forge \n",
" cython: 0.29.7-py36he1b5a44_0 conda-forge \n",
" docutils: 0.14-py36_1001 conda-forge \n",
" fftw3f: 3.3.4-2 omnia/label/cuda100\n",
" hdf4: 4.2.13-h9a582f1_1002 conda-forge \n",
" hdf5: 1.10.4-nompi_h3c11f04_1106 conda-forge \n",
" imagesize: 1.1.0-py_0 conda-forge \n",
" jinja2: 2.10.1-py_0 conda-forge \n",
" jpeg: 9c-h14c3975_1001 conda-forge \n",
" krb5: 1.16.3-h05b26f9_1001 conda-forge \n",
" latexcodec: 1.0.6-py_0 conda-forge \n",
" libblas: 3.8.0-6_openblas conda-forge \n",
" libcblas: 3.8.0-6_openblas conda-forge \n",
" libcurl: 7.64.1-hda55be3_0 conda-forge \n",
" libgfortran-ng: 7.3.0-hdf63c60_0 \n",
" liblapack: 3.8.0-6_openblas conda-forge \n",
" libnetcdf: 4.6.2-hbdf4f91_1001 conda-forge \n",
" libssh2: 1.8.2-h22169c7_2 conda-forge \n",
" lzo: 2.10-h14c3975_1000 conda-forge \n",
" markupsafe: 1.1.1-py36h14c3975_0 conda-forge \n",
" mdtraj: 1.9.2-py36hff88cb2_1000 conda-forge \n",
" mock: 2.0.0-py36_1001 conda-forge \n",
" mpiplus: v0.0.1-py36_1000 conda-forge \n",
" netcdf4: 1.5.0.1-py36had58050_0 conda-forge \n",
" numexpr: 2.6.9-py36h637b7d7_1000 conda-forge \n",
" numpy: 1.16.3-py36he5ce36f_0 conda-forge \n",
" openblas: 0.3.5-h9ac9557_1001 conda-forge \n",
" openmm: 7.3.1-py36_cuda100_rc_2 omnia/label/cuda100\n",
" openmmtools: 0.18.1-py36_0 omnia \n",
" oset: 0.1.3-py_1 conda-forge \n",
" packaging: 19.0-py_0 conda-forge \n",
" pandas: 0.24.2-py36hf484d3e_0 conda-forge \n",
" parmed: 3.2.0-py36_0 omnia \n",
" pbr: 5.1.3-py_0 conda-forge \n",
" pybtex: 0.22.2-py36_0 conda-forge \n",
" pybtex-docutils: 0.2.1-py36_1000 conda-forge \n",
" pygments: 2.3.1-py_0 conda-forge \n",
" pyparsing: 2.4.0-py_0 conda-forge \n",
" pytables: 3.5.1-py36h442f067_1 conda-forge \n",
" python-dateutil: 2.8.0-py_0 conda-forge \n",
" pytz: 2019.1-py_0 conda-forge \n",
" pyyaml: 5.1-py36h14c3975_0 conda-forge \n",
" scipy: 1.2.1-py36h09a28d5_1 conda-forge \n",
" snowballstemmer: 1.2.1-py_1 conda-forge \n",
" sphinx: 2.0.1-py_0 conda-forge \n",
" sphinxcontrib-applehelp: 1.0.1-py_0 conda-forge \n",
" sphinxcontrib-bibtex: 0.4.2-py_0 conda-forge \n",
" sphinxcontrib-devhelp: 1.0.1-py_0 conda-forge \n",
" sphinxcontrib-htmlhelp: 1.0.2-py_0 conda-forge \n",
" sphinxcontrib-jsmath: 1.0.1-py_0 conda-forge \n",
" sphinxcontrib-qthelp: 1.0.2-py_0 conda-forge \n",
" sphinxcontrib-serializinghtml: 1.1.1-py_0 conda-forge \n",
"\n",
"The following packages will be UPDATED:\n",
"\n",
" ca-certificates: 2018.03.07-0 --> 2019.3.9-hecc5488_0 conda-forge\n",
" certifi: 2018.4.16-py36_0 --> 2019.3.9-py36_0 conda-forge\n",
" conda: 4.5.4-py36_0 --> 4.6.14-py36_0 conda-forge\n",
" cryptography: 2.2.2-py36h14c3975_0 --> 2.6.1-py36h72c5cf5_0 conda-forge\n",
" libgcc-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1 \n",
" libstdcxx-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1 \n",
" openssl: 1.0.2o-h20670df_0 --> 1.1.1b-h14c3975_1 conda-forge\n",
" python: 3.6.5-hc3d631a_2 --> 3.6.7-h381d211_1004 conda-forge\n",
" sqlite: 3.23.1-he433501_0 --> 3.26.0-h67949de_1001 conda-forge\n",
" tk: 8.6.7-hc745277_3 --> 8.6.9-h84994c4_1001 conda-forge\n",
"\n",
"Preparing transaction: ...working... done\n",
"Verifying transaction: ...working... done\n",
"Executing transaction: ...working... done\n",
"\n",
"real\t2m15.460s\n",
"user\t1m51.840s\n",
"sys\t0m13.459s\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "Qal84ahazWZt",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# The trick\n",
"Since Miniconda now lives in `/usr/local` (which incidentally is also a default location to load static libraries), we only need to add the corresponding Python path to `sys.path` to enable imports."
]
},
{
"metadata": {
"id": "S-x_hxCTvfLR",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"import sys\n",
"sys.path.append('/usr/local/lib/python3.6/site-packages')"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "PJfhPWp8AacY",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"# Let's play!\n",
"Now you can just interact with the Notebook as you would normally do locally."
]
},
{
"metadata": {
"id": "MLW86ukM-FQo",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 287
},
"outputId": "04777a02-f738-428e-d188-6659f1e0d9bb"
},
"cell_type": "code",
"source": [
"import simtk.testInstallation\n",
"simtk.testInstallation.main()"
],
"execution_count": 11,
"outputs": [
{
"output_type": "stream",
"text": [
"There are 4 Platforms available:\n",
"\n",
"1 Reference - Successfully computed forces\n",
"2 CPU - Successfully computed forces\n",
"3 CUDA - Successfully computed forces\n",
"4 OpenCL - Successfully computed forces\n",
"\n",
"Median difference in forces between platforms:\n",
"\n",
"Reference vs. CPU: 6.3031e-06\n",
"Reference vs. CUDA: 6.73543e-06\n",
"CPU vs. CUDA: 7.81258e-07\n",
"Reference vs. OpenCL: 6.75426e-06\n",
"CPU vs. OpenCL: 8.15821e-07\n",
"CUDA vs. OpenCL: 2.17776e-07\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "-Kec4iO4-Hk-",
"colab_type": "code",
"outputId": "cdcbccde-0565-477e-c3c6-9b10ecb627a4",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 287
}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"There are 4 Platforms available:\n",
"\n",
"1 Reference - Successfully computed forces\n",
"2 CPU - Successfully computed forces\n",
"3 CUDA - Successfully computed forces\n",
"4 OpenCL - Successfully computed forces\n",
"\n",
"Median difference in forces between platforms:\n",
"\n",
"Reference vs. CPU: 6.30074e-06\n",
"Reference vs. CUDA: 6.73715e-06\n",
"CPU vs. CUDA: 7.74544e-07\n",
"Reference vs. OpenCL: 6.75426e-06\n",
"CPU vs. OpenCL: 8.1607e-07\n",
"CUDA vs. OpenCL: 2.22395e-07\n"
],
"name": "stdout"
}
]
},
{
"metadata": {
"id": "coYp1Oyp-kmS",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment