Skip to content

Commit

Permalink
Merge pull request #5 from RuiApostolo/gh-pages
Browse files Browse the repository at this point in the history
Updates to course
RuiApostolo authored Oct 14, 2024
2 parents e969a67 + c80778b commit 3bbc561
Showing 20 changed files with 694 additions and 748 deletions.
65 changes: 28 additions & 37 deletions _episodes/00-welcome.md
Original file line number Diff line number Diff line change
@@ -15,28 +15,26 @@ keypoints:

## Course structure and method

Rather than having separate lectures and practical sessions, this course is taught following
[The Carpentries methodology](https://carpentries.org) where we all work together through material
learning key skills and information throughout the course. Typically, this follows the method of
the instructor demonstrating and then the attendees doing along with the instructor.
Rather than having separate lectures and practical sessions, this course is taught following [The Carpentries methodology](https://carpentries.org)
where we all work together through material learning key skills and information throughout the course.
Typically, this follows the method of the instructor demonstrating and then the attendees doing along with the instructor.

The instructors are available to assist you and to answer any questions you may have as we
work through the material together. You should feel free to ask questions of the instructor
whenever you like. The instructor will also provide many opportunities to pause and ask questions.
The instructors are available to assist you and to answer any questions you may have as we work through the material together.
You should feel free to ask questions of the instructor whenever you like.
The instructor will also provide many opportunities to pause and ask questions.

We will also make use of a shared collaborative document - the *etherpad*. You will find a link
to this collaborative document on the course page. We will use it for a number of different purposes,
for example, it may be used during exercises and instructors and helpers may put useful information
or links in the etherpad that help or expand on the material being taught. If you have useful
information to share with the class then please do add it to the etherpad. At the end of the course,
we take a copy of the information in the etherpad, remove any personally-identifiable information
and post this on the course archive page so you should always be able to come back and find any
information you found useful.
We will also make use of a shared collaborative document - the *etherpad*.
You will find a link to this collaborative document on the course page.
We will use it for a number of different purposes, for example,
it may be used during exercises and instructors and helpers may put useful information or links in the etherpad that help or expand on the material being taught.
If you have useful information to share with the class then please do add it to the etherpad.
At the end of the course, we take a copy of the information in the etherpad, remove any personally-identifiable information,
and post this on the course archive page so you should always be able to come back and find any information you found useful.

> ## Introductions
>
> Let's use the etherpad to introduce ourselves. Please go to this course's
> etherpad and let us know the following:
> Let's use the etherpad to introduce ourselves.
> Please go to this course's etherpad and let us know the following:
> - Your name
> - Your place of work
> - Whether this is your first time using ARCHER2?
@@ -48,28 +46,21 @@ information you found useful.

## Feedback

Feedback is integral to how we approach training both during and after the course. In particular, we
use informal and structured feedback activities during the course to ensure we tailor the pace and
content appropriately for the attendees, and feedback after the course to help us improve our training
for the future.
Feedback is integral to how we approach training both during and after the course.
In particular, we use informal and structured feedback activities during the course to ensure we tailor the pace and content appropriately for the attendees,
and feedback after the course to help us improve our training for the future.

You will be issued with red and green "stickies" (or shown how to use their virtual equivalent for
online courses) to allow you to give the instructor and helpers quick visual feedback on how you
are getting on with the pace and the content of the course. If you are comfortable with the
pace/content then you should place your green sticky on the back of your laptop; if you are stuck,
have questions, or are struggling with the pace/content then you should place the red sticky on
the back of your laptop and a helper will come and speak to you. The instructor may also ask you
to use the stickies in other, specific situations.
You will be issued with red and green "stickies" (or shown how to use their virtual equivalent for online courses)
to allow you to give the instructor and helpers quick visual feedback on how you are getting on with the pace and the content of the course.
If you are comfortable with the pace/content then you should place your green sticky on the back of your laptop;
if you are stuck, have questions, or are struggling with the pace/content then you should place the red sticky on the back of your laptop and a helper will come and speak to you.
The instructor may also ask you to use the stickies in other, specific situations.

At the lunch break (and end of days for multi-day courses) we will also run a quick feedback
activity to gauge how the course is matching onto attendees requirements. Instructors and helpers
will review this feedback over lunch, or overnight, provide a summary of what we found at the
start of the next session and, potentially, how the upcoming material/schedule will be changed
to address the feedback.
At the lunch break (and end of days for multi-day courses) we will also run a quick feedback activity to gauge how the course is matching onto attendees requirements.
Instructors and helpers will review this feedback over lunch, or overnight, provide a summary of what we found at the start of the next session and, potentially,
how the upcoming material/schedule will be changed to address the feedback.

Finally, you will be provided with the opportunity to provide feedback on the course after it has
finished. We welcome all this feedback, both good and bad, as this information in key to allow
us to continually improve the training we offer.
Finally, you will be provided with the opportunity to provide feedback on the course after it has finished.
We welcome all this feedback, both good and bad, as this information in key to allow us to continually improve the training we offer.

{% include links.md %}

42 changes: 20 additions & 22 deletions _episodes/01-connecting.md
Original file line number Diff line number Diff line change
@@ -12,16 +12,13 @@ keypoints:

## Purpose

Attendees of this course will get access to the ARCHER2 HPC facility. You will
have the ability to request an account and to login to ARCHER2 before the
course begins. In this session, we will talk you through getting access to
ARCHER2. Please be aware that you will need to follow the
[ARCHER2 Code of Conduct](https://www.archer2.ac.uk/training/code-of-conduct/)
as a condition for access.
Attendees of this course will get access to the ARCHER2 HPC facility.
You will have the ability to request an account and to login to ARCHER2 before the course begins.
In this session, we will talk you through getting access to ARCHER2.
Please be aware that you will need to follow the [ARCHER2 Code of Conduct](https://www.archer2.ac.uk/training/code-of-conduct/) as a condition for access.

Note that if you are not able to login to ARCHER2 and do not attend this
session, you may struggle to run the course exercises as these were designed
to run on ARCHER2 specifically.
Note that if you are not able to login to ARCHER2 and do not attend this session,
you may struggle to run the course exercises as these were designed to run on ARCHER2 specifically.

## Connecting using SSH

@@ -36,29 +33,30 @@ Access to ARCHER2 is via SSH using **both** a password and a passphrase-protecte

## Passwords and password policy

When you first get an ARCHER2 account, you will get a single-use password from the
SAFE which you will be asked to change to a password of your choice. Your chosen
password must have the required complexity as specified in the
[ARCHER2 Password Policy](https://www.archer2.ac.uk/about/policies/passwords_usernames.html).
When you first get an ARCHER2 account, you will get a single-use password from the SAFE which you will be asked to change to a password of your choice.
Your chosen password must have the required complexity as specified in the [ARCHER2 Password Policy](https://www.archer2.ac.uk/about/policies/passwords_usernames.html).

The password policy has been chosen to allow users to use both complex, shorter passwords and
long, but comparatively simple passwords. For example, passwords in the style of both
`LA10!£lsty` and `correcthorsebatterystaple` would be supported.
The password policy has been chosen to allow users to use both complex, shorter passwords and long, but comparatively simple passwords.
For example, passwords in the style of both `LA10!£lsty` and `correcthorsebatterystaple` would be supported.

## SSH keys

As well as password access, users are required to add the public part of an SSH key pair to access ARCHER2.
The public part of the key pair is associated with your account using the SAFE web interface.
See the ARCHER2 User and Best Practice Guide for information on how to create SSH key pairs
and associate them with your account:
See the ARCHER2 User and Best Practice Guide for information on how to create SSH key pairs and associate them with your account:

* [Connecting to ARCHER2](https://docs.archer2.ac.uk/user-guide/connecting/)

## Data transfer services: scp, rsync, Globus Online
## MFA/TOTP

ARCHER2 supports a number of different data transfer mechanisms. The one you choose depends
on the amount and structure of the data you want to transfer and where you want to transfer
the data to. The three main options are:
Multi-factor authentication, under the form of timed one-time passwords, are now mandatory on ARCHER2 accounts.
To create one, please follow the instructions in our [SAFE documentation](https://docs.archer2.ac.uk/user-guide/connecting/#mfa-time-based-one-time-passcode-totp-code).

## Data transfer services: scp, rsync

ARCHER2 supports a number of different data transfer mechanisms.
The one you choose depends on the amount and structure of the data you want to transfer and where you want to transfer the data to.
The two main options are:

* `scp`: The standard way to transfer small to medium amounts of data off ARCHER2 to any other location
* `rsync`: Used if you need to keep small to medium data-sets synchronised between two different locations
293 changes: 140 additions & 153 deletions _episodes/02-lammps-on-archer2.md

Large diffs are not rendered by default.

263 changes: 107 additions & 156 deletions _episodes/03-simulation-setup.md

Large diffs are not rendered by default.

144 changes: 0 additions & 144 deletions _episodes/04-running-simulation.md

This file was deleted.

132 changes: 132 additions & 0 deletions _episodes/04-understanding-logfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
title: "Understanding the logfile"
teaching: 20
exercises: 0
questions:
- "What information does LAMMPS print to screen/logfile?"
- "What does that information mean?"
objectives:
- "Understand the information that LAMMPS prints to screen / writes to the logfile before, during, and after a simulation."
keypoints:
- "Thermodynamic information outputted by LAMMPS can be used to track whether a simulations is running OK."
- "Performance data at the end of a logfile can give us insights into how to make a simulation faster."
---

## Log file

The logfile is where we can find thermodynamic information of interest.
By default, LAMMPS will write to a file called `log.lammps`.
All info output to the terminal is replicated in this file.
We can change the name of the logfile by adding a `log` command to your script:

```
log new_file_name.extension
```

We can change which file to write to multiple times during a simulation, and even `append` to a file if, for example,
we want the thermodynamic data separate from the logging of other assorted commands.
The thermodynamic data, which we setup with the `thermo` and `thermo_style` command, create the following (truncated) output:

```
Step Temp TotEng PotEng KinEng Press Volume Density
0 1 -2.709841 -4.208341 1.4985 -2.6415761 1666.6667 0.6
500 0.91083091 -2.6743978 -4.0392779 1.3648801 -0.1637597 1666.6667 0.6
1000 0.96279851 -2.6272603 -4.0700139 1.4427536 -0.14422949 1666.6667 0.6
1500 0.97878978 -2.6029892 -4.0697057 1.4667165 -0.11813628 1666.6667 0.6
2000 0.93942595 -2.5817381 -3.9894679 1.4077298 -0.31689463 1666.6667 0.6
```

At the start, we get a header with the column names, and then a line for each time-step that's a multiple of the value we set `thermo` to.
In this example, we're running an NVT simulation, so we've fixed the number of particles, the volume and dimensions of the simulation box, and the temperature
-- we can see from the logfile that `Volume` and `Density` remain constant (but not `Temp`).
This would change if we used a different ensemble.
At the end of each `run` command, we get the analysis of how the simulation time is spent:

```
Loop time of 4.2033 on 128 procs for 50000 steps with 1000 atoms
Performance: 5138815.615 tau/day, 11895.407 timesteps/s
99.3% CPU use with 128 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.25206 | 0.29755 | 0.34713 | 4.5 | 7.08
Neigh | 0.21409 | 0.22675 | 0.23875 | 1.2 | 5.39
Comm | 2.9381 | 3.097 | 3.2622 | 4.6 | 73.68
Output | 0.0041445 | 0.0049069 | 0.0052867 | 0.4 | 0.12
Modify | 0.40665 | 0.53474 | 0.67692 | 10.0 | 12.72
Other | | 0.04237 | | | 1.01
Nlocal: 7.8125 ave 12 max 5 min
Histogram: 6 21 22 0 37 29 0 11 1 1
Nghost: 755.055 ave 770 max 737 min
Histogram: 2 6 4 18 23 20 30 13 7 5
Neighs: 711.773 ave 1218 max 392 min
Histogram: 8 14 24 15 31 22 11 1 0 2
Total # of neighbors = 91107
Ave neighs/atom = 91.107
Neighbor list builds = 4999
Dangerous builds = 4996
Total wall time: 0:00:04
```

The data shown here is very important to understand the computational performance of our simulation,
and we can it to help improve the speed at which our simulations run substantially.
The first line gives us the details of the last `run` command - how many seconds it took, on how many processes it ran on, how many time-steps, and how many atoms.
This can be useful to compare between different systems.

Then we get some benchmark information:

```
Performance: 5138815.615 tau/day, 11895.407 timesteps/s
99.3% CPU use with 128 MPI tasks x 1 OpenMP threads
```

This tells us how many time units per day, and how many time-steps per second we are running.
It also tells us how much of the available CPU resources LAMMPS was able to use, and how many MPI tasks and OpenMP threads.

The next table shows a breakdown of the time spent on each task by the MPI library:

```
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.25206 | 0.29755 | 0.34713 | 4.5 | 7.08
Neigh | 0.21409 | 0.22675 | 0.23875 | 1.2 | 5.39
Comm | 2.9381 | 3.097 | 3.2622 | 4.6 | 73.68
Output | 0.0041445 | 0.0049069 | 0.0052867 | 0.4 | 0.12
Modify | 0.40665 | 0.53474 | 0.67692 | 10.0 | 12.72
Other | | 0.04237 | | | 1.01
```

There are 8 possible MPI tasks in this breakdown:

- `Pair` refers to non-bonded force computations
- `Bond` includes all bonded interactions, (so angles, dihedrals, and impropers)
- `Kspace` relates to long-range interactions (Ewald, PPPM or MSM)
- `Neigh` is the construction of neighbour lists
- `Comm` is inter-processor communication (AKA, parallelisation overhead)
- `Output` is the writing of files (log and dump files)
- `Modify` is the fixes and computes invoked by fixes
- `Other` is everything else

Each category shows a breakdown of the least, average, and most amount of wall time any processor spent on each category
-- large variability in this (calculated as `%varavg`) indicates a load imbalance (which can be caused by the atom distribution between processors not being optimal).
The final column, `%total`, is the percentage of the loop time spent in the category.

> ## A rule-of-thumb for %total on each category
> - `Pair`: as much as possible.
> - `Neigh`: 10% to 30%.
> - `Kspace`: 10% to 30%.
> - `Comm`: as little as possible. If it's growing large, it's a clear sign that too many computational resources are being assigned to a simulation.
{: .callout}

The last line on every LAMMPS simulation will be the total wall time for the entire input script, no matter how many `run` commands it has:

```
Total wall time: 0:00:04
```

{% include links.md %}
247 changes: 96 additions & 151 deletions _episodes/05-advanced-inputs.md

Large diffs are not rendered by default.

42 changes: 15 additions & 27 deletions _episodes/06-extra-software.md
Original file line number Diff line number Diff line change
@@ -15,23 +15,16 @@ keypoints:

## GPU acceleration

LAMMPS has the capability to use GPUs to accelerate the calculations
needed to run a simulation, but the program needs to be compiled with the
correct parameters for this option to be available. Furthermore, LAMMPS can
exploit multiple GPUs on the same system, although the performance scaling
depends heavily on the particular system. As always, we recommend that each
user should run benchmarks for their particular use-case to ensure that they
are getting performance benefits. While not every LAMMPS forcefield or fix is
available for GPU, a vast majority are, and more are added with each new
version. Check the LAMMPS documentation for GPU compatibility with a specific
command.
LAMMPS has the capability to use GPUs to accelerate the calculations needed to run a simulation, but the program needs to be compiled with the correct parameters for this option to be available.
Furthermore, LAMMPS can exploit multiple GPUs on the same system, although the performance scaling depends heavily on the particular system.
As always, we recommend that each user should run benchmarks for their particular use-case to ensure that they are getting performance benefits.
While not every LAMMPS force field or fix is available for GPU, a vast majority are, and more are added with each new version.
Check the LAMMPS documentation for GPU compatibility with a specific command.

To use the GPU accelerated commands, you will need to be an extra flag when
calling the LAMMPS binary: `-pk gpu <number_of_gpus_to_use>`. You will also
need to add the `\gpu` suffix to all the styles intended to be accelerated
this way. Alternatively, you can use the `-sf gpu` flag to append the `\gpu`
suffix to all styles that support it (though this is at your own risk). So,
for example, if ARCHER2 had GPUs, you would change the `srun` line from:
To use the GPU accelerated commands, you will need to be an extra flag when calling the LAMMPS binary: `-pk gpu <number_of_gpus_to_use>`.
You will also need to add the `\gpu` suffix to all the styles intended to be accelerated this way or,
alternatively, you can use the `-sf gpu` flag to append the `\gpu` suffix to all styles that support it (though this is at your own risk).
So, for example, if ARCHER2 had GPUs, you would change the `srun` line from:

```
srun lmp -i in.ethanol -l log.$SLURM_JOB_ID
@@ -43,22 +36,17 @@ to:
srun lmp -pk gpu 1 -sf gpu -i in.ethanol -l log.$SLURM_JOB_ID
```

This will run LAMMPS on a single GPU, as well as making use of any MPI tasks
and OMP threads that you had defined in your Slurm submission script.
This will run LAMMPS on a single GPU, as well as making use of any MPI tasks and OMP threads that you had defined in your Slurm submission script.

## Visualisation

One of the most widely used 3D visualisation tools is
[VMD (Visual Molecular Dynamics)](https://www.ks.uiuc.edu/Research/vmd/). This
is a licensed software (with free licenses for academic use), with executables
available for Linux, MacOS (x86\_64 and ARM), and Windows.
One of the most widely used 3D visualisation tools is [VMD (Visual Molecular Dynamics)](https://www.ks.uiuc.edu/Research/vmd/).
This is a licensed software (with free licenses for academic use), with executables available for Linux, MacOS (x86\_64 and ARM), and Windows.

There are many plugins that extend the base functionalities, and more
plugins/scripts can be created using `tcl/tk` language.
There are many plugins that extend the base functionalities, and more plugins/scripts can be created using `tcl/tk` language.

One of the main plugins, that comes with the base installation, is TopoTools,
and it is incredibly useful for interfacing with LAMMPS, as it allows to read
and write LAMMPS data and trajectory files.
One of the main plugins, that comes with the base installation, is TopoTools, and it is incredibly useful for interfacing with LAMMPS,
as it allows to read and write LAMMPS data and trajectory files.

## Other software

58 changes: 19 additions & 39 deletions _episodes/07-wrapup.md
Original file line number Diff line number Diff line change
@@ -18,58 +18,38 @@ keypoints:

## LAMMPS resources

The [LAMMPS manual](https://docs.lammps.org/Manual.html) is, in my opinion, a
very well written manual with a lot of information about the various
functionalities of LAMMPS. It is my go-to when I want to learn how to run a
LAMMPS command, or when I want to understand how LAMMPS implements a specific
functionality.
The [LAMMPS manual](https://docs.lammps.org/Manual.html) is, in my opinion, a very well written manual with a lot of information about the various functionalities of LAMMPS.
It is my go-to when I want to learn how to run a LAMMPS command, or when I want to understand how LAMMPS implements a specific functionality.

In this manual, there is a handy [How-to](https://docs.lammps.org/Howto.html)
section. You can find a number of tutorials in there for understanding and
running various simulations.
In this manual, there is a handy [How-to](https://docs.lammps.org/Howto.html) section.
You can find a number of tutorials in there for understanding and running various simulations.

The [LAMMPS example scripts](https://docs.lammps.org/Examples.html) that come
with the source code are an excellent source of inspiration and a great
starting point for testing ideas. When I want to understand how to use a
function, I will check whether there is an exercise that uses said function
and use that as a template to get my system to work.
The [LAMMPS example scripts](https://docs.lammps.org/Examples.html) that come with the source code are an excellent source of inspiration and a great starting point for testing ideas.
When I want to understand how to use a function, I will check whether there is an exercise that uses said function and use that as a template to get my system to work.

Finally, there is the [LAMMPS mailing list](https://matsci.org/c/lammps/40).
You can post questions to this list to have them answered by other members of
the LAMMPS community and by the LAMMPS developers. A lot of repeat questions
get asked there, so before you post your question, have a look through the
records to check that someone has not already asked it.
Finally, there is the [LAMMPS mailing list](https://matsci.org/c/lammps/40).
You can post questions to this list to have them answered by other members of the LAMMPS community and by the LAMMPS developers.
A lot of repeat questions get asked there, so before you post your question, have a look through the records to check that someone has not already asked it.

## ARCHER2 resources

If you attended the live course, you will retain access to your `ta100`
account (with a small amount of budget) for a couple of months following the
course. This is to allow you to make sure that you understood all of the
course materials and have an opportunity to run any of the exercise
simulations that you did not have time to complete in the training lesson.
If you attended the live course, you will retain access to your `ta176` account (with a small amount of budget) for a few weeks following the course.
This is to allow you to make sure that you understood all of the course materials,
and have an opportunity to run any of the exercise simulations that you did not have time to complete in the training lesson.
This is also to let you test out your own simulations on ARCHER2.

If you have any questions about using ARCHER2, the first port of call is the
[ARCHER2 manual](https://docs.archer2.ac.uk/). This manual covers a number of
aspects of using ARCHER2, from the more simple "How to I get a program to run"
to the more complex "How can I debug my software efficiently on a
supercomputer".
If you have any questions about using ARCHER2, the first port of call is the [ARCHER2 manual](https://docs.archer2.ac.uk/).
This manual covers a number of aspects of using ARCHER2, from the more simple "How to I get a program to run",
to the more complex "How can I debug my software efficiently on a supercomputer".

If you cannot find the answer to your question, please contact the ARCHER2
support team by email at support@archer2.ac.uk.
If you cannot find the answer to your question, please contact the ARCHER2 support team by email at support@archer2.ac.uk.

## ARCHER2 Training

There is lots of training material available through the ARCHER2 service
covering many different topics and to suit many different levels of
experience.
There is lots of training material available through the ARCHER2 service covering many different topics and to suit many different levels of experience.

Details of courses, the upcoming schedule and information on how to register
can be found in the
[ARCHER2 training pages](https://www.archer2.ac.uk/training/).
Details of courses, the upcoming schedule and information on how to register can be found in the [ARCHER2 training pages](https://www.archer2.ac.uk/training/).

You can also find course material (and sometimes recordings) for previous
ARCHER2 courses in the
[ARCHER2 course repository](https://www.archer2.ac.uk/training/materials/)
You can also find course material (and sometimes recordings) for previous ARCHER2 courses in the [ARCHER2 course repository](https://www.archer2.ac.uk/training/materials/)

{% include links.md %}
21 changes: 14 additions & 7 deletions _episodes/08-creating-topology.md
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ In this example, we will have two.

```
structure water.xyz
number 2000
number 1300
inside cube 15. 15. 30. 50.
end structure
```
@@ -59,6 +59,12 @@ The first line starts the `structure` section, and selects which file to read th
Then `number` selects how many molecules the final system will have.
The next line, the constraint, selects how the molecules will be arranged in the final system, in this case, on a cube, with side `50` angstrom, and with origin at (15, 15, 30).

You can then run the script using the `packmol command` as so:

```bash
packmol < pack.inp
```

This results in a cube of water molecules as so:

{% include figure.html url="" max-width="60%" file="/fig/08-create-topology/water.gif" alt="Cube of water molecules." %}
@@ -70,7 +76,7 @@ You can also combine constrains, for example, here we constrain the ethanol mole

```
structure ethanol.xyz
number 2000
number 1300
inside box 1. 1. 1. 79. 79. 109.
outside cube 15. 15. 30. 50.
end structure
@@ -100,7 +106,7 @@ In the next section, we will use **VMD** to automatically create the bonds, angl
> fixed 0. 0. 0. 0. 0. 0.
> end structure
> structure water.xyz
> number 2000
> number 1300
> inside cube 1. 1. 1. 99.
> end structure
> ```
@@ -162,12 +168,12 @@ In the next section, we will use **VMD** to automatically create the bonds, angl
> > filetype xyz
> >
> > structure water.xyz
> > number 2000
> > number 1300
> > inside cube 15. 15. 30. 50.
> > end structure
> >
> > structure ethanol.xyz
> > number 2000
> > number 1300
> > inside box 1. 1. 1. 79. 79. 109.
> > outside cube 15. 15. 30. 50.
> > end structure
@@ -243,7 +249,9 @@ package require topotools
Then, there is a definition for a function that calculates the total charge of the system -- wrong charge in a LAMMPS simulation is a very common source of crashes and/or bad simulation results.
```
proc get_total_charge {{molid top}} { eval "vecadd [[atomselect $molid all] get charge]" }
proc get_total_charge {{molid top}} {
eval "vecadd [[atomselect $molid all] get charge]"
}
```
Now, we use the next two commands to recalculate the bonds, using the radii set in the two `.tcl` files we sources previously, and to re-name them using the scheme `atom1name-atom2name`
@@ -411,4 +419,3 @@ topo writelammpsdata data.water_ethanol
{: .challenge}
{% include links.md %}
8 changes: 4 additions & 4 deletions exercises/1-performance-exercise/sub.slurm
Original file line number Diff line number Diff line change
@@ -6,23 +6,23 @@
#SBATCH --time=0:20:0
#SBATCH --hint=nomultithread
#SBATCH --distribution=block:block
#SBATCH --tasks-per-node=1
#SBATCH --tasks-per-node=64
#SBATCH --cpus-per-task=1

# The budget code of the project
#SBATCH --account=ta100
#SBATCH --account=ta176
# Standard partition
#SBATCH --partition=standard
# Short QoS since our runtime is under 20m
#SBATCH --qos=short

# load the lammps module
module load lammps/23_Jun_2022
module load lammps

# Set the number of threads to 1
# This prevents any threaded system libraries from automatically
# using threading.
export OMP_NUM_THREADS=1

# Launch the parallel job
srun lmp -i in.ethanol -l ${SLURM_NPROCS}_cpus.log.${SLURM_JOB_ID}
srun lmp -i in.ethanol -l log.${SLURM_NPROCS}_cpus
3 changes: 0 additions & 3 deletions exercises/2-lj-exercise/in.lj_exercise
Original file line number Diff line number Diff line change
@@ -80,9 +80,6 @@ timestep 0.005
thermo_style custom step temp etotal pe ke press vol density
thermo 500

compute RDF all rdf 150 cutoff 3.5
fix RDF_OUTPUT all ave/time 50 950 50000 c_RDF[*] file rdf_lj_${DENSITY}.out mode vector

run_style verlet

run 50000
4 changes: 2 additions & 2 deletions exercises/2-lj-exercise/sub.slurm
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@
#SBATCH --cpus-per-task=1

# The budget code of the project
#SBATCH --account=ta100
#SBATCH --account=ta176
# Standard partition
#SBATCH --partition=standard
# Short QoS since our runtime is under 20m
#SBATCH --qos=short

# load the lammps module
module load lammps/23_Jun_2022
module load lammps

# Set the number of threads to 1
# This prevents any threaded system libraries from automatically
6 changes: 3 additions & 3 deletions exercises/3-advanced-inputs-exercise/sub.slurm
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@
#SBATCH --cpus-per-task=1

# The budget code of the project
#SBATCH --account=ta100
#SBATCH --account=ta176
# Standard partition
#SBATCH --partition=standard
# Short QoS since our runtime is under 20m
#SBATCH --qos=short

# load the lammps module
module load lammps/23_Jun_2022
module load lammps/

# Set the number of threads to 1
# This prevents any threaded system libraries from automatically
@@ -26,5 +26,5 @@ export OMP_NUM_THREADS=1

# Launch the parallel job
srun lmp -i in.lj_exercise -l log.start.$SLURM_JOB_ID
#srun lmp -i in.lj_restart -l log.start.$SLURM_JOB_ID
#srun lmp -i in.lj_restart -l log.restart.$SLURM_JOB_ID
#srun lmp -i in.lj_rerun -l log.rerun.$SLURM_JOB_ID
41 changes: 41 additions & 0 deletions exercises/4-creating-topology/ethanol.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set selECH [atomselect top {name ECH}]
$selECH set mass 12.011
$selECH set type ECH
$selECH set charge -0.18
$selECH set element C
$selECH set radius 1.4

set selECO [atomselect top {name ECO}]
$selECO set mass 12.011
$selECO set type ECO
$selECO set charge 0.145
$selECO set element C
$selECO set radius 1.4

set selEHC [atomselect top {name EHC}]
$selEHC set mass 1.008
$selEHC set type EHC
$selEHC set charge 0.06
$selEHC set element H
$selEHC set radius 0.8

set selEHA [atomselect top {name EHA}]
$selEHA set mass 1.008
$selEHA set type EHA
$selEHA set charge 0.06
$selEHA set element H
$selEHA set radius 0.8

set selEHO [atomselect top {name EHO}]
$selEHO set mass 1.008
$selEHO set type EHO
$selEHO set charge 0.418
$selEHO set element H
$selEHO set radius 0.8

set selEOH [atomselect top {name EOH}]
$selEOH set mass 15.999
$selEOH set type EOH
$selEOH set charge -0.683
$selEOH set element O
$selEOH set radius 1.4
11 changes: 11 additions & 0 deletions exercises/4-creating-topology/ethanol.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
9
Ethanol
EHC 1.8853 -0.0401 1.0854
ECH 1.2699 -0.0477 0.1772
EHC 1.5840 0.8007 -0.4449
EHC 1.5089 -0.9636 -0.3791
ECO -0.2033 0.0282 0.5345
EHA -0.4993 -0.8287 1.1714
EHA -0.4235 0.9513 1.1064
EOH -0.9394 0.0157 -0.6674
EHO -1.8540 0.0626 -0.4252
15 changes: 15 additions & 0 deletions exercises/4-creating-topology/pack.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
tolerance 2.0

output water_ethanol.xyz
filetype xyz

structure water.xyz
number 1300
inside cube 15. 15. 30. 50.
end structure

structure ethanol.xyz
number 1300
inside box 1. 1. 1. 79. 79. 109.
outside cube 15. 15. 30. 50.
end structure
29 changes: 29 additions & 0 deletions exercises/4-creating-topology/topo.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package require topotools
proc get_total_charge {{molid top}} {
eval "vecadd [[atomselect $molid all] get charge]"
}
mol bondsrecalc all
topo retypebonds
topo guessangles
topo guessdihedrals

puts ""
puts "Bond type names: "
puts [ topo bondtypenames ]
puts ""
puts "Angle type names: "
puts [ topo angletypenames ]
puts ""
puts "Dihedral type names: "
puts [ topo dihedraltypenames ]
puts ""
puts ""
puts [format "Number of bonds: %s" [topo numbonds] ]
puts [format "Number of bonds types: %s" [topo numbondtypes] ]
puts [format "Number of angles: %s" [topo numangles] ]
puts [format "Number of angles types: %s" [topo numangletypes] ]
puts [format "Number of dihedral: %s" [topo numdihedrals] ]
puts [format "Number of dihedral types: %s" [topo numdihedraltypes] ]
puts [format "Total charge: %s" [get_total_charge] ]
puts ""
topo writelammpsdata data.water_ethanol
13 changes: 13 additions & 0 deletions exercises/4-creating-topology/water.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set selwo [atomselect top {name WO}]
$selwo set mass 15.999
$selwo set type WO
$selwo set charge -0.8340
$selwo set element O
$selwo set radius 1.2

set selwh [atomselect top {name WH}]
$selwh set mass 1.008
$selwh set type WH
$selwh set charge 0.4170
$selwh set element H
$selwh set radius 0.8
5 changes: 5 additions & 0 deletions exercises/4-creating-topology/water.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3
Water molecule
WO 0.00000 0.00000 0.11779
WH 0.00000 0.75545 -0.47116
WH 0.00000 -0.75545 -0.47116

0 comments on commit 3bbc561

Please sign in to comment.