Add fixed-cell i-PI socket driver#7609
Open
Phorbol wants to merge 1 commit into
Open
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
No linked issue. This PR adds a new optional driver mode and does not change the default execution path.
Unit Tests and/or Case Tests for my changes
chg_extrap defaultwithcalculation socket, expectingfirst-order.SocketIOCalculatordriver:chg_extrap atomic,first-order, andsecond-orderin socket mode. The result is trajectory dependent, so this PR documents the default behavior but does not claim one extrapolation mode is universally fastest.Exact Verification Performed
Commands run:
Result summary:
develop.abacus_basic_gpu.abacus_basic_gpu -h calculationlistssocket.abacus_basic_gpu -h chg_extrapdocuments thatdefaultchoosesfirst-orderforrelax/cell-relax/socket,second-orderformd, andatomicfor other calculations.Checks not run, with reason:
FrechetCellFilterworkflows were not run because this PR intentionally supports fixed-cell energy/force requests only.What's changed?
This PR adds a fixed-cell i-PI-compatible socket driver mode for ABACUS.
Motivation:
SocketIOCalculatorand similar drivers while keeping the default ABACUS calculation modes unchanged.SocketIOCalculator, to keep one ABACUS process alive and request energy/forces for updated atomic positions.User-visible INPUT change:
Socket endpoint selection:
export ABACUS_IPI_ADDRESS=/tmp/ipi_abacus_test:UNIXThe value is an address string, not an installed dependency:
/tmp/ipi_abacus_testis the UNIX-domain socket path created by the external driver.:UNIXtells ABACUS to connect through a UNIX-domain socket instead of TCP.ABACUS_IPI_ADDRESS=localhost:31415is also supported./tmp/ipi_abacus_${SLURM_JOB_ID}:UNIX, to avoid collisions.No i-PI library is linked or required by ABACUS. The implementation speaks the subset of the i-PI socket protocol needed by ASE-style drivers using POSIX sockets. Users need an external socket server/driver, for example ASE, to create the socket and launch ABACUS as the client.
Implementation details:
driver_run()dispatchescalculation sockettoDriver::driver_ipi_run()before the ordinary calculation-mode dispatch.driver_ipi_run()initializes hardware and an ESolver once, then enters an i-PI message loop.STATUS,INIT,POSDATA, andGETFORCEmessages.POSDATA, ABACUS updates atomic positions in the existing fixed cell, runs the SCF runner, computes energy and forces, and stores them for the followingGETFORCEresponse.after_all_runners()is called only after at least one successful runner call.Example external-driver shape with ASE:
Example minimal INPUT fragment:
Compile/use notes:
source/CMakeLists.txt.SocketIOCalculator, to create the socket and launch/connect ABACUS.Governance Checklist
Driverintegration patterns and usesPARAM/GlobalVfor input, rank, logging, ESolver setup, JSON output, and hardware lifecycle.ipi_socket.hincludes standard library declarations needed for its public value types (std::string,std::vector,std::size_t).source/CMakeLists.txt.docs/parameters.yamlanddocs/advanced/input_files/input-main.md.@coderabbitai review.INPUT Parameter Changes
calculation: adds the new accepted valuesocket.cal_force: defaults to enabled forcalculation socket, consistent with socket energy/force use.chg_extrap: documents calculation-dependentdefaultrouting and routes socket mode tofirst-order.docs/parameters.yamlupdated: yes.docs/advanced/input_files/input-main.mdupdated: yes.Core Module Impact
Driver: adds a new socket driver dispatch path.ESolver: reused through the existing SCF runner path; no ESolver API change.UnitCell: positions are updated from incoming POSDATA under a fixed cell; variable-cell updates are rejected.source_io/module_parameter: adds INPUT metadata/default behavior for socket mode.calculation socket.PARAM/GlobalV, covered by the governance exception below.scf,relax,md,cell-relax, and post-processing modes should continue through the existing dispatch path.Governance Exception
GlobalV,GlobalC, orPARAMreferences.PARAM/GlobalVpatterns. The socket driver follows that integration style to keep the change localized and avoid broad core-interface churn.driver_run.cpp.Driver, ESolver setup, logging, hardware lifecycle, and JSON output interfaces, which is larger than this feature PR.