Follow-ups from #281: unneeded Boost type traits in HDF5 archive; MEASURE_* parsing untested
I maintainer di solito rispondono entro 3 giorni
@Ooolab ci sta già lavorando.
Dal 3/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Follow-ups found while reviewing #281 (part of #275). None of them block #281.
1. archive.cpp needs two Boost headers for type traits that do nothing
#281 adds <boost/type_traits/remove_cv.hpp> and <boost/type_traits/remove_reference.hpp> to src/alps/hdf5/src/archive.cpp. Before #281 they came in through <boost/thread.hpp>. Without them the file doesn't compile.
Both traits are used only inside the ALPS_NGS_HDF5_WRITE_SCALAR macro (archive.cpp:1072 and archive.cpp:1106):
detail::native_ptr_converter<boost::remove_cv<boost::remove_reference<T>::type>::type> converter(1);
The macro defines archive::write(std::string path, T value) and is expanded only through ALPS_NGS_FOREACH_NATIVE_HDF5_TYPE (archive.hpp:43), which lists char through long double, bool and std::string. T is always one of these bare types and value is taken by value. remove_cv<remove_reference<T>> gives back T for every one of them.
Fix: use T directly and remove the two includes:
detail::native_ptr_converter<T> converter(1);
The native_ptr_converter<std::string> specialization still matches, because T is exactly std::string in that expansion.
2. No test runs the MEASURE_* parameter parsing
src/alps/scheduler/src/scheduler/measurement_operators.C reads MEASURE_AVERAGE[...], MEASURE_LOCAL[...], MEASURE_CORRELATIONS[...] and MEASURE_STRUCTURE_FACTOR[...] from the input parameters. #281 moved its regular expressions from boost::regex to std::regex. The class is used by fulldiag/sparsediag (alps/scheduler/diag.hpp), the QMC apps (src/apps/qmc/qmc.h) and the loop code (src/apps/qmc/looper/looper/custom.h).
No native or Python test runs an application with these parameters:
- No ctest passes
MEASURE_*keys. python/pyalps/tests/fixtures/application_results/fulldiag.parmcontainsMEASURE_LOCAL[Local magnetization]=Sz, buttest_legacy_results.pyonly loads the frozen.h5files. It does not runfulldiag.
A side-by-side check outside the test suite gave the same matches and captures for std::regex and boost::regex on realistic keys: plain names, nested ], empty brackets, a:b:c. The results differ only when a key or value contains \n or \r. The text parameter grammar never produces such a key or value.
Fix: add a ctest that runs fulldiag on a 4-site chain with one key of each MEASURE_* kind (including a MEASURE_CORRELATIONS[...]=A:B pair) and checks that the observables appear in the output with the expected names and values.
3. Remove the unused alps/ngs/mutex.hpp and alps/ngs/thread_exceptions.hpp
#281 changed alps::native_lockable in src/alps/utilities/include/alps/ngs/mutex.hpp from boost::mutex to std::mutex. Nothing in ALPS uses the header:
- No source file, test or tutorial includes
alps/ngs/mutex.hpp. It appears only in the install list (src/alps/utilities/CMakeLists.txt:65) and intests/cmake/preserved_public_headers.json. - Nothing uses
native_lockable,noop_lockableordetail::mutex_derived. alps/ngs/thread_exceptions.hppis included only bymutex.hpp. It is the last<boost/thread/...>include in ALPS (<boost/thread/exceptions.hpp>).
The header belongs to the NGS layer whose parameters, Monte Carlo base, observables and accumulators are already retired. ALPS_NGS_SINGLE_THREAD is still read by the HDF5 archive lock and cli/mcoptions.cpp, and is not affected.
Fix: remove both headers and their entries in src/alps/utilities/CMakeLists.txt and tests/cmake/preserved_public_headers.json, and add a CHANGELOG line. Downstream code that includes them stops compiling, so as an alternative, mark them deprecated for one release as #210 did for the BLAS headers.
4. ALPS_NGS_SINGLE_THREAD is never defined, and --threaded does nothing
ALPS_NGS_SINGLE_THREAD has no definition: src/alps/utilities/include/alps/ngs/config.hpp:20 has it commented out (// #define ALPS_NGS_SINGLE_THREAD) and no CMake option sets it. As a result:
- The
#ifndef ALPS_NGS_SINGLE_THREADcode always compiles. This includes the HDF5 archive lock (archive.hpp:31,235,archive.cpp:33,1423), which is live and is the lock #281 moved tostd::recursive_mutex. - The
#ifdef ALPS_NGS_SINGLE_THREADbranches never compile: the emptyALPS_HDF5_LOCK_MUTEXinarchive.cpp:33, the "Not build with multithread support" error insrc/alps/cli/src/mcoptions.cpp:57, and the single-thread branches inthread_exceptions.hpp:17andsrc/alps/cli/tests/cli_contract.cpp:77-87. --threaded(mcoptions.cpp:32) is always offered and setsmcoptions::THREADED, orHYBRIDtogether with--mpi. Outsidemcoptions.cppandcli_contract.cpp, nothing readsTHREADEDorHYBRID, so the option is accepted and has no effect.
Fix: make the #ifndef code unconditional, delete the #ifdef branches and the commented-out line in config.hpp, and update cli_contract.cpp. Either remove --threaded along with THREADED and HYBRID, or keep it and document that it has no effect. Removing it changes the command line, so it needs a CHANGELOG line. The cleanup overlaps item 3 if thread_exceptions.hpp is removed.
- Lingua principale
- C++
- Stelle
- 32
- Fork
- 10
- Merge medio
- 4g 5h
- PR unite (30g)
- 52
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
-
Parallel Ising example: operator precedence makes the heat-bath energy difference wrongForse già presa @skilledwolf l’ha presa oggi. Apertaarea:tutorials bug scientific-correctness
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ALPSim/ALPS#313 · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
area:parapack bug scientific-correctness
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
area:lattice bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
Read parameter files straight into the solver input structsForse già presa @Ooolab l’ha presa oggi. Aperta
ALPSim/ALPS#317 · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
alps/parapack/mpi.h: message sizes are truncated to int without a check; MPI errors are now fatal (CHANGELOG)Forse già presa @skilledwolf l’ha presa oggi. Apertaarea:parapack compatibility-change enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
ALPSim/ALPS#315 · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
Issue simili
-
documentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
QuantStack/git2cpp#203 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
BaptisteHudyma/Lamp-Da#588 ·
I maintainer di solito rispondono entro 1 giorno
-
bug macOS networking
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
docling-project/docling-parse#448 ·
I maintainer di solito rispondono entro 5 giorni