Spec §11.1, §11.2, §11.3. Identical dispatch on every rank so collective MPI ops in solver_session_* line up. Only rank 0 owns the socket and writes replies.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | save | :: | g_fd | = | -1 |
True when a SET_/GET_ opcode's own wire kind is compatible with the
schema's expected_kind for the target key. Choice-typed keys (e.g.
flux_scheme) travel as JSON strings on the wire and are accepted by
SET_STRING/GET_STRING, mirroring decode_set_value's existing
wire-compatible grouping of cfg_kind_string with cfg_kind_choice.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | opcode_kind | |||
| integer, | intent(in) | :: | expected_kind |
Human-readable label for a cfg_kind_* tag, used only in
type_mismatch messages (never as a wire code).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | kind |
Rank-0-only ok=false type_mismatch reply for a SET_/GET_ opcode
whose own kind does not match the schema's expected_kind for key.
Callers must check session_schema_lookup's ok first and keep
reporting unknown_key when the key itself is not found; this only
covers a key that does exist but was addressed by the wrong-kind
opcode (e.g. SET_INTEGER on the real-valued key cfl), aligning the
real worker with the cortex stub's stricter behaviour.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | op | |||
| character(len=*), | intent(in) | :: | id | |||
| character(len=*), | intent(in) | :: | key | |||
| integer, | intent(in) | :: | opcode_kind | |||
| integer, | intent(in) | :: | expected_kind | |||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_header(:) |
Turn a failed session operation into a proper reply-level error and tell the caller to stop handling the current opcode. Returns .true. on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | id | |||
| character(len=*), | intent(in) | :: | opcode | |||
| integer, | intent(in) | :: | status | |||
| character(len=*), | intent(in) | :: | message | |||
| integer(kind=int8), | intent(inout), | allocatable | :: | reply_header(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | uri | |||
| character(len=*), | intent(in), | optional | :: | worker_name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | op | |||
| character(len=*), | intent(in) | :: | id | |||
| integer(kind=int8), | intent(in) | :: | header(:) | |||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_header(:) | ||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_payload(:) | ||
| logical, | intent(inout) | :: | done |
Service a COPY_SOLUTION request.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | id | |||
| character(len=*), | intent(in) | :: | op | |||
| integer(kind=int8), | intent(in) | :: | header(:) | |||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_header(:) | ||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_payload(:) | ||
| integer, | intent(out) | :: | status | |||
| character(len=*), | intent(out) | :: | message |
2D COPY_SOLUTION: session packs one i-fastest float64 block per requested primitive (x,y,rho,u,v,p) into a flat buffer; rank 0 transfers it to the binary payload and emits the nx/ny-bearing reply header. Collective.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(inout) | :: | session | |||
| character(len=*), | intent(in) | :: | id | |||
| character(len=*), | intent(in) | :: | op | |||
| integer, | intent(in) | :: | n_prims | |||
| character(len=16), | intent(in) | :: | prim_names(:) | |||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_header(:) | ||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_payload(:) | ||
| integer, | intent(out) | :: | status | |||
| character(len=*), | intent(out) | :: | message |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | fd | |||
| character(len=*), | intent(in) | :: | worker_name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int8), | intent(inout), | allocatable | :: | buf(:) |
Encode a rank-0-only ok=false reply for a config-key read/write. Centralised so the same code shape is used by every SET/GET arm.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | op | |||
| character(len=*), | intent(in) | :: | id | |||
| character(len=*), | intent(in) | :: | code | |||
| character(len=*), | intent(in) | :: | message | |||
| integer(kind=int8), | intent(out), | allocatable | :: | reply_header(:) |
Resolve a config key against the schema matching the session's dim. dim=1 behaviour is byte-identical to the old direct schema_lookup call.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_session_t), | intent(in) | :: | session | |||
| character(len=*), | intent(in) | :: | key | |||
| integer, | intent(out) | :: | idx | |||
| integer, | intent(out) | :: | expected_kind | |||
| logical, | intent(out) | :: | ok | |||
| character(len=*), | intent(out) | :: | message |
Tick handler bound on rank 0 only. Encodes a PROGRESS_TICK and writes it to the existing attached-mode socket fd.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | iter | |||
| real(kind=wp), | intent(in) | :: | sim_time | |||
| real(kind=wp), | intent(in) | :: | dt | |||
| real(kind=wp), | intent(in) | :: | residual | |||
| real(kind=wp), | intent(in) | :: | wallclock_s |