C++ and C/Fortran APIs¶
C++¶
melissa::init(const std::string& node_name, MPI_Comm comm)¶
Initializes the Melissa API context and registers a node. This is a collective MPI operation that must be called by all ranks before any data can be transmitted via melissa::send().
Initialization consists of two stages:
- Global lifecycle setup (first call only)
Initializes the Melissa API context and registers a node. This is a collective MPI operation that must be called by all ranks before any data can be transmitted via
melissa::send().
Initialization consists of two stages:
-
Global lifecycle setup (first call only)
- Establishes the connection with the Melissa server.
- Initializes global runtime structures.
-
Node channel registration (every call)
- Creates and tracks a communication channel for the specified node.
Parameters¶
node_name— Unique identification string for the data node.-
comm— MPI communicator governing the simulation ranks.- Establishes the connection with the Melissa server.
- Initializes global runtime structures.
-
Node channel registration (every call)
- Creates and tracks a communication channel for the specified node.
Parameters¶
node_name— Unique identification string for the data node.comm— MPI communicator governing the simulation ranks.
melissa::send(const std::string& node_name, conduit::Node& payload)¶
Transmits a structured Conduit node payload to the Melissa server.
This is a collective operation across the MPI communicator. All ranks must call this function, but aggregation and transmission are handled by Rank 0.
Supported payload handling:
- Homogeneous leaf arrays are concatenated into a single linear array.
- Complex or hierarchical nodes are stored under rank-specific keys such as
r0/,r1/, allowing server-side consolidation.
Parameters¶
node_name— Registered node identification string.payload— Conduit node containing the simulation data.
melissa::send(const std::string& node_name, double* send_vect, size_t vect_size)¶
Transmits a double-precision (64-bit floating point) simulation array.
This overload wraps the raw array buffer into a temporary zero-copy Conduit node. On Rank 0, arrays from all ranks are automatically concatenated into a single continuous double-precision payload.
Parameters¶
node_name— Registered node identification string.send_vect— Pointer to the raw double-precision array buffer.vect_size— Number of double elements contained in the local process slice.
melissa::send(const std::string& node_name, float* send_vect, size_t vect_size)¶
Transmits a single-precision (32-bit floating point) simulation array.
This overload wraps the raw array buffer into a temporary zero-copy Conduit node. On Rank 0, arrays from all ranks are automatically concatenated into a single continuous single-precision payload.
Parameters¶
node_name— Registered node identification string.send_vect— Pointer to the raw single-precision array buffer.vect_size— Number of float elements contained in the local process slice.
melissa::finalize()¶
Terminates the Melissa client session.
Releases all ZMQ sockets and internal runtime state. This function must be called before MPI_Finalize().
melissa::Parameters fetch_next_parameters()¶
Fetches the next simulation parameters from the Melissa server.
Only valid in persistent client mode when MELISSA_PERSISTENT_CLIENT_ID is set.
The function blocks until the server responds. Each MPI rank independently reads parameters from the memory-mapped file using the returned simulation ID.
Always is_terminated status before using returned values.
C/Fortran API¶
melissa_init(const char* node_name, MPI_Comm comm)¶
C binding for melissa::init.
melissa_init_f(const char* node_name, MPI_Fint* comm_fortran)¶
Fortran ABI bridge wrapper for melissa::init.
melissa_send_node(const char* node_name, conduit_node* payload)¶
C binding for melissa::send using a Conduit node payload.
melissa_send_double(const char* node_name, double* send_vect, size_t vect_size)¶
C binding for melissa::send using a double-precision array.
melissa_send_float(const char* node_name, float* send_vect, size_t vect_size)¶
C binding for melissa::send using a single-precision array.
melissa_finalize(void)¶
C binding for melissa::finalize.
melissa_parameters_t¶
C layout mapping for data returned by parameter steering iterations which is equivalent to melissa::Parameters.
Members¶
| Member | Description |
|---|---|
sim_id |
Simulation or iteration sequence identifier. |
nb_parameters |
Total number of values stored in the parameter array. |
is_terminated |
Flag indicating whether server execution has completed. |
parameters |
Pointer to the contiguous parameter value array. |
melissa_fetch_next_parameters(void)¶
C binding for melissa::fetch_next_parameters. Returns a pointer to a constant melissa_parameters_t structure containing the next simulation parameters.