Final Report | Installation | How it Works | How to use | Code
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.
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
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.
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.
Note: The submitted Job can be killed and removed from this Ganga Jobs Tab.
The Job directory location can be identified by outputdir
property of job object:
The output files of Job can be identified by
outputfiles
property of job object:
In this example, the content of outputfile islands.txt
of Job is:
On restarting Notebook or in another notebook, The Job object can be obtained by Ganga Repository object jobs
.
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.
- ARC
- AfsToken
- ArgSplitter
- Batch
- CREAM
- Condor
- CondorRequirements
- ConfigError
- CoreTask
- CoreTransform
- CoreUnit
- CustomChecker
- CustomMerger
- Dataset
- EmptyDataset
- Executable
- File
- FileChecker
- GangaAttributeError
- GangaDataset
- GangaDatasetSplitter
- GangaList
- GenericSplitter
- GoogleFile
- GridFileIndex
- GridSandboxCache
- GridftpFileIndex
- GridftpSandboxCache
- ITask
- Interactive
- Job
- JobError
- JobInfo
- JobTime
- LCG
- LCGFileIndex
- LCGRequirements
- LCGSEFile
- LCGSandboxCache
- LSF
- Local
- LocalFile
- Localhost
- MassStorageFile
- MetadataDict
- MultiPostProcessor
- Notebook
- Notifier
- PBS
- ProtectedAttributeError
- ReadOnlyObjectError
- Remote
- Root
- RootFileChecker
- RootMerger
- SGE
- SandboxFile
- ShareDir
- ShareRef
- SharedFile
- Slurm
- SmartMerger
- TaskChainInput
- TaskLocalCopy
- TextMerger
- TreeError
- VomsProxy
- box
- categoryname
- config
- convert_merger_to_postprocessor
- credential_store
- disableMonitoring
- disableServices
- enableMonitoring
- export
- full_print
- ganga
- jobSlice
- jobs
- jobtree
- license
- load
- os
- plugins
- prep
- pth
- queues
- reactivate
- report
- reloadJob
- runMonitoring
- shareref
- sys
- tasks
- templates
- typename
- Ganga Docs - Official Ganga Documentaion
- Ganga Tutorial - Ganga Tutorial on twiki.
- Ganga FAQ - Frequently asked questions related to Ganga.