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

API feedback #25

Open erikhuck opened 6 months ago

erikhuck commented 6 months ago

Suggested changes from Dr. Moseley:

erikhuck commented 6 months ago

@hunter-moseley Question about the first bullet point. Basing the text output on the JSON enforces consistency. I understand the implementation is a bit messy, but wouldn't manually constructing the string possibly be more error-prone?

hunter-moseley commented 6 months ago

Do something like the following:

template = """ Max RAM: Unit: gigabytes System capacity: {max_ram["system_capacity"]} System: {max_ram["system"]} Main: Total RSS: main["total_rss"]} Private RSS: main["private_rss"]} Shared RSS: main["shared_rss"]} Descendents: ... """ return template.format(**json_dict)

On Thu, Apr 4, 2024 at 3:58 PM Erik Huckvale @.***> wrote:

@hunter-moseley https://github.com/hunter-moseley Question about the first bullet point. Basing the text output on the JSON enforces consistency. I understand the implementation is a bit messy, but wouldn't manually constructing the string possibly be more error-prone?

— Reply to this email directly, view it on GitHub https://github.com/MoseleyBioinformaticsLab/gpu_tracker/issues/25#issuecomment-2038100490, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEP7B2L3OI4GMQLB4IP7V3Y3WWE5AVCNFSM6AAAAABFT7Y4P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZYGEYDANBZGA . You are receiving this because you were mentioned.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 great idea! Then we get the best of both.