Skip to content

ljwoods2/imd-workshop-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Welcome to the MDAnalysis 2024 trajectory streaming workshop! For the interactive activity, see interactive activity. If you're interested in using our tools after the workshop, see post workshop

Table of Contents

Workshop agenda

If you'd like to follow along with the speakers or use the demo codes after the workshop, all workshop demo code is available in this repo.

Topic Duration Code
๐Ÿ‘‹ Welcome 5 min
๐Ÿ“ฆ MDAnalysis mission & ecosystem 15 min
๐Ÿ–ผ๏ธ Streaming: big picture 15 min
๐Ÿ‘€ Streaming: first look 10 min streaming-101/LAMMPS/MDAnalysis/demo.ipynb
โ“ Q&A: Streaming overview 5 min
๐Ÿ“ฆStreaming: MD packages, IMDClient 15 min
๐Ÿ‘€ Demo: Multiple analyses on NAMD simulation stream 10 min namd-demos/rmsd-rdf/rmsd-rdf.ipynb
๐Ÿ’ค Break 10 min
๐ŸŽฏActivity: Write your own stream analysis 40 min See Interactive activity
๐Ÿ“ฆ Streaming: MDAnalysis functionality 10 min streaming-101/imd-mda/imd-mda.ipynb
โ“Q&A: Streaming with MDAnalysis 5 min
๐Ÿ‘€ Application: Velocity correlation functions and 2PT 10 min gromacs-demos/vdos/demo.ipynb
๐Ÿ‘€ Application: Ion channel permeation 10 min namd-demos/ion-flux/ion-flux.ipynb
โ“ Q&A: Applications 5 min
๐Ÿ”ฎ Future direction 5 min
๐Ÿ“– Open Forum 20 min
๐Ÿšช Closing 5 min

Interactive activity

To get started, we recommend using VSCode in the browser with the Github codespace we've provided which includes all the tools you'll need to get started with live simulation streaming.

1. Codespace environment setup

i. Github codespaces in the browser (recommended)

The easiest way is to simply use this repository to create a codespace. A workshop environment will be created and VSCode will automatically run in your browser.

Duplicate this tab so you will still have access to these instructions when the codespace is launched.

Select the green "Code" button and then create a codespace:

alt text alt text

You're done! The codespace will launch in the current tab. Move on to section 2 to get started with the activity.

ii. Github codespaces tunnel from your IDE (VSCode and Pycharm)

You can use your own IDE to spin up and connect to a codespace (which GitHub will host).

VSCode

If you have VSCode installed, you can install the codespace extension.

After installing, you'll see the "remote explorer" icon on the left. Sign in if you aren't already.

alt text

Select the dropdown arrow to select "Github codespaces" and then select the "+" to create a new codespace.

alt text

A dialog will appear. For the repository, enter "ljwoods2/imd-workshop-2024". For the branch, select "main" For the machine type, select "2 cores, 8GB RAM, 32 GB storage"

After that, VSCode will automatically launch a new window which is executing in the codespace workshop environment. To troubleshoot, see the documentation here.

Pycharm

A codespace extension is also available for Pycharm.

iii. Local codespace in IDE (VSCode only) (slow, not recommend)

You can also run the workshop activity locally if you have the devcontainers VScode extension and docker installed.

After docker is installed & enabled and your user has been added to the docker group, run:

git clone https://github.com/ljwoods2/imd-workshop-2024.git
code imd-workshop-2024

In VSCode, enter CTRL+SHIFT+P and type: "Dev Containers: Open Folder in Container..." and select the root of the cloned repo as the folder path. A new window will open which is executing in the workshop activity codespace.

2. Getting started with the activity

First, open the "activity/activity.ipynb" jupyter notebook from this repo in your codespace environment.

alt text

Before running any code, click the "Select kernel" button in the upper right corner of the jupyter notebook.

alt text

Select "Python environments" and then the "workshop" environment.

alt text alt text

Now you're ready to start the activity! Follow the instructions in the notebook to complete the activity.

Post-workshop

If you are interested in using our tools, please feel free to reach out for support, bug reports, or for sharing your ideas!

The best way to reach us is on the MDAnalysis Discord in the '#streaming' channel. You can also reach out via email ([email protected])

Below, we provide instructions for using the simulation engines integrated with IMDv3 capability.

Using IMDv3-compatible simulation engines

For docker usage, ensure docker is installed and the nvidia container toolkit is installed if using GPU builds.

GROMACS

With docker

First, pull the container:

# CPU-only build
docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU

# CUDA build
docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU

To run GROMACS, do:

# CPU
docker run -v /path/to/input/files:/home/conda:rw -p 8889:8889 \
    ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU bash -c 'gmx <cmd>'

# GPU
docker run -v /path/to/input/files:/home/conda:rw --runtime=nvidia --gpus=all -p 8889:8889 \
    ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU bash -c 'gmx <cmd>'

From source

The modified codes are available in this GROMACS fork.

First, clone in the repo:

git clone https://gitlab.com/ljwoods2/gromacs.git
git checkout imd-v3

For build instructions, see the GROMACS installation instructions

New options

New MDP file options (subject to change as we work with GROMACS developers):

IMD-group               = <group> ; Use 'System' to send the entire system via IMD (inherited from IMDv2)
IMD-version             = <2 | 3> ; Defaults to 2 for backwards compatibility
IMD-nst                 = <nst>   ; Number of integration steps between simulation frames communicated via IMD, defaults to 100
IMD-time                = <yes | no> ; Whether to send time and step information via IMD, defaults to 'no'
IMD-box                 = <yes | no> ; Whether to send box dimension information via IMD, defaults to 'no'
IMD-coords              = <yes | no> ; Whether to send atomic coordinate information via IMD, defaults to 'no'
IMD-vels                = <yes | no> ; Whether to send atomic velcities information via IMD, defaults to 'no'
IMD-forces              = <yes | no> ; Whether to send atomic forces information via IMD, defaults to 'no'
IMD-unwrap              = <yes | no> ; Whether to unwrap molecules to make them appear whole, defaults to 'no'
IMD-energies            = <yes | no> ; Whether to send system energy information via IMD, defaults to 'no'

Note that new options will not be used if "IMD-version" is set to 2.

mdrun command line options for IMD are inherited from IMDv2, see gmx-mdrun

LAMMPS

With docker

First, pull the container:

# CPU-only build
docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU

# CUDA build
docker pull ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU

To run LAMMPS, do:

# CPU
docker run -v /path/to/input/files:/home/conda:rw -p 8889:8889 \
    ghcr.io/becksteinlab/streaming-md-docker:main-Common-CPU bash -c 'lmp < </path/to/infile>'

# GPU
docker run -v /path/to/input/files:/home/conda:rw --runtime=nvidia --gpus=all -p 8889:8889 \
    ghcr.io/becksteinlab/streaming-md-docker:main-Common-GPU bash -c 'lmp < </path/to/infile>'

From source

The modified codes are available in this LAMMPS fork.

First, clone in the repo:

git clone https://github.com/ljwoods2/lammps.git
git checkout imd-v3-integration

Build instructions are available in the LAMMPS installation instructions

New options

Original options in the IMD fix are available here.

With our modifications:

fix ID group-ID imd <imd_port> [trate <imd_trate>] [version (2|3)] [unwrap (on|off)] [fscale <imd_fscale>] [time (on|off)] [box (on|off)] [coordinates (on|off)] [velocities (on|off)] [forces (on|off)]

'version' will default to 2 for backward compatibility, in which case the new options (time, box, positions, etc) will have no effect.

NAMD

Please reach out to us directly for instructions on using the modified NAMD codes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •