Example python job
Example 1: Hello world¶
Prepare a Python input file with an appropriate filename, here named hello.py:
Prepare a job submission file with an appropriate filename, here named myjob.sub:
Then, submit your job via SLURM and view the output file, which should simply output:
Example 2: Matrix multiply¶
Save the following script as matrix.py:
Change the last line in the job submission file above to read:
The standard output file from this job will result in the following matrix:
Example 3: Sine wave plot using numpy and matplotlib packages¶
Save the following script as sine.py:
Change your job submission file to submit this script and the job will output a png file and blank standard output and error files.
For more information about Python: