MoseleyBioinformaticsLab / gpu_tracker

Context manager and CLI that tracks the computational-resource-usage of a code block or shell command, particularly the GPU usage.
Other
4 stars 1 forks source link

Handle crashes #2

Closed erikhuck closed 5 months ago

erikhuck commented 7 months ago

The tracker should be able to crash gracefully, meaning it should be able to catch uncaught exceptions thrown within the context and report the usage results collected prior to the crash. Meaning the context should not have to complete entirely for the results to be available and reported.

erikhuck commented 5 months ago

I realize this is not actually possible because a thread cannot catch an exception in a different thread because the two threads are running different code. It'll be up to the user to error handle and report resource usage, if they please, in an except or finally block.

hunter-moseley commented 5 months ago

Maybe give an example in the end-user documentation then.

On Mon, Apr 15, 2024 at 10:57 AM Erik Huckvale @.***> wrote:

I realize this is not actually possible because a thread cannot catch an exception in a different thread because the two threads are running different code. It'll be up to the user to error handle and report resource usage, if they please, in an except or finally block.

— Reply to this email directly, view it on GitHub https://github.com/MoseleyBioinformaticsLab/gpu_tracker/issues/2#issuecomment-2057065099, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEP7B5ONDHZQMHVMJRRFYLY5PTGHAVCNFSM6AAAAABDP2IYWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJXGA3DKMBZHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Hunter Moseley, Ph.D. -- Univ. of Kentucky Professor, Dept. of Molec. & Cell. Biochemistry / Markey Cancer Center / Institute for Biomedical Informatics / UK Superfund Research Center Not just a scientist, but a fencer as well. My foil is sharp, but my mind sharper still.

Email: @. (work) @. (personal) Phone: 859-218-2964 (office) 859-218-2965 (lab) 859-257-7715 (fax) Web: http://bioinformatics.cesb.uky.edu/ Address: CC434 Roach Building, 800 Rose Street, Lexington, KY 40536-0093

erikhuck commented 5 months ago

@hunter-moseley got it covered! Just opened #31