Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Perf(gint): Add adaptive slab decomposition for LCAO - #8492

Draft
Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:gint
Draft

Growl1234 wants to merge 1 commit into
deepmodeling:developfrom
Growl1234:gint

Conversation

@Growl1234

Copy link
Copy Markdown
Collaborator

A fixed c-axis decomposition can leave some MPI ranks with little grid-integration work when a slab has vacuum along c. With this PR abacus now selects the Gint decomposition axis based on the estimated orbital workload and redistribution cost.

Tested with a simple graphene example: tests.zip

Test Vacuum axis Gint axis SCF loop (s) Total (s) Total change
Γ-only a c → c 53.77 → 54.09 61.15 → 61.53 +0.6% (negligible)
Γ-only b c → c 53.19 → 54.90 60.62 → 62.37 +2.9% (negligible)
Γ-only c c → a 71.85 → 52.57 80.55 → 59.89 −25.6%
Multi-k a c → c 29.36 → 26.65 33.31 → 30.27 −9.1%
Multi-k b c → c 27.38 → 26.92 31.18 → 30.50 −2.2% (negligible)
Multi-k c c → a 35.70 → 27.37 40.11 → 31.29 −22.0%

@Growl1234 Growl1234 added the Performance Issues related to fail running ABACUS label Dec 2, 2026
localcell_info_ = divide_info_->get_localcell_info();
const auto axis = DivideInfo::select_axis(grid, ucell);
divide_info_ = std::make_shared<DivideInfo>(grid, axis);
log << " Gint slab axis = " << "abc"[static_cast<int>(axis)] << '\n';

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.

Existing CI cases likely never select a/b, so the redistribution paths (nspin=4, meta-GGA, force/stress, GPU) are untested. Please add an Autotest case (e.g. 2D slab with vacuum along c, -n 4) that asserts Gint slab axis = a, and list the verification commands in the PR description.

{
streams_num_ = nstream; // the default value of num_stream is 4
const int batch_size = nbz_local;
const int batch_size = grid.nbzp;

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.

After a/b redistribution the local z extent is the full nbz, so nbzp no longer aligns batches with z columns. Consider using the local count, i.e. divide_info_->block_count().z.

unitcell_info_ = std::make_shared<UnitCellInfo>(
ucell_->a1 * ucell_->lat0, ucell_->a2 * ucell_->lat0, ucell_->a3 * ucell_->lat0, nbx, nby, nbz, nmx, nmy, nmz);
ucell_->a1 * ucell_->lat0, ucell_->a2 * ucell_->lat0, ucell_->a3 * ucell_->lat0, grid.nbx, grid.nby, grid.nbz,
grid.nx, grid.ny, grid.nz);

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.

Mesh dimensions now come from pw_big instead of pw_rho. Please confirm they are identical for LCAO, including double-grid setups.


> Note: the choice of bx, by, bz should be integer factors of the dimension of the real space FFT grid in each direction.

## Low Dimension Materials

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.

Instead of deleting this section, please replace it with a short note that the Gint decomposition axis is now selected automatically and reported as Gint slab axis in the running log.

@Growl1234
Growl1234 marked this pull request as draft December 4, 2026 21:31
@Growl1234

Copy link
Copy Markdown
Collaborator Author

Thanks for your review comments. I'll resolve them later today or tomorrow.

This branch has not been deployed

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

Labels

Performance Issues related to fail running ABACUS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants