You are viewing an old version of this page. View the current version.

    Compare with Current View Page History

    Version 1 Next »

    Here, we demonstrate how to submit a job through the Python API that runs a python script as a callback.  This example shows a very simple callback that writes the job id and python information to a file.

    Python callback
    Icon
    • Supervisor_language_flags must contain "python" or this callback will silently fail.
    • The qb module available inside the callback is a stripped down version of what a typical python script will consume. If you need the full python module, spawn a second script from the callback with subprocess.Popen or the like. See this example for reference.
    Icon
    • All callbacks are executed by the supervisor and only by the supervisor. If your callback needs to access the job's output directory, be sure the supervisor can see the output dir as it is stored in the job.
    • Any print statements will go to the .cb file in the job log. If you would like to see debug output, you'll need to write to a file.
    • No labels