# Error Creating Slurm Batch Job from Within an Interactive Desktop

**URL:** <https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787>\
**Category:** Get Help\
**Created:** [June 30, 2023, 6:38pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787 "2023-06-30T18:38:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsimms1](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jsimms1/32/3452_2.png) [@jsimms1](https://discourse.openondemand.org/u/jsimms1)\
**Post date:** [June 30, 2023, 6:38pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787/1 "2023-06-30T18:38:24Z")

</div>

Hello all,

I’m working with a researcher who is trying to submit a Slurm batch job from within the terminal of an interactive desktop. This is essentially a job submitted from within a running job (the interactive desktop itself). The job works when submitted from the command line on the login node, and it also works when submitted from within an interactive bash session created with `salloc`. When submitted from an interactive desktop, however, the job as well as the interactive desktop session both crash. The only error output from Slurm is:

`srun: fatal: SLURM_MEM_PER_CPU, SLURM_MEM_PER_GPU, and SLURM_MEM_PER_NODE are mutually exclusive.`

I can’t find much about this online that seems relevant, especially since the only time it fails is from within the OOD interactive desktop. Any guidance would be welcome.

Warmest regards,  
Jason

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [July 3, 2023, 2:41pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787/2 "2023-07-03T14:41:00Z")

</div>

Hello and welcome!

My guess is that because the interactive desktop is also a scheduled job that some environment variables set for it are conflicting with what is set for the submitted job.

What are those values set to in the interactive desktop?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [July 5, 2023, 4:05pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787/3 "2023-07-05T16:05:58Z")

</div>

OOD defaults to using `SLURM_EXPORT_ENV=NONE`.

We had to set this environment variable in our desktops so that things like `srun` or `salloc` can work successfully. Seems like you may need to do the same.

> <https://github.com/OSC/osc-ood-config/blob/bf263e61542a6b329bad13abdda87e83c54e3854/apps.awesim.org/apps/bc_desktop/submit/slurm.yml.erb#L78-L79>

---

<div class="post-metadata">

**Author:** ![jsimms1](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jsimms1/32/3452_2.png) [@jsimms1](https://discourse.openondemand.org/u/jsimms1)\
**Post date:** [July 5, 2023, 4:38pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787/4 "2023-07-05T16:38:12Z")

</div>

Thanks, Jeff. That didn’t seem to change any behavior for me; it still crashes.

Following up on the post from @travert, the only one of those variables with a value within the interactive session is SLURM\_MEM\_PER\_NODE, which is set to the amount specified on the form requesting an interactive desktop. (We allow users to specify between 2 and 128 GB of memory for their desktop session.) I imagine that the job script also attempts to set this variable, which is probably the cause of the issue, somehow. If this is the case, however, I don’t understand why it would work from within an salloc session.

Thanks,  
Jason

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [January 1, 2024, 4:38pm UTC](https://discourse.openondemand.org/t/error-creating-slurm-batch-job-from-within-an-interactive-desktop/2787/5 "2024-01-01T16:38:23Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
