# Running Julia in a SLURM Cluster

**URL:** <https://discourse.julialang.org/t/running-julia-in-a-slurm-cluster/67614>\
**Category:** Performance\
**Tags:** parallel, cluster, distributed\
**Created:** [September 3, 2021, 1:56am UTC](https://discourse.julialang.org/t/running-julia-in-a-slurm-cluster/67614 "2021-09-03T01:56:57Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![SpuriousEigenstate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spuriouseigenstate/32/208390_2.png) [@SpuriousEigenstate](https://discourse.julialang.org/u/SpuriousEigenstate)\
**Post date:** [April 10, 2024, 9:19am UTC](https://discourse.julialang.org/t/running-julia-in-a-slurm-cluster/67614/6 "2024-04-10T09:19:01Z")

</div>

I find that doing this is easiest, and seems to work well for me:  
Putting this at the top of my `script.jl`,

```julia
#!/usr/bin/env julia

#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=2G
#SBATCH --time=00:30:00

using Distributed
...

```

and then just running `sbatch script.jl` does the job

---

_[View the full topic](https://discourse.julialang.org/t/running-julia-in-a-slurm-cluster/67614)._
