# Depletion acceleration and run depletion with slurm

**URL:** <https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365>\
**Category:** User Support\
**Created:** [October 17, 2022, 4:11am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365 "2022-10-17T04:11:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tzhang](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tzhang](https://openmc.discourse.group/u/tzhang)\
**Post date:** [October 17, 2022, 4:11am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/1 "2022-10-17T04:11:21Z")

</div>

Hi all,

I am running a pincell calculation to understand radial flux variation along with depletion. Thus, I prepared a case dividing a 2D PWR pincell into 10 depletion zone. To obtain more accurate results, I use the whole endf71 decay and fission yield library to generate the chain.xml file. However, although with 10,000 particles per batch, the simulation is pretty slow on a small cluster with 56 omps (I haven’t test if it could be faster if I ruduces the omp nums). I would like to know is there a way to accelerate the simulation?

One more thing, I plan to run the silulation on a better cluster using slurm, I am confusing when run a depletion calculation with slurm, how could I specific the .sh file so that number of omps is controlled? Is there any example bash file that I can refer to?

Thank you very much for your help!

Regards,  
Tian

---

<div class="post-metadata">

**Author:** ![pdeng](https://avatars.discourse-cdn.com/v4/letter/p/4da419/32.png) [@pdeng](https://openmc.discourse.group/u/pdeng)\
**Post date:** [March 15, 2023, 7:43pm UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/2 "2023-03-15T19:43:08Z")

</div>

Below is an example of slurm script I used on our computer cluster. The “dep.py” python script specified below can be the sample pin cell depletion input. Just note that mpi4py is required in this case.

* * *

#!/bin/sh -l

#SBATCH --job-name=openmc\_dep  
#SBATCH --export=ALL  
#SBATCH --account=xxx  
#SBATCH --partition=standard  
#SBATCH --mail-user=xxx@xxx  
#SBATCH --mail-type=BEGIN,END,FAIL

#SBATCH --nodes=5  
#SBATCH --ntasks-per-node=1  
#SBATCH --cpus-per-task=36

#SBATCH --mem=30000m  
#SBATCH --time=10:00:00  
#SBATCH --output=%x-%j.out  
#SBATCH --error=%x-%j.err

export OMP\_NUM\_THREADS=36

mpirun -n 5 python -m mpi4py dep.py

---

<div class="post-metadata">

**Author:** ![liangliang](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@liangliang](https://openmc.discourse.group/u/liangliang)\
**Post date:** [November 3, 2023, 2:16am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/3 "2023-11-03T02:16:34Z")

</div>

This is my script，

> #!/bin/bash  
> #SBATCH --job-name=PythonTest  
> #SBATCH --ntasks=2  
> #SBATCH --nodes=2  
> #SBATCH --ntasks-per-node=1  
> #SBATCH --cpus-per-task=64  
> #SBATCH --output=%j.log  
> #SBATCH --partition=xxx  
> export OMP\_NUM\_THREADS=64  
> srun --mpi=pmix\_v3 -n 2 python -m mpi4py run\_depletion.py

then I got the errors

> Writing summary.h5 file…  
> Reading plot XML file…  
> Writing summary.h5 file…  
> ERROR: Failed to open HDF5 file with mode ‘w’: summary.h5

how to solve this problem

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 4, 2023, 2:30pm UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/4 "2023-11-04T14:30:06Z")

</div>

You may need to build HDF5 with support for parallel I/O in order to get it working properly for depletion simulations run in parallel. See [details here](https://support.hdfgroup.org/HDF5/PHDF5/).

---

<div class="post-metadata">

**Author:** ![Lucky\_Kevin](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@Lucky\_Kevin](https://openmc.discourse.group/u/Lucky_Kevin)\
**Post date:** [November 9, 2023, 2:43am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/5 "2023-11-09T02:43:25Z")

</div>

Excuse me , can I ask you how to distinguish depletion zone ,I didn’t find tutorial in the documents.  
Thanks  
xmTang

---

<div class="post-metadata">

**Author:** ![tzhang](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tzhang](https://openmc.discourse.group/u/tzhang)\
**Post date:** [November 9, 2023, 5:58am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/6 "2023-11-09T05:58:43Z")

</div>

Briefly, each depletion zone has a assigned material, you can identify the zone according to the material name

---

<div class="post-metadata">

**Author:** ![Lucky\_Kevin](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@Lucky\_Kevin](https://openmc.discourse.group/u/Lucky_Kevin)\
**Post date:** [November 9, 2023, 7:12am UTC](https://openmc.discourse.group/t/depletion-acceleration-and-run-depletion-with-slurm/2365/7 "2023-11-09T07:12:11Z")

</div>

I get it ! Thank you so much, Zhang !
