Skip to content

Commit 0ccf686

Browse files
committed
Updating the exercises for my batch section on Monday
1 parent ce1d734 commit 0ccf686

20 files changed

+45
-49
lines changed

Exercises/day3/c3se/mpi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Set a path where the example programs are installed.
1616
# Change the below to your own path to where you placed the example programs
17-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
17+
MYPATH=/mimer/NOBACKUP/groups/courses-fall-2025/<mydir-name>/Exercises/day3/programs/
1818

1919
ml purge > /dev/null 2>&1
2020
ml Python/3.13.5-GCCcore-14.3.0
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22
# Remember to change this to your own project ID!
3-
#SBATCH -A hpc2n2025-151
3+
#SBATCH -A naiss2025-22-934
44
# We are asking for 5 minutes
55
#SBATCH --time=00:05:00
66
# Asking for one core
77
#SBATCH -n 1
88

99
# Change to the directory where the data files and program are located
1010
# Change the below to your own path to where you placed the example programs
11-
cd /proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
11+
cd /mimer/NOBACKUP/groups/courses-fall-2025/<mydir-name>/Exercises/day3/programs/
12+
1213

1314
# Remove any loaded modules and load the ones we need
1415
module purge > /dev/null 2>&1
15-
module load GCC/12.3.0 Python/3.11.3 SciPy-bundle/2023.07 matplotlib/3.7.2
16+
module load matplotlib/3.10.5-gfbf-2025b
1617

1718
# Run your Python script
1819
python pandas_matplotlib-batch.py

Exercises/day3/c3se/run_mmmult.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22
# Change to your own project ID!
3-
#SBATCH -A hpc2n2025-151
3+
#SBATCH -A naiss2025-22-934
44
#SBATCH --time=00:10:00 # Asking for 10 minutes
55
#SBATCH -n 1 # Asking for 1 core
66

77
# Set a path where the example programs are installed.
88
# Change the below to your own path to where you placed the example programs
9-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
9+
MYPATH=/mimer/NOBACKUP/groups/courses-fall-2025/<mydir>/Exercises/day3/programs
1010

1111
# Load any modules you need, here for Python 3.11.3 and compatible SciPy-bundle
1212
module purge > /dev/null 2>&1
13-
module load GCC/12.3.0 OpenMPI/4.1.5 Python/3.11.3 SciPy-bundle/2023.07
13+
module load Python/3.11.3-GCCcore-12.3.0 OpenMPI/4.1.5-GCC-12.3.0 SciPy-bundle/2023.07-gfbf-2023a
1414

1515
# Run your Python script
1616
python $MYPATH/mmmult.py
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
#!/bin/bash
2-
#SBATCH -A hpc2nXXXX-YYY # Change to your own
2+
#SBATCH -A naiss2025-22-934 # Change to your own
33
#SBATCH --time=00:10:00 # Asking for 10 minutes
44
#SBATCH -n 1 # Asking for 1 core
55

66
# Set a path where the example programs are installed.
77
# Change the below to your own path to where you placed the example programs
8-
MYPATH=/proj/nobackup/<your-projecct-storage>/<mydir-name>/HPC-python/Exercises/examples/programs/
8+
MYPATH=/mimer/NOBACKUP/groups/courses-fall-2025/<mydir-name>/Exercises/day3/programs/
99

10-
# Load any modules you need, here for Python 3.9.5 and compatible SciPy-bundle
11-
module load GCC/10.3.0 OpenMPI/4.1.1 Python/3.9.5 SciPy-bundle/2021.05 matplotlib/3.4.2
10+
module load matplotlib/3.10.5-gfbf-2025b
1211

1312
# Activate your virtual environment.
1413
# CHANGE <path-to-virt-env> to the full path where you installed your
15-
# virtual environment. For instance, the vpyenv created in the course
16-
# would work with this example
17-
# Example: /proj/nobackup/hpc2nXXXX-YYY/<mydir-name>/pythonHPC2N
14+
# virtual environment.
1815
source <path-to-virt-env>/bin/activate
1916

2017
# Run your Python script - remember to add the name of your script
21-
python $MYPATH/seaborn-example.py
18+
python $MYPATH/virt-example.py
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/bin/bash
2-
#SBATCH -A hpc2n2025-151 # Change to your own
2+
#SBATCH -A naiss2025-22-934 # Change to your own
33
#SBATCH --time=00:05:00 # Asking for 5 minutes
44
#SBATCH -n 1 # Asking for 1 core
55

66
# Set a path where the example programs are installed.
77
# Change the below to your own path to where you placed the example programs
8-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
8+
MYPATH=/mimer/NOBACKUP/groups/courses-fall-2025/<mydir-name>/Exercises/day3/programs/
99

1010
# Load any modules you need, here for Python 3.11.3
1111
module purge > /dev/null 2>&1
12-
module load GCC/12.3.0 OpenMPI/4.1.5 Python/3.11.3 SciPy-bundle/2023.07
12+
module load Python/3.11.5-GCCcore-13.2.0
13+
module load SciPy-bundle/2025.07-gfbf-2025b
14+
module load Python-bundle-PyPI/2025.07-GCCcore-14.3.0
1315

1416
# Run your Python script
1517
python $MYPATH/sum-2args.py 2 3
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88

99
# Set a path where the example programs are installed.
1010
# Change the below to your own path to where you placed the example programs
11-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
11+
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/Exercises/day3/programs/
1212

1313
ml purge > /dev/null 2>&1
1414
ml GCC/12.3.0 Python/3.11.3
1515
ml OpenMPI/4.1.5
1616
ml SciPy-bundle/2023.07 mpi4py/3.1.4
17-
#ml Julia/1.7.1-linux-x86_64 # if Julia is needed
18-
19-
# CHANGE THE PATH BELOW TO YOUR OWN PATH if you need a virtual environment
20-
#source /proj/nobackup/<your-proj-id>/<mydir-name>/<path-to-vpyenv-python-course>/bin/activate
2117

2218
mpirun -np 4 python $MYPATH/integration2d_mpi.py

Exercises/day3/hpc2n/pandas_matplotlib-batch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Change to the directory where the data files and program are located
1010
# Change the below to your own path to where you placed the example programs
11-
cd /proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
11+
cd /proj/nobackup/fall-courses/<mydir-name>/Exercises/day3/programs/
1212

1313
# Remove any loaded modules and load the ones we need
1414
module purge > /dev/null 2>&1

Exercises/day3/hpc2n/run_mmmult.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Set a path where the example programs are installed.
88
# Change the below to your own path to where you placed the example programs
9-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
9+
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/Exercises/day3/programs/
1010

1111
# Load any modules you need, here for Python 3.11.3 and compatible SciPy-bundle
1212
module purge > /dev/null 2>&1
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#!/bin/bash
2-
#SBATCH -A hpc2nXXXX-YYY # Change to your own
2+
#SBATCH -A hpc2n2025-151 # Change to your own
33
#SBATCH --time=00:10:00 # Asking for 10 minutes
44
#SBATCH -n 1 # Asking for 1 core
55

66
# Set a path where the example programs are installed.
77
# Change the below to your own path to where you placed the example programs
8-
MYPATH=/proj/nobackup/<your-projecct-storage>/<mydir-name>/HPC-python/Exercises/examples/programs/
8+
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/Exercises/day3/programs/
99

10-
# Load any modules you need, here for Python 3.9.5 and compatible SciPy-bundle
11-
module load GCC/10.3.0 OpenMPI/4.1.1 Python/3.9.5 SciPy-bundle/2021.05 matplotlib/3.4.2
10+
# Load any modules you need
11+
module load GCC/13.2.0 Python/3.11.5
12+
module load SciPy-bundle/2023.11
13+
module load Python-bundle-PyPI/2023.10
1214

13-
# Activate your virtual environment.
15+
# Activate your virtual environment, which was created with the same modules loaded as bove.
1416
# CHANGE <path-to-virt-env> to the full path where you installed your
15-
# virtual environment. For instance, the vpyenv created in the course
16-
# would work with this example
17+
# virtual environment.
1718
# Example: /proj/nobackup/hpc2nXXXX-YYY/<mydir-name>/pythonHPC2N
1819
source <path-to-virt-env>/bin/activate
1920

2021
# Run your Python script - remember to add the name of your script
21-
python $MYPATH/seaborn-example.py
22+
python $MYPATH/virt-example.py

Exercises/day3/hpc2n/run_sum-2args.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Set a path where the example programs are installed.
77
# Change the below to your own path to where you placed the example programs
8-
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/HPC-python/Exercises/examples/programs/
8+
MYPATH=/proj/nobackup/fall-courses/<mydir-name>/Exercises/day3/programs/
99

1010
# Load any modules you need, here for Python 3.11.3
1111
module purge > /dev/null 2>&1

0 commit comments

Comments
 (0)