deepmodeling / deepmodeling/tbplas
[Code scan] Handle small workloads in MPI range splitting
- Dominant language
- No language data
- Stars
- 19
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b3dba8eb930e4869a6d41074f62d703692.
Severity: Medium
`dist_range()` delegates to `split_range(n_max, num_group=self.__size)`. The split helper asserts that `num_group` is no larger than the number of elements. As a result, MPI runs with more ranks than work items can fail before callers have a chance to skip empty partitions. `dist_bound()` also assumes the assigned range is non-empty and calls `min()`/`max()` on it.
Code references:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/parallel.py#L107-L120
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/utils.py#L333-L340
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/utils.py#L313-L329
Suggested fix: allow empty ranges when `num_group > n_max`, and make `dist_bound()` return a documented empty sentinel or require callers to use `dist_range()` when empty partitions are possible.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with dist_range() in tbplas/parallel.py and trace its split_range() call in tbplas/utils.py. Inspect dist_bound() in the same file, then reproduce an MPI run where the number of ranks exceeds the work items. Done means empty partitions no longer fail, and dist_bound() has a documented behavior or callers use dist_range() when empties are possible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, hpc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100