Monte Carlo results are not bit-reproducible with a fixed SEED (scheduler keeps sweeping past SWEEPS; MPI merges runs in arrival order)
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- distributed-systems, testing
Direzione di ricerca
Start with Worker::run() and SingleScheduler::run() in src/alps/scheduler/src/scheduler/single_scheduler.C, then inspect SlaveTask::run() and MCSimulation::get_measurements, get_summary and work_done in montecarlo.C. Compare the legacy scheduler with mcbase::run in src/alps/mc/src/mcbase.cpp; the issue describes the desired stopping and MPI receive ordering. Done means fixed-seed runs produce identical results and the proposed serial and two-rank run-twice comparisons pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Two runs of the same task with identical parameters, SEED, binary and one thread give different averages. The random stream is identical; the number of measurements is not.
SingleScheduler::run() (src/alps/scheduler/src/scheduler/single_scheduler.C) performs one dostep() per loop iteration and asks finished() only every Tmin..Tmax seconds (defaults 60 and 900 s). Nothing stops dostep() once work_done() reaches 1, so sweeps accumulate until the next wall-clock check. The serial and MPI schedulers, and MPI slaves via SlaveTask::run(), share the pattern. The newer mcbase::run (src/alps/mc/src/mcbase.cpp) already stops at fraction_completed() >= 1; the legacy scheduler should do the same.
In MPI runs there is a second source: MCSimulation::get_measurements (montecarlo.C) receives remote results with IMPDump receive(MCMP_measurements), that is from MPI_ANY_SOURCE, so runs are merged in arrival order.
Consequences: SWEEPS is a lower bound, no bit-exact regression test exists for any MC application, and a short task runs for at least Tmin after it is done.
Reproduce
spinmc, square lattice L=4, MODEL="Ising", J=1, T=2.269186, THERMALIZATION=20000, SWEEPS=400000, UPDATE="cluster", fixed SEED, --Tmin 5, run twice: |Magnetization| differs at the 1 sigma level. fulldiag, sparsediag and dmrg are bit-identical under the same conditions.
Proposed fix
-
Step only while work remains, in
Worker::run():void Worker::run() { if (started && work_done() < 1.) dostep(); }The time-based
finished()poll then decides only when to halt and write.AbstractSpinSim::work_done()withERROR_LIMITcomputes an error estimate, so cache its result or evaluate it every n sweeps. -
Evaluate
finished()as soon as all local runs reportwork_done() >= 1, removing the dead time for short tasks. -
Merge remote runs in a fixed order: receive from each process in
where_masterexplicitly (IMPDump receive(where_master[i], MCMP_measurements)), inget_measurements,get_summaryandwork_done. -
Document that a fixed
SEEDwith one thread per run is then bit-reproducible on a given build, and add a run-twice-and-compare test per MC application, serial and with two ranks.
- Lingua principale
- C++
- Stelle
- 32
- Fork
- 10
- Merge medio
- 4g 14h
- PR unite (30g)
- 46
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ALPSim/ALPS
-
area:lattice bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
documentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
I maintainer di solito rispondono entro 3 giorni
-
area:qmc enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 3 giorni
-
spinmc_evaluate and qwl_evaluate fail on tasks whose results are spread over several run filesApertaarea:mc area:qmc bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 3 giorni
-
area:dmrg bug scientific-correctness
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 3 giorni
Issue simili
-
bug libcudf
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
level/task module/cloud monitoring type/maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
LadybirdBrowser/ladybird#13809 ·
I maintainer di solito rispondono entro 1 giorno
-
bug module:nodes tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rocketride-org/rocketride-server#3020 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 9 giorni