Skip to content

dftd4 library does not support MPI parallelism #7487

Closed

Description

@cyxpku

Details

The dftd4 library does not support running with multiple MPI processes (mpirun -np N with N > 1). ABACUS test cases involving dftd4 do not work with multiple MPI processes..

Affected ABACUS test cases:

  • 03_NAO_multik / relax_cell_vdw4_d4
  • 03_NAO_multik / relax_cell_vdw4_d4s

Question for dftd4 developers: Is MPI support planned or technically feasible in a future release?

Have you read FAQ on the online manual http://abacus.deepmodeling.com/en/latest/community/faq.html

  • Yes, I have read the FAQ part on online manual.

Task list for Issue attackers (only for developers)

  • Understand the problem or question described by the user.
  • Check if the issue is a known problem or has been addressed in the documentation.
  • Test the issue or problem on a similar system or environment, if possible.
  • Identify the root cause or provide clarification on the user's question.
  • Provide a step-by-step guide, including any necessary resources, to resolve the issue or answer the question.
  • If the issue is related to documentation, update the documentation to prevent future confusion (optional).
  • If the issue is related to code, consider implementing a fix or improvement (optional).
  • Review and incorporate any relevant feedback from users or developers.
  • Ensure the user's issue is resolved or their question is answered and close the ticket.

Activity

  1. added
    Questions
    on Jun 18, 2026
  2. Growl1234 commented on Jun 18, 2026

    @Growl1234
    Collaborator

    Question for dftd4 developers: Is MPI support planned or technically feasible in a future release?

    No, there is no plan for an MPI support on the dftd4 program side; see dftd4/dftd4#329.

    The only path to enable MPI parallelism for D4 correction in ABACUS has been made clear in #7380:

    The only solution I can see would be to implement an ABACUS-native D4 backend, with an internal EEQ solver and MPI-parallel CN, pair, and three-body dispersion loops, while still relying on the DFT-D4 library for parameters, model data, and reference results.

    There has been a successful implementation in CP2K; you can mainly see qs_dispersion_d4.F and eeq_method.F and use the master branch to test the effectiveness. It's clear that such implementation is not easy, especially for C++ coding.

  3. Growl1234 commented on Aug 13, 2026

    @Growl1234
    Collaborator

    I found a way to parallelize the DFT-D4 calculation across MPI ranks without a rather involved change on the ABACUS side.

    It introduces a new DFT-D4 API that allows downstream callers to assign each rank a partition of the pairwise and ATM interaction loops, and then reduce the resulting energy, gradient, and virial themselves. The core implementation will happen on the dftd4 side, so ABACUS will only need to pass the rank and communicator size and perform the reductions.

    You can see dftd4/dftd4#395 for details.

    CC: @mohanchen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Questions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions