Am Tue, 28 Jul 2015 23:03:54 -0700
schrieb Christopher Samuel <
sam...@unimelb.edu.au>:
> 1) To stop environment variable being exported we have this in our
> slurm.conf file:
>
> PropagateResourceLimits=NONE
Does that influence environment variables, too? I read that it is for
propagating resource limits from the submit host. But still, thanks for
pointing that out, as we intended to limit resources on the submit
machines where multiple users work, without limiting the jobs, where I
already had to raise limits in the slurmd systemd service file. Seems
like we need
PropagateResourceLimits=NONE
for separating those setups.
> 2) To make sure that bash sources a profile script we have this in
> taskprolog.sh:
>
> echo export BASH_ENV=/etc/profile.d/module.sh
> has the following in the taskprolog.sh:
>
> # Add a banner to the job standard output
> echo "print Job $SLURM_JOB_ID started at" `date`
Aha:
TaskProlog
TaskEpilog
So there is a chance to print something the user can see. But: All
prints from multiple tasks in a job get intermixed in one log file,
right? Well, just like the outputs from multiple nodes.
The thing about BASH_ENV is that we do not intend to enforce usage of a
certain shell. We support "some bourne shell" and "some C-ish shell",
notably ksh. Perhaps there are similar ways with other shells but not I
guess not all.
Nevertheless, interesting suggestion for systems that indeed just use
bash.
> 3) If you wish to set TMPDIR you can use the same trick in taskprolog.sh:
>
> # Set environment variable with location of scratch storage for the job
> #echo export TMPDIR=/scratch/merri/jobs/$SLURM_JOB_ID
I even see now that there is TmpFS for slurm.conf, too, but as there is
some complexity involved (user being able to decide if to use local
and/or global TMPDIRs prepared for her), we still roll our own.
> Note that is commented out as we now use a spank plugin to use kernel
> namespaces to map a job specific scratch directory over /tmp.
Now that's somewhat nifty and somewhat scary;-)
> > Slurm adds to the confusion with its version of interactive jobs.
>
> We use this tiny script for interactive jobs (called sinteractive):
>
> #!/bin/bash
> exec srun $* --pty -u ${SHELL} -i -l
Another fine idea … just start a login shell. We might offer such a
thing, too. But I have a suggestion: Rather use
#!/bin/bash
exec srun "$@" --pty -u ${SHELL} -i -l
, or do you intend to have quoted arguments being mangled? It might not
matter in practice for srun, as you rarely need quote something in its
arguments, but have it deeply ingrained to always use "$@" for the
argument list.
Alrighty then,
Thomas