gangaextension

Final Report | Installation | How it Works | How to use | Code

Gangaextension - How to use ?

Using GangaExtension you can directly submit and monitor Ganga Jobs from Jupyter Notebook/SWAN.

The notebook and Job Script used for this tutorial can be found here.

How to create a Job ?

To submit a Job open/create a Python2 Notebook. In this notebook, create a new cell and in the first line of this cell write %%ganga to indicate this cell is an IPython Ganga Magic. From the next line simply define the Job in the same way it is defined in Ganga shell.

Note: Only a single Job can be defined per cell magic. If none or more than one Job is defined in single magic cell, an exception will be raised.

For Example: A Job definition with multiple subjobs can look like screenshot_2018-07-29 help_robinson

How to track the Job ?

After execution of this cell magic a new Job will be created.

Note: This Job is not being monitored in Notebook’s kernel, it is being monitored in a seperate Ganga session attached to Jupyter Session, so killing this notebook will not affect monitoring of submitted Ganga Job.

A widget will appear below the cell showing Job information and it will periodically update the status of Job.

Note: Since Job is being monitored in seperate session, there may be some lag between the actual status of Job and the status visible in following widget.

screenshot_2018-07-29 help_robinson 2

Also, a new entry corresponding to submitted Job will appear in Ganga Jobs tab. Since the Job is being monitored in Jupyter’s server session, this entry will display live status of submitted Job. screenshot_2018-07-29 ganga jobs

Note: The submitted Job can be killed and removed from this Ganga Jobs Tab.

How to find Job output ?

The Job directory location can be identified by outputdir property of job object: screenshot_2018-07-29 help_robinson 3 The output files of Job can be identified by outputfiles property of job object: screenshot_2018-07-29 help_robinson 4

In this example, the content of outputfile islands.txt of Job is: screenshot_2018-07-29 help_robinson 5

How to access Job defined in different session ?

On restarting Notebook or in another notebook, The Job object can be obtained by Ganga Repository object jobs. screenshot_2018-07-29 help_robinson 6

Precaution

Since, the Ganga Namespace is directly imported in Notebook’s Python namespace, user is advised to not define variables/methods with following names to prevent overwriting of Ganga Namespace variables/methods.