(git:5e7fe52)
Loading...
Searching...
No Matches
qs_kpoint_operators.F File Reference

Go to the source code of this file.

Data Types

type  qs_kpoint_operators::kpoint_operator_context_type
 Caller-owned assembly context for one driver call. Created and released in the same driver routine and passed to helpers as an argument; never stored on the host kpoint_type. Components are private and touched only by this module. More...

Modules

module  qs_kpoint_operators
 Assembly of complex k-point operators from real-space DBCSR matrices. The output is a complex full matrix on the distribution of the k-point group. The module splits this work into a start step and a finish step. One process can start the MPI transfers of many operators before it finishes any of them. The STANDARD k-point driver uses this order. The routines start, finish and get are collective over the environment-wide communicator. Every rank must call the same sequence of service calls. A context references its host kpoint environment without owning it, so it must not outlive that environment. The calls are not thread safe: the caller must serialize them, because their collective communication tolerates no concurrent service call. A separate context per thread only keeps the scratch from aliasing.

Functions/Subroutines

subroutine qs_kpoint_operators::kpoint_operator_densify (rsmat, matrix_row, ik, xkp, cell_to_index, sab_nl, grid, use_grid, rmatrix, cmatrix, tmpmat, fm_re, fm_im)
 Transform one real-space operator to one k point and densify the result: the real part into fm_re and the imaginary part into fm_im. Densify means: copy the blocks of a DBCSR matrix into a full matrix. Stateless: fills caller-provided scratch.
subroutine, public qs_kpoint_operators::kpoint_operator_cfm_to_mo (cmat, mo_re, mo_im, eigenvalues)
 Split a complex matrix into the real and imaginary MO sets and copy the eigenvalues to the imaginary set.
subroutine, public qs_kpoint_operators::kpoint_operator_context_create (ctx, kpoints, ao_ao_fm, nspin)
 Create an empty operator context. The context owns no buffers after this call; they are created on first use and released with the context.
subroutine, public qs_kpoint_operators::kpoint_operator_context_release (ctx)
 Release the context together with every buffer it created. Call once, at the exit of the routine that created the context. Every started instance must be idle at this point. The call aborts when a transfer is still in flight, because nothing would ever wait for its MPI requests.
subroutine, public qs_kpoint_operators::kpoint_operator_start (ctx, ikp, ispin, rsmat, slot, grid, use_grid, matrix_row)
 Start the assembly of one operator for one local k point and spin and launch its transfers to every k-point group. The caller index ikp is local; the walk over groups happens here, so no caller can express a group-local loop. Finish every started instance with kpoint_operator_finish. The first start also creates the slot bookkeeping of the context. Collective over the environment-wide communicator: every rank must call the same sequence of service calls.
subroutine, public qs_kpoint_operators::kpoint_operator_finish (ctx, ikp, ispin, slot, cmat)
 Finish the transfers of one started instance: on the group that owns the k point, merge the received parts into cmat (real part first, overwrite then add); on every group, reclaim the send side. The slot returns to idle. Collective over the environment-wide communicator: every rank must call the same sequence of service calls.
subroutine, public qs_kpoint_operators::kpoint_operator_get (ctx, ikp, ispin, rsmat, cmat, fm_re, fm_im, mat_re, mat_im, matrix_row)
 Assemble one operator for one local k point and spin in one call: run the single-group transfer of the service for every group and finish it immediately, through transfer states local to this call. The persistent slot machinery stays with start and finish. Exactly one output flavor must be present: cmat receives the complex operator (real part overwrites, imaginary part adds) through the context buffer; the fm pair receives the two parts separately, transferred directly into fm_re and fm_im on the owning group (any distribution: the general copy redistributes); or the dbcsr pair receives the two parts as block-cyclic matrices built by the service, replacing the caller-side copy_fm_to_dbcsr_bc detour. The dbcsr matrices must be freshly initialized (dbcsr_init_p) and the cmat flavor must share the distribution of the k-point group. Collective over the environment-wide communicator: every rank must call the same sequence of service calls.

Variables

integer, parameter, public qs_kpoint_operators::kpoint_slot_ks = 1
integer, parameter, public qs_kpoint_operators::kpoint_slot_s = 2
integer, parameter, public qs_kpoint_operators::kpoint_slot_t = 3
integer, parameter, public qs_kpoint_operators::kpoint_spin_free = 1
 Row of rsmat that carries the spin-free operator image. S and T carry no spin copies: drivers launch one instance per spin of their loop and read this same row in every instance.