Skip to content

Update the output of OFDFT, particularly for the ML part#7383

Open
mohanchen wants to merge 2 commits into
deepmodeling:developfrom
mohanchen:20260526-MPN
Open

Update the output of OFDFT, particularly for the ML part#7383
mohanchen wants to merge 2 commits into
deepmodeling:developfrom
mohanchen:20260526-MPN

Conversation

@mohanchen
Copy link
Copy Markdown
Collaborator

Update the output of OFDFT, particularly for the ML part

abacus_fixer 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.
@mohanchen mohanchen requested a review from zzlinpku May 26, 2026 01:45
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels May 26, 2026

# ABACUS executable path
abacus=abacus
abacus=/home/510Group/2_abacus/abacus-mc/build_ml_para/abacus_ml_para
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use local addresses here.

#include "nn_of.h"

NN_OFImpl::NN_OFImpl(int nrxx, int nrxx_vali, int ninpt, int nnode, int nlayer, torch::Device device)
NN_OFImpl::NN_OFImpl(int nrxx, int nrxx_vali, int ninpt, int nnode, int nlayer, torch::Device device, std::ostream& ofs_running)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's best not to modify the nn_of file, as it is directly linked to the training script — changing it will cause errors.For here, don't change this function's definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants