parapack MPI: messages over 2 GiB fail without a clear error; CHANGELOG note missing
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 57/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- distributed-systems
Research direction
Start with src/alps/parapack/include/alps/parapack/mpi.h, especially the MPI_Send and gather size conversions called out in the issue; check how size limits and error handling are covered nearby. Also review the #284 CHANGELOG entry for the MPI error behavior. Done means oversized messages are rejected clearly and the CHANGELOG explains the fatal MPI error behavior.
Written by the indexing model from the issue text.
Description
Two small items in src/alps/parapack/include/alps/parapack/mpi.h:
- A serialized message of 2 GiB or more is sent with its size cast to
int, so the count wraps and the receiver gets garbage or anarchive_exceptioninstead of a clear error. Not a regression (Boost.MPI had the same limit). Fix: a size check insendandgather, a few lines. - MPI errors now abort the job instead of throwing a catchable exception. Probably better, but user-visible, and the CHANGELOG does not mention it. Suggest one sentence there.
1. Size check
Unchecked casts:
- line 138:
MPI_Send(..., static_cast<int>(buffer.size()), MPI_BYTE, ...)for every serialized value (clone info, parameters, observable sets); - lines 188 and 206:
int size = static_cast<int>(value.size());ingather.
A wrapped count either fails with an MPI count error (fatal, see 2) or silently sends a prefix. Suggested guard, in both places:
if (buffer.size() > static_cast<std::size_t>(std::numeric_limits<int>::max()))
throw std::length_error("alps::mpi::send: message exceeds the MPI count limit");
Large observable sets gathered from clones are the one place this could plausibly happen.
2. CHANGELOG: MPI errors abort
Boost.MPI's environment installed MPI_ERRORS_RETURN on MPI_COMM_WORLD (all four constructors in libs/mpi/src/environment.cpp) and turned failing calls into boost::mpi::exception, which parapack's catch (std::exception&) → comm_exit(true) handled. alps::mpi::environment keeps the default MPI_ERRORS_ARE_FATAL, and neither utilities/mpi.hpp nor parapack/mpi.h checks return codes, so any MPI error now ends the job with the MPI runtime's message.
This is arguably the safer behaviour: every raw MPI_* call in ALPS (accumulators, gf, utilities/mpi.hpp) ignores return codes and would have continued after an error under the old handler. One sentence in the #284 CHANGELOG entry would cover it.
- Dominant language
- C++
- Stars
- 32
- Forks
- 10
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from ALPSim/ALPS
-
Parallel Ising example: operator precedence makes the heat-bath energy difference wrongPossibly taken @skilledwolf claimed this 1 day ago. Openarea:tutorials bug scientific-correctness
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ALPSim/ALPS#313 · 1 assignee ·
Maintainers usually reply within 2 days
-
Replica exchange with PROCESS_PER_WORKER > 1 creates too few replicasPossibly taken @skilledwolf claimed this today. Openarea:parapack bug scientific-correctness
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ALPSim/ALPS#312 · 1 assignee ·
Maintainers usually reply within 2 days
-
area:lattice bug
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 2 days
-
Read parameter files straight into the solver input structsPossibly taken @Ooolab claimed this 1 day ago. Open
ALPSim/ALPS#317 · 1 assignee ·
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
xiaoyifang/goldendict-ng#3148 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 4 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug]: Launching Space Calibrator causes Bluetooth mouse lag due to a 100% duty-cycle BLE scanPossibly taken @Yuuki204 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days