the TaskListPtr in UnifiedMemoryStreams cannot correctly get the value when USE_PTHREAD
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9.6k
- Forks
- 2.4k
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
if ((TaskList.size() / nthreads) == 0) {
InputToThreads[i].taskSize = (TaskList.size() / nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads)];
} else {
if (i == nthreads - 1) {
InputToThreads[i].taskSize =
(TaskList.size() / nthreads) + (TaskList.size() % nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads) +
(TaskList.size() % nthreads)];
} else {
InputToThreads[i].taskSize = (TaskList.size() / nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads)];
}
should be
if ((TaskList.size() / nthreads) == 0) {
InputToThreads[i].taskSize = (TaskList.size() / nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads)];
} else {
if (i == nthreads - 1) {
InputToThreads[i].taskSize =
(TaskList.size() / nthreads) + (TaskList.size() % nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads)];
} else {
InputToThreads[i].taskSize = (TaskList.size() / nthreads);
InputToThreads[i].TaskListPtr =
&TaskList[i * (TaskList.size() / nthreads)];
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for UnifiedMemoryStreams and TaskListPtr, then inspect the pthread task-partitioning code shown in the issue. Verify the final worker's pointer starts at its assigned slice rather than adding the remainder twice, and confirm the resulting task ranges remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100