Skip to content

Commit

Permalink
Merge pull request #187 from SouthernMethodistUniversity/update_examples
Browse files Browse the repository at this point in the history
Update examples
  • Loading branch information
jrlagrone authored Jul 19, 2024
2 parents 4b00808 + 8505354 commit 433457c
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 18 deletions.
4 changes: 4 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ parts:
- file: about.md
sections:
- file: about/queues.md
- file: about/contact.md
- file: accounts.md
- file: access.md
- file: portal.md
- file: m3_migration.md
- file: mp_update.md
- caption: Applications
chapters:
- file: examples/chemistry.md
sections:
- file: examples/amber/index.md
- file: examples/conda/README.md
- file: examples/torch/README.md
- caption: Tutorials
Expand Down
17 changes: 17 additions & 0 deletions docs/about/contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(about:contact)=
# Contact

We can be contacted using SMU's Help Desk.

Tickets can be directly created using the [STABLE ticketing system](https://www.smu.edu/OIT/services/STABLE).

You can also email [[email protected]](mailto:[email protected]?subject=[HPC]). Please be sure to include `[HPC]` in the subject for more expedient routing.

# GitHub

:::{important}
Time critical and emergency issues should **always** go through SMU's Help Desk.
:::

We also actively use GitHub. You are welcome to open issues and/or create pull requests [our github page](https://github.com/SouthernMethodistUniversity/hpc_docs).

1 change: 1 addition & 0 deletions docs/about/queues.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(about:queues)=
# Queues

SMU's high-performance computing (HPC) clusters use [SLURM](https://slurm.schedmd.com/)
Expand Down
19 changes: 9 additions & 10 deletions docs/examples/amber/amber_cpu_example.sbatch
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/bin/bash
#SBATCH -J example
#SBATCH -o example_%j.out
#SBATCH -p dev
#SBATCH -N 1
#SBATCH --ntasks-per-node=4
#SBATCH -J amber_example # Job name, display in queue
#SBATCH -o amber_example_%j.out # output file, %j is the job id
#SBATCH -p dev # partition to use
#SBATCH -N 1 # number of nodes
#SBATCH -c 1 # number of cpu cores per task
#SBATCH --ntasks-per-node=4 # number of tasks per node
#SBATCH --mem=1G # memory per node
#SBATCH -t 0-00:03:00 # run time, days-HH:MM:SS

# Amber
module purge
module use ../../../modules/m3/applications/
module load amber

echo $(module list)
echo $(which mpicc)
module load amber/22

# Program Command
srun sander.MPI -O -o stdout -i alanine_md.in -c alanine_md.rst -p alanine_md.prmtop -r alanine_md_new.rst -x alanine_md_new.mdcrd
Expand Down
57 changes: 57 additions & 0 deletions docs/examples/amber/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Amber

**Amber** is a suite of biomolecular simulation programs.

**Amber homepage**: [ambermd.org/](https://ambermd.org/)

**Official Amber Tutorials**: [ambermd.org/tutorials/](https://ambermd.org/tutorials/)

:::{seealso}
For examples and tips on submitting jobs, see [our SLURM documentation](tutorials:slurm) and [Best Practices for Jobs](tutorials:slurm:best_practices)

For compute resources, see [HPC Queues](about:queues)
:::

## Using Amber on the SuperPod

Files used in the example are available:

- [on github](https://github.com/SouthernMethodistUniversity/hpc_docs/tree/update_examples/docs/examples/amber)
- on the SuperPod at `/hpc/mp/examples/amber/`

### Example submission script

The following job script can be submitted using `sbatch amber_gpu_example.sbatch`.

```{literalinclude} amber_gpu_example.sbatch
---
language: bash
linenos: true
---
```

## Using Amber on M3

Files used in the example are available:

- [on github](https://github.com/SouthernMethodistUniversity/hpc_docs/tree/update_examples/docs/examples/amber)
- on M3 at `/hpc/m3/examples/amber/`

### Example submission script

The following job script can be submitted using `sbatch amber_cpu_example.sbatch`.

This example should run in approximately 90 seconds and use about 600 MB of memory when using 4 cores. Therefore, we request 1 GB of memory and 3 minutes of run time to give
ourselves some room for error.

Note, we know this from running the job.
It is always a good idea to review the resources your jobs use
and adjust future jobs to more accurately request resources.

```{literalinclude} amber_cpu_example.sbatch
---
language: bash
linenos: true
---
```

13 changes: 13 additions & 0 deletions docs/examples/chemistry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(examples:chemistry)=
# Chemistry

We have examples of submitting jobs using the following
software packages.

If you would like examples for other software packages,
please [contact us.](about:contact).

You can also submit issues and/or pull requests for updates or additions at
[our github page](https://github.com/SouthernMethodistUniversity/hpc_docs)

- [Amber](amber/index.md)
13 changes: 13 additions & 0 deletions docs/examples/fluid_dynamics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(examples:fluids)=
# Fluid Dynamics

We have examples of submitting jobs using the following
software packages.

If you would like examples for other software packages,
please [contact us.](about:contact).

You can also submit issues and/or pull requests for updates or additions at
[our github page](https://github.com/SouthernMethodistUniversity/hpc_docs)

- [OpenFOAM (.com)](openfoam/index.md)
65 changes: 65 additions & 0 deletions docs/examples/openfoam/decomposeParDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object decomposeParDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


numberOfSubdomains 4;

method simple;

simpleCoeffs
{
n (1 4 1);
delta 0.001;
}

hierarchicalCoeffs
{
n (1 1 1);
delta 0.001;
order xyz;
}

metisCoeffs
{
processorWeights
(
1
1
1
);
}

manualCoeffs
{
dataFile "";
}

distributed no;

roots
(
);


// ************************************************************************* //
44 changes: 44 additions & 0 deletions docs/examples/openfoam/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# OpenFoam (.com)

**OpenFoam** is an open source Computation Fluid Dynamics Package.

**OpenFoam homepage**: [openfoam.com/](https://www.openfoam.com/)

**Official OpenFoam Tutorials**: [openfoam.com/documentation/tutorial-guide](https://www.openfoam.com/documentation/tutorial-guide)


:::{seealso}
For examples and tips on submitting jobs, see [our SLURM documentation](tutorials:slurm) and [Best Practices for Jobs](tutorials:slurm:best_practices)

For compute resources, see [HPC Queues](about:queues)
:::


## Using OpenFoam on M3

Files used in the example are available:

- [on github](https://github.com/SouthernMethodistUniversity/hpc_docs/tree/update_examples/docs/examples/openfoam)
- on M3 at `/hpc/m3/examples/openfoam/`

### Example submission script

The following job script can be submitted using `sbatch openfoam_example.sbatch`.

It requires a `decomposeParDict` to run, (see e.g. [running in paralell](https://doc.cfd.direct/openfoam/user-guide-v12/running-applications-parallel)). An example file is included in the files mentioned above

This example should run in approximately 10 seconds and use about 600 MB of memory when using 4 tasks.
Therefore, we request 1 GB of memory and 3 minutes of run time to give
ourselves some room for error.

Note, we know this from running the job.
It is always a good idea to review the resources your jobs use
and adjust future jobs to more accurately request resources.

```{literalinclude} openfoam_cpu_example.sbatch
---
language: bash
linenos: true
---
```

7 changes: 0 additions & 7 deletions docs/examples/openfoam/openfoam.sh

This file was deleted.

31 changes: 31 additions & 0 deletions docs/examples/openfoam/openfoam_cpu_example.sbatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --mem=10G
#SBATCH --job-name=OpenFOAM
#SBATCH --output=output_OpenFOAM_%j.out
#SBATCH --time=00:05:00
#SBATCH -p dev

# load openfoam
module purge
module load gcc/11.2.0
module load openfoam/2312-5z7e7ot
module load openmpi/4.1.6-vfi4iwj

# make a test directory in scratch with the Job id
# NOTE: $SCRATCH has a 60 day purge policy
mkdir -p ${SCRATCH}/openfoam/test_run_${SLURM_JOB_ID}/
cd ${SCRATCH}/openfoam/test_run_${SLURM_JOB_ID}/

# copy example from official tutorial
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
chmod 700 -R pitzDaily && cd pitzDaily

# copy our decomposeParDict into the $SCRATCH job folder
cp ${SLURM_SUBMIT_DIR}/decomposeParDict system/decomposeParDict

# run the example
srun blockMesh
srun decomposePar
srun simpleFoam -parallel
2 changes: 1 addition & 1 deletion docs/tutorials/cpp/session_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ linenos: true
---
```

```{literalinclude} ../../examples/cpp/classes/inheritance_test.hpp
```{literalinclude} ../../examples/cpp/classes/inheritance_test.cpp
---
language: c++
linenos: true
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/slurm/best_practices.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(tutorials:slurm:best_practices)=
# Best Practices for Jobs

The following are some tips that will help your and everyone elses jobs use HPC resources more efficiently.
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/slurm/slurm.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(tutorials:slurm)=
# Slurm

## Submitting Jobs Using Slurm
Expand Down

0 comments on commit 433457c

Please sign in to comment.