# \#scripting

**URL:** https://ask.cyberinfrastructure.org/tag/scripting/92.md

[Latest](https://ask.cyberinfrastructure.org/latest.md) · [Categories](https://ask.cyberinfrastructure.org/categories.md) · [Tags](https://ask.cyberinfrastructure.org/tags.md)

---

## [Why does my script freeze and timeout when accessing a Singularity container?](https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528)

<div class="topic-metadata">

**Author:** [@wwarr](https://ask.cyberinfrastructure.org/u/wwarr)\
**Replies:** 1\
**Last updated:** [September 22, 2022, 4:40pm UTC](https://ask.cyberinfrastructure.org/t/why-does-my-script-freeze-and-timeout-when-accessing-a-singularity-container/2528 "2022-09-22T16:40:52Z")

</div>

I am using a script that calls a Singularity container. When it does, the script appears to freeze and eventually times out. Why is this happening and what can be done about it?

---

## [Is there a way to do startup and cleanup tasks with an SGE task array?](https://ask.cyberinfrastructure.org/t/is-there-a-way-to-do-startup-and-cleanup-tasks-with-an-sge-task-array/271)

<div class="topic-metadata">

**Author:** [@jpessin1](https://ask.cyberinfrastructure.org/u/jpessin1)\
**Replies:** 2\
**Last updated:** [March 15, 2019, 3:23pm UTC](https://ask.cyberinfrastructure.org/t/is-there-a-way-to-do-startup-and-cleanup-tasks-with-an-sge-task-array/271 "2019-03-15T15:23:10Z")

</div>

Is there a way to run one time commands at the beginning before the first task in the array or after the last task? Doing things like creating a new directory before hand to put all the output files in, or being able to…

---

## [Tensorflow script to run on single core](https://ask.cyberinfrastructure.org/t/tensorflow-script-to-run-on-single-core/225)

<div class="topic-metadata">

**Author:** [@ktrn](https://ask.cyberinfrastructure.org/u/ktrn)\
**Replies:** 2\
**Last updated:** [June 22, 2018, 3:44pm UTC](https://ask.cyberinfrastructure.org/t/tensorflow-script-to-run-on-single-core/225 "2018-06-22T15:44:16Z")

</div>

I am running my tensorflow script on the cluster and it gets aborted with the message that I am using 6 cores when my job requested only 1. But I do not have any parallelization in my code. I use standard tensorflow func…

---

## [How to reduce memory footprint without restructuring mpi code](https://ask.cyberinfrastructure.org/t/how-to-reduce-memory-footprint-without-restructuring-mpi-code/238)

<div class="topic-metadata">

**Author:** [@toreliza](https://ask.cyberinfrastructure.org/u/toreliza)\
**Replies:** 2\
**Last updated:** [July 17, 2018, 10:19am UTC](https://ask.cyberinfrastructure.org/t/how-to-reduce-memory-footprint-without-restructuring-mpi-code/238 "2018-07-17T10:19:18Z")

</div>

My mpi job requires more memory than is allocated in my current node configuration. What tricks can I use to reduce memory footprint without restructuring the code? CURATOR: toreliza

---

## [I am a Sun Grid Engine user moving to SLURM. What are a few of the basic commands that I can use to get started?](https://ask.cyberinfrastructure.org/t/i-am-a-sun-grid-engine-user-moving-to-slurm-what-are-a-few-of-the-basic-commands-that-i-can-use-to-get-started/209)

<div class="topic-metadata">

**Author:** [@jtgoodhue](https://ask.cyberinfrastructure.org/u/jtgoodhue)\
**Replies:** 3\
**Last updated:** [May 31, 2018, 7:32pm UTC](https://ask.cyberinfrastructure.org/t/i-am-a-sun-grid-engine-user-moving-to-slurm-what-are-a-few-of-the-basic-commands-that-i-can-use-to-get-started/209 "2018-05-31T19:32:29Z")

</div>

I am an expert user of a cluster with a Sun Grid Engine Scheduler and need to use a cluster with a SLURM Scheduler. Can someone help me get started by translating the following simple examples from SGE to SLURM? What J…

---

## [How can I manage a large number of very small independent jobs of varying length with some order dependencies?](https://ask.cyberinfrastructure.org/t/how-can-i-manage-a-large-number-of-very-small-independent-jobs-of-varying-length-with-some-order-dependencies/33)

<div class="topic-metadata">

**Author:** [@jacks9](https://ask.cyberinfrastructure.org/u/jacks9)\
**Replies:** 2\
**Last updated:** [July 6, 2018, 12:26am UTC](https://ask.cyberinfrastructure.org/t/how-can-i-manage-a-large-number-of-very-small-independent-jobs-of-varying-length-with-some-order-dependencies/33 "2018-07-06T00:26:57Z")

</div>

What tools are available on HPC clusters to help manage a large number of very small independent jobs (a few seconds each) of varying length and with some order dependencies as a single workflow? CURATOR: Jack Smith

---

## [How do I write a SLURM batch script for jobs that use both MPI and OpenMP?](https://ask.cyberinfrastructure.org/t/how-do-i-write-a-slurm-batch-script-for-jobs-that-use-both-mpi-and-openmp/40)

<div class="topic-metadata">

**Author:** [@toreliza](https://ask.cyberinfrastructure.org/u/toreliza)\
**Replies:** 1\
**Last updated:** [March 30, 2018, 2:54pm UTC](https://ask.cyberinfrastructure.org/t/how-do-i-write-a-slurm-batch-script-for-jobs-that-use-both-mpi-and-openmp/40 "2018-03-30T14:54:20Z")

</div>

I have a job that has 6 MPI processes with 4 OpenMP threads per process. How do I write a SLURM script to submit this job? 18.04.19: Notes: Assumptions: processor == logical CPU node hierarchy: node/socket/core/th…

---

## [How do I know if my job is parallelizing when submitted as a batch script?](https://ask.cyberinfrastructure.org/t/how-do-i-know-if-my-job-is-parallelizing-when-submitted-as-a-batch-script/222)

<div class="topic-metadata">

**Author:** [@ktrn](https://ask.cyberinfrastructure.org/u/ktrn)\
**Replies:** 3\
**Last updated:** [June 8, 2018, 12:41pm UTC](https://ask.cyberinfrastructure.org/t/how-do-i-know-if-my-job-is-parallelizing-when-submitted-as-a-batch-script/222 "2018-06-08T12:41:48Z")

</div>

I am trying to parallelize my Python job, but I am not sure if it runs using many cores. I looked at the time of the execution and the time of the execution is a little shorter than when I submit the same job without pa…

---

## [How do I redirect stdout/stderr in my SLURM job scripts?](https://ask.cyberinfrastructure.org/t/how-do-i-redirect-stdout-stderr-in-my-slurm-job-scripts/92)

<div class="topic-metadata">

**Author:** [@toreliza](https://ask.cyberinfrastructure.org/u/toreliza)\
**Replies:** 1\
**Last updated:** [May 31, 2018, 7:49pm UTC](https://ask.cyberinfrastructure.org/t/how-do-i-redirect-stdout-stderr-in-my-slurm-job-scripts/92 "2018-05-31T19:49:15Z")

</div>

I submit a job in a slurm cluster and all output and error messages go into the same file. Is there a way I can separate the error messages from the output?

---

## [How do I submit an MPI/OpenMP job in a slurm cluster?](https://ask.cyberinfrastructure.org/t/how-do-i-submit-an-mpi-openmp-job-in-a-slurm-cluster/78)

<div class="topic-metadata">

**Author:** [@toreliza](https://ask.cyberinfrastructure.org/u/toreliza)\
**Replies:** 1\
**Last updated:** [April 18, 2018, 1:18pm UTC](https://ask.cyberinfrastructure.org/t/how-do-i-submit-an-mpi-openmp-job-in-a-slurm-cluster/78 "2018-04-18T13:18:40Z")

</div>

How do I submit an MPI/OpenMP job in a slurm cluster? Are there any tricks to ensure that processors and memory get assigned the way that I am intending?

---

## [How do I convert my openmpi PBS job script to a SLURM script?](https://ask.cyberinfrastructure.org/t/how-do-i-convert-my-openmpi-pbs-job-script-to-a-slurm-script/32)

<div class="topic-metadata">

**Author:** [@toreliza](https://ask.cyberinfrastructure.org/u/toreliza)\
**Replies:** 1\
**Last updated:** [April 10, 2018, 3:52pm UTC](https://ask.cyberinfrastructure.org/t/how-do-i-convert-my-openmpi-pbs-job-script-to-a-slurm-script/32 "2018-04-10T15:52:57Z")

</div>

How can I convert this PBS script to SLURM? In particular, I’m not quite sure which parameters to use with SLURM that will provide the same behavior as this parameter in the PBS script: -l nodes=2:ppn=16 #!/bin/bash …
