<div dir="ltr">So there is a --chdir for sbatch too.  This implies that the same path has to exist on all nodes.  Something to keep in mind when creating a slurm cluster.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 21, 2020 at 12:58 PM William Brown <<a href="mailto:william@signalbox.org.uk">william@signalbox.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB"><div class="gmail-m_-5572296794312277742WordSection1"><p class="MsoNormal"><span>The srun man page says:<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal">When initiating remote processes <b>srun</b> will propagate the current working directory, unless <b>--chdir</b>=<<i>path</i>> is specified, in which case <i>path</i> will become the working directory for the remote processes.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">William<span><u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> slurm-users <<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a>> <b>On Behalf Of </b>Dean Schulze<br><b>Sent:</b> 21 January 2020 19:27<br><b>To:</b> Slurm User Community List <<a href="mailto:slurm-users@lists.schedmd.com" target="_blank">slurm-users@lists.schedmd.com</a>><br><b>Subject:</b> [slurm-users] sbatch sending the working directory from the controller to the node<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">I run this sbatch script from the controller:<br><br>=======================<br>#!/bin/bash<br>#SBATCH --job-name=test_job<br>#SBATCH --mail-type=NONE    # Mail events (NONE, BEGIN, END, FAIL, ALL)<br>#SBATCH --ntasks=1<br>#SBATCH --mem=1gb<br>#SBATCH --time=00:05:00     # Time limit hrs:min:sec<br>#SBATCH --output=test_job_%j.log   # Standard output and error log<br><br>pwd; hostname; date<br>=======================<br><br><br>The node gets the directory that sbatch was executed from on the controller and tries to write the output file to that directory, which doesn't exist on the node.  The node slurmd.log shows this error:<br><br>2020-01-21T11:25:36.389] [7.batch] error: Could not open stdout file /home/dean/src/slurm.example.scripts/serial_test_7.log: No such file or directory<br><br><br>If I change the sbatch script --output to a fully qualified directory that exists on the node<br><br>    --output=/home/nodeuser/serial_test_%j.log<br><br>the output file is written to that directory, but it includes this error showing that the slurm node is trying to execute the job in the directory that sbatch was run from on the controller:<br><br>slurmstepd: error: couldn't chdir to `/home/dean/src/slurm.example.scripts': No such file or directory: going to /tmp instead<br><br><br>The sbatch docs say nothing about why the node gets the pwd from the controller.  Why would slurm send a directory to a node that may not exist on the node and expect it to use it?<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">What's the right way to specify the --output directory in an sbatch script?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12pt">Thanks.<br><br><br><u></u><u></u></p></div></div></div></div></blockquote></div>