Skip to content

Debugging and Profiling Cylc 8

Bruno P. Kinoshita edited this page May 10, 2020 · 5 revisions

Info by and for developers

The following assumes standard relative location of Cylc component repositories:

~/cylc/
~/cylc/cylc-flow
~/cylc/cylc-uiserver
~/cylc/cylc-ui

cylc-flow

...

cylc-uiserver

It may be helpful to start the UIS without JupyterHub:

cylc-uiserver --port=50625 -s $HOME/cylc/cylc-ui/dist

bulk memory profiling with memory_profiler

pip install memory_profiler
pip install matplotlib
# run the process to be profiled:
mprof run cylc-uiserver --port=50625 -s $HOME/cylc/cylc-ui/dist
# after the process is stopped or killed, generate the profile plot:
mprof plot --output memory-profile.png
# and view it:
eog memory-profile.png

For every time you run the process with the profiler, it will create a file with a name similar to mprofile_20200511072829.dat in the working directory of the process.

If you it as above from ~/cylc-uiserver, then your profile data file should be in ~/cylc-uiserver. But if you modify your jupyterhub_config.py to launch the UI Server pre-pending ['mprof', 'run] to your launch settings, the profiler data file may be generated elsewhere, like ~/ for instance.

You need to execute the plot command from the same directory you have your data file. If you have multiple data files, then the newest one will be used.