Repository navigation
Introduce logger on dask workers - #170
bennoschoenstein merged 7 commits into
Conversation
143eff2 to
01c9f02
Compare
gilrrei
left a comment
There was a problem hiding this comment.
@sbrandstaeter I like this feature and I think we should merge this :)
01c9f02 to
de5bd40
Compare
e687545 to
6cf1c78
Compare
leahaeusel
left a comment
There was a problem hiding this comment.
Since Sebastian asked us to have a look at this PR in a past developer meeting, I have added my point of view on the open conversations. Hopefully, this will help to get this merged soon 🤞
6cf1c78 to
86ac5d0
Compare
acc4d16 to
f16f8ec
Compare
|
I rebased this PR onto the current What you getEvery job writes its own log file: How it works
Options (all drivers)
What changes for users
|
leahaeusel
left a comment
There was a problem hiding this comment.
Thank you very much @bennoschoenstein for taking care of getting this important feature ready to merge! I really like the new job-specific log files and think they will be very helpful for users in the future.
Co-authored-by: Sebastian Brandstaeter <sebastian.brandstaeter@unibw.de>
Replace worker_log_level and write_worker_log_files by one argument: worker_log_level=None switches the job log files off, any level switches them on. The Function driver writes no log files by default. Remove the stream handler on dask workers, so that the SLURM output is not touched by QUEENS anymore. Define the format of log files once.
Run 8 jobs on 4 workers with the Pool and Local schedulers and check that the messages of the driver and the data processor of a job end up in the log file of that job. The assumption of one job per process at a time is stated in the docstring of setup_logger_on_worker.
Keep run as the method that custom drivers implement, as before. The log file of a job is set up in __call__, which the schedulers call. A direct call of run behaves as on main. This avoids the breaking change of the abstract _run method.
f16f8ec to
40388e8
Compare
|
Update after the review (replaces my comment from Oct 6 where it differs): What you getEvery job writes its own log file How it works
Option (all drivers)
Rebased onto the current |
Reset the level of the worker logger after a job, so that it does not leak into logging outside of jobs. Open the log file in write mode, so that a rerun of a job starts a new file. Keep the level of the log file if the process logs on a lower level, e.g., in debug mode.
leahaeusel
left a comment
There was a problem hiding this comment.
The changes look good to me 🚀 Nice catch with the write mode to overwrite old log files on reruns!
sbrandstaeter
left a comment
There was a problem hiding this comment.
@bennoschoenstein Many thanks for taking over and pushing this over the finish line. Looks good to me but of course can't approve.
|
@rjoussen could you please take a final look at this PR? 👯 |
|
My approve is just to test, if recent pushers can approve or not |
|
@bennoschoenstein I will look into it today or tomorrow. |
rjoussen
left a comment
There was a problem hiding this comment.
I just have one last note.
5a2ea25
rjoussen
left a comment
There was a problem hiding this comment.
thanks for your efforts!





Description and Context:
What and Why?
Summary
This PR introduces logging support for code running inside Dask workers, specifically within the
driver.runanddataprocessor.get_data_from_filemethods, as discussed in issue #165. This should enable debugging these methods even on an HPC cluster.Motivation
Currently, there's no logging when these methods are executed on a Dask worker, making it difficult to debug or monitor behavior during distributed execution.
What's Proposed
self.logger_on_dask_worker) is initialized inside the above methods if it doesn't already exist.Logging Setup
restart_worker=True), it reuses the same log file.<experiment_dir>/dask_workers_logs.Notes
This PR is meant to establish a solid initial foundation for Dask-side logging. While the current solution may not cover all edge cases or logging best practices, it's a step in the right direction and open for future improvements. Feedback on design and setup is welcome.
Related Issues and Pull Requests
Interested Parties