Closed erikhuck closed 1 month ago
Yes, add this as an example.
On Mon, Apr 15, 2024 at 11:05 AM Erik Huckvale @.***> wrote:
We can add this as a recommended pattern if the user wishes to report resource usage results even if their script crashes. If we are not already doing so, we'll want to make sure the same is happening with the CLI i.e. make sure resource usage is still reported even if the subprocess ends with a non-zero exit code or if some exception is raised.
try: with Tracker() as tracker: example_function() except Exception as error: print(error) finally: print(tracker)
— Reply to this email directly, view it on GitHub https://github.com/MoseleyBioinformaticsLab/gpu_tracker/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEP7B7E7U4TANKTIRGCDO3Y5PUB3AVCNFSM6AAAAABGHRQQ7GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2DGOJRHAYTONQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
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
Additionally we should add an example of child process utilization in the tutorial using a couple of multiprocessing.Process
objects.
Completed as part of #41
We can add this as a recommended pattern if the user wishes to report resource usage results even if their script crashes.