pythonpbsqsub

Python: PBS submission, what happens if I change script?


I have a script job.bin for executing a code in python (pythoncode.py) on a cluster, submitting jobs via qsub. In job.bin:

cd /path/to/my/python/code
python pythoncode.py

What happens if:

a) while pythoncode.py is running, I change its content

b) while pythoncode.py is held on queue, I change its content

pythoncode.py contains some parameters that I can vary. In situations a) and b), will a change of any of these parameters affect the already begun or queuing run?


Solution

    1. When you change job.bin after you submitted your job nothing happens because the submission file is copied to a temporary storage by qsub.
    2. When you change pythoncode.py while job is held in the queue the new version of the file will be run as the job script is read after the job state is changed to running by the scheduler.
    3. When you change pythoncode.py while the job is running nothing happens as the python interpreter has already started and read the script into its own memory.

    Pro tip. Admin can change the job.bin file held in the temporary storage while the job is held in the queue so that the new version of job.bin will run.