-
Notifications
You must be signed in to change notification settings - Fork 224
fix output #7317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix output #7317
Changes from all commits
14c864a
82ccdde
3d55ecb
bf88d7f
f44d498
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| #define CAL_ATOMS_INFO_H | ||
| #include "source_io/module_parameter/parameter.h" | ||
| #include "source_estate/cal_nelec_nband.h" | ||
| #include "source_base/global_function.h" | ||
| class CalAtomsInfo | ||
| { | ||
| public: | ||
|
|
@@ -27,7 +28,8 @@ class CalAtomsInfo | |
| para.input.nupdown += atoms[it].mag[ia]; | ||
| } | ||
| } | ||
| GlobalV::ofs_running << " The readin total magnetization is " << para.inp.nupdown << std::endl; | ||
| GlobalV::ofs_running << std::endl; | ||
| ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "The readin total magnetization", para.inp.nupdown); | ||
|
Comment on lines
+31
to
+32
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first added line is indented with a tab; the second with spaces. The surrounding file uses spaces — please normalize both to 12 spaces (matching the surrounding code). |
||
| } | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,10 @@ void print_parameters( | |
| } | ||
| else | ||
| { | ||
| std::cout << std::setw(16) << kv.get_nkstot(); | ||
| const int nspin = kv.get_nspin(); | ||
| const int nkstot = kv.get_nkstot(); | ||
| const int nkpoints_real = (nspin > 0) ? (nkstot / nspin) : nkstot; | ||
| std::cout << std::setw(16) << nkpoints_real; | ||
|
Comment on lines
+99
to
+102
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In |
||
| } | ||
|
|
||
| std::cout << std::setw(12) << GlobalV::NPROC | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,7 +105,7 @@ TEST_F(GintCommonTest, TransferDm2dToGintSupportsDoubleToFloat) | |
| std::vector<hamilt::HContainer<float>> dm_gint; | ||
| dm_gint.push_back(gint_info_->get_hr<float>()); | ||
|
|
||
| ModuleGint::transfer_dm_2d_to_gint(*gint_info_, dm_vec, dm_gint); | ||
| ModuleGint::transfer_dm2d(*gint_info_, dm_vec, dm_gint); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old name documented the operation: take a 2D-block-cyclic DM and reshape it into the gint serial layout. transfer_dm2d reads as "transfer a 2D dm" which doesn't say where to. Since the rename ripples through 9 files plus timer/TITLE labels (which downstream profiling scripts may grep), the win has to clear a high bar. I'd push back on this unless there's a follow-up reason. If you do want a shorter name, “dm_2d_to_gint” is a better landing spot: drop the verb transfer (the X_to_Y form already conveys "convert/reshape" by convention) but keep both the source layout (2d) and the destination (gint). It goes from 22 → 13 chars without losing information, and the timer/TITLE labels can migrate with a single grep. |
||
|
|
||
| ASSERT_EQ(dm_gint.size(), 1); | ||
| EXPECT_EQ(dm.get_ijr_info(), dm_gint[0].get_ijr_info()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A pre-existing bug: print(find) is called from both
recordandrecord_gpuand unconditionally printsconsume[find]— neverconsume_gpu[find]. A GPU allocation that crosses the new 20 MB line will print whatever happens to be in the CPU slot (often 0). Worth fixing while you're here.Recommended fix: pass the data, drop the index
Decouple print from the global table layout entirely. It only needs a name and a size:
Then at every call site, replace print(find); with the explicit form:
This is the cleanest fix — print no longer has a hidden coupling to "which table am I being called from", and it becomes trivially testable.