Update the output of OFDFT, particularly for the ML part#7383
Merged
Conversation
added 2 commits
May 26, 2026 09:41
Summary of changes: 1. Modified ML_Base::set_device() to accept std::ostream& ofs_running parameter instead of using std::cout directly 2. Updated KEDF_ML::set_para() to pass ofs_running through the call chain 3. Modified KEDF_ML::init_data() to accept ofs_running parameter 4. Updated NN_OFImpl constructor to accept ofs_running parameter for logging nnode/nlayer 5. Modified Cal_MLKEDF_Descriptors::set_para() to accept ofs_running parameter for logging nkernel 6. Updated ML_EXX class methods (set_para, init_data, localTest) to use ofs_running 7. Updated all call sites to pass GlobalV::ofs_running 8. Changed 'NN' to 'Neural Network' in device initialization messages 9. Fixed 'WARNING: ML >= TF' message in KEDF_Manager::get_energy() to use ofs_running 10. Reformatted KEDF_ML::set_para() and cal_tool->set_para() calls with one parameter per line All ML KEDF related output messages now write to the running log file instead of stdout.
zzlinpku
reviewed
May 27, 2026
zzlinpku
reviewed
May 27, 2026
added 2 commits
May 29, 2026 17:28
zzlinpku
approved these changes
Jun 1, 2026
zzlinpku
reviewed
Jun 1, 2026
Collaborator
zzlinpku
left a comment
There was a problem hiding this comment.
Thanks for this PR! The direction of redirecting diagnostic output from std::cout to the log stream (GlobalV::ofs_running) is exactly right — computational libraries should not pollute stdout with debug/info messages. The const std::string& improvement in set_device and the "NN" → "Neural Network" rename are also nice touches.
I left a few inline comments below. The main items to address:
- Unused parameter warning in
pot_ml_exx_label.cpp—ofs_runningis added toinit_data()but not used in the function body. - Inconsistent leading space in two files where
" Default type: "has a leading space that was not in the original message. - Typo — "unaviable" → "unavailable".
Also noted (not in diff, worth checking):
kedf_ml.cpp:140(get_energy) still has a barestd::cout << "energy" << energy << std::endl;that was not converted. If it's in scope for this PR, consider passingofs_runningto that method as well.ml_base.cpp:206,214(dumpTensor,dumpMatrix) still usestd::cout— these may be out of scope, but flagging for awareness.
sunliang98
reviewed
Jun 4, 2026
sunliang98
approved these changes
Jun 4, 2026
added 2 commits
June 4, 2026 15:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the output of OFDFT, particularly for the ML part