QMCPACK / QMCPACK/qmcpack

Walker member Multiplicity should be an integer value

Open
#5,059 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 13h
Merged PRs (30d)
90

Description

The semantics of Multiplicity as used in the population control of QMCPACK are such that it can only have a non negative integer value. It's currently a floating point value that is very frequently cast to int. There are several possible reason I can think of, in the past someone thought type safety wasn't useful, as origninally conceived of it could have been float, without any documented proof left behind it was a performance issue someone was trying to save defining an MPI type or having two appropriately typed MPI buffers. At anyrate it should have a type that reflects its semantics.

**Describe the solution you'd like**
It should be a signed integer type. Additions and subtractions are done to multiplicity, so it should not be an unsigned type. Unsigned types do not enforce positive values they were designed to handle address spaces and later repurposed as "sizes" but there main feature with C++ math operators is to "wrap around" on over and underflow this not a sensible behavior for Multiplicity.

**Describe alternatives you've considered**
Do nothing...

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Walker member Multiplicity and tracing its population-control uses, including the frequent integer casts and any MPI buffers or types involved. Done means Multiplicity is a signed integer type and its additions, subtractions, casts, and communication paths remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems, hpc
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.