Redundant logging of GPU ID in data transfer method

Open
#658 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Read httomo/method_wrappers/generic.py around lines 366-370 and inspect how log_rank() formats the transfer message. Remove the duplicated GPU ID from this log while retaining the rank, data shape, and method information; done means the debug output matches the proposed wording.

Written by the indexing model from the issue text.

Description

logging minor

The log_rank() function is used to log the data being transferred from CPU to GPU memory: https://github.com/DiamondLightSource/httomo/blob/8b3a2a06c596add2ae14e5da3377457acece6e1b/httomo/method_wrappers/generic.py#L366-L370

in which the GPU ID is included.

However, the log_rank() function is already designed to include the process rank (which is the same as the GPU ID), which leads to duplicated information in the debug logs:

2025-12-04 22:41:14.491 | DEBUG    | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)
2025-12-04 22:41:16.023 | DEBUG    | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.051 | DEBUG    | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.125 | DEBUG    | httomo.utils:log_rank:75 - RANK: [2], Using GPU 2 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.126 | DEBUG    | httomo.utils:log_rank:75 - RANK: [3], Using GPU 3 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.129 | DEBUG    | httomo.utils:log_rank:75 - RANK: [1], Using GPU 1 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.155 | DEBUG    | httomo.utils:log_rank:75 - RANK: [3], Using GPU 3 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.155 | DEBUG    | httomo.utils:log_rank:75 - RANK: [2], Using GPU 2 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.159 | DEBUG    | httomo.utils:log_rank:75 - RANK: [1], Using GPU 1 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)

where there's duplication between the rank and GPU ID:

RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)

It's not a big deal, but makes the logs noisier than they need to be.

One suggestion would be to remove the GPU ID and have the format be something like the following:

RANK: [0], Transferring data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)
Dominant language
Python
Stars
10
Forks
5
Avg merge
5d 17h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/httomo

All issues in DiamondLightSource/httomo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.