Skip to content

Exercise 2: Create and submit a batch script

Practice creating and submitting batch scripts.


  1. Use nano text editor (or any other if you're an experienced Linux user) to open the script run.sh that already exist in the workshop directory.

    Hint
    nano run.sh
    
  2. In the bottom of the script, add:

    python3 simple_script.py
    
  3. Save it by hitting CTRL + O, then hit Enter to confirm the name and changes, and then CTRL + X to exit nano.

  4. Submit the job using sbatch

    Hint
    sbatch run.sh
    
  5. Check the job status using squeue --me

    Hint: Make it update every second
    watch -n1 squeue --me
    
  6. Once completed, check the results by printing out the output file using cat command

    Hint
    cat myjob.log
    

Next: Allocating Resources →