Exercise 2: Create and submit a batch script
Practice creating and submitting batch scripts.
-
Use
nanotext editor (or any other if you're an experienced Linux user) to open the scriptrun.shthat already exist in the workshop directory.Hint
nano run.sh -
In the bottom of the script, add:
python3 simple_script.py -
Save it by hitting
CTRL + O, then hit Enter to confirm the name and changes, and thenCTRL + Xto exit nano. -
Submit the job using
sbatchHint
sbatch run.sh -
Check the job status using
squeue --meHint: Make it update every second
watch -n1 squeue --me -
Once completed, check the results by printing out the output file using
catcommandHint
cat myjob.log
Next: Allocating Resources →