DAMARIS  1.11.0
Macros | Typedefs | Enumerations | Functions
Damaris.h File Reference
#include <stdlib.h>
#include <mpi.h>
Include dependency graph for Damaris.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DAMARIS_VERSION_MAJOR   1
 
#define DAMARIS_VERSION_MINOR   11
 
#define DAMARIS_VERSION_PATCH   0
 
#define DAMARIS_VERSION   "1.11.0"
 
#define HAVE_HDF5_ENABLED
 
#define HAVE_PARAVIEW_ENABLED
 
#define HAVE_PYTHON_ENABLED
 

Typedefs

typedef void(* signal_t) (const char *, int32_t, int32_t, const char *)
 

Enumerations

enum  {
  DAMARIS_OK = 0 , DAMARIS_INIT_ERROR , DAMARIS_FINALIZE_ERROR , DAMARIS_CORE_IS_SERVER ,
  DAMARIS_NO_SERVER , DAMARIS_ALLOCATION_ERROR , DAMARIS_CONFIG_ERROR , DAMARIS_ARGUMENT_ERROR ,
  DAMARIS_MPI_ERROR , DAMARIS_DATASPACE_ERROR , DAMARIS_CHANNEL_ERROR , DAMARIS_INVALID_TAG ,
  DAMARIS_NOT_INITIALIZED , DAMARIS_ALREADY_INITIALIZED , DAMARIS_UNDEFINED_ACTION , DAMARIS_UNDEFINED_PARAMETER ,
  DAMARIS_UNDEFINED_VARIABLE , DAMARIS_INVALID_BLOCK , DAMARIS_INVALID_DIMENSIONS , DAMARIS_BLOCK_NOT_FOUND ,
  DAMARIS_REACTOR_NOT_FOUND , DAMARIS_BIND_ERROR , DAMARIS_ERROR_UNKNOWN
}
 
enum  DAMARIS_PLUGIN_TYPE { DAMARIS_HAS_HDF5 = 0 , DAMARIS_HAS_VISIT , DAMARIS_HAS_PARAVIEW , DAMARIS_HAS_PYTHON }
 
enum  DAMARIS_TYPE_STR {
  DAMARIS_TYPE_CHAR = 0 , DAMARIS_TYPE_UCHAR , DAMARIS_TYPE_SHORT , DAMARIS_TYPE_USHORT ,
  DAMARIS_TYPE_INT , DAMARIS_TYPE_UINT , DAMARIS_TYPE_LONG , DAMARIS_TYPE_ULONG ,
  DAMARIS_TYPE_FLOAT , DAMARIS_TYPE_DOUBLE , DAMARIS_TYPE_UNDEFINED
}
 

Functions

const char * damaris_error_string (int ERROR_NUMBER)
 
int damaris_initialize (const char *configfile, MPI_Comm comm)
 
int damaris_finalize (void)
 
int damaris_start (int *is_client)
 
int damaris_stop (void)
 
int damaris_write (const char *varname, const void *data)
 
int damaris_write_block (const char *varname, int32_t block, const void *data)
 
int damaris_get_type (const char *variable_name, DAMARIS_TYPE_STR *vartype)
 
int damaris_has_plugin (DAMARIS_PLUGIN_TYPE plugin)
 
int damaris_alloc (const char *varname, void **ptr)
 
int damaris_alloc_block (const char *varname, int32_t block, void **ptr)
 
int damaris_commit (const char *varname)
 
int damaris_commit_block (const char *varname, int32_t block)
 
int damaris_commit_iteration (const char *varname, int32_t iteration)
 
int damaris_commit_block_iteration (const char *varname, int32_t block, int32_t iteration)
 
int damaris_clear (const char *varname)
 
int damaris_clear_block (const char *varname, int32_t block)
 
int damaris_clear_iteration (const char *varname, int32_t iteration)
 
int damaris_clear_block_iteration (const char *varname, int32_t block, int32_t iteration)
 
int damaris_signal (const char *signal_name)
 
int damaris_bind (const char *signal_name, signal_t sig)
 
int damaris_parameter_get (const char *param_name, void *buffer, unsigned int size)
 
int damaris_parameter_set (const char *param_name, const void *buffer, unsigned int size)
 
int damaris_set_position (const char *var_name, const int64_t *position)
 
int damaris_set_block_position (const char *var_name, int32_t block, const int64_t *position)
 
int damaris_client_comm_get (MPI_Comm *comm)
 
int damaris_end_iteration (void)
 
int damaris_get_iteration (int *iteration)
 

Detailed Description

Function used to return a string representation of an Damaris error code.

Parameters
[in]ERROR_NUMBER: An error number returned from a Damaris function (see enumerated list in)
Returns
A string representation of the Damaris error code

Macro Definition Documentation

◆ DAMARIS_VERSION

#define DAMARIS_VERSION   "1.11.0"

◆ DAMARIS_VERSION_MAJOR

#define DAMARIS_VERSION_MAJOR   1

◆ DAMARIS_VERSION_MINOR

#define DAMARIS_VERSION_MINOR   11

◆ DAMARIS_VERSION_PATCH

#define DAMARIS_VERSION_PATCH   0

◆ HAVE_HDF5_ENABLED

#define HAVE_HDF5_ENABLED

◆ HAVE_PARAVIEW_ENABLED

#define HAVE_PARAVIEW_ENABLED

◆ HAVE_PYTHON_ENABLED

#define HAVE_PYTHON_ENABLED

Typedef Documentation

◆ signal_t

typedef void(* signal_t) (const char *, int32_t, int32_t, const char *)

Function used for signals.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

List of error codes that Damaris can return.

  • DAMARIS_OK everything is fine.
  • DAMARIS_INIT_ERROR error during initialization.
  • DAMARIS_FINALIZE_ERROR error during finalization.
  • DAMARIS_CORE_IS_SERVER illegal operation on this core (client operations).
  • DAMARIS_NO_SERVER illegal operation in standalone mode.
  • DAMARIS_ALLOCATION_ERROR allocation error.
  • DAMARIS_CONFIG_ERROR configuration error.
  • DAMARIS_ARGUMENT_ERROR invalid argument.
  • DAMARIS_MPI_ERROR error during an MPI call.
  • DAMARIS_DATASPACE_ERROR invalid DataSpace.
  • DAMARIS_CHANNEL_ERROR error during the use of a Channel objet.
  • DAMARIS_INVALID_TAG invalid tag in the Reactor system.
  • DAMARIS_NOT_INITIALIZED illegal call before initialization of Damaris.
  • DAMARIS_ALREADY_INITIALIZED illgal call after initialization of Damaris.
  • DAMARIS_UNDEFINED_ACTION undefined action.
  • DAMARIS_UNDEFINED_PARAMETER undefined parameter.
  • DAMARIS_UNDEFINED_VARIABLE undefined variable.
  • DAMARIS_INVALID_BLOCK invalid block id.
  • DAMARIS_INVALID_DIMENSIONS invalid dimensions.
  • DAMARIS_BLOCK_NOT_FOUND block not found.
  • DAMARIS_REACTOR_NOT_FOUND reactor not initialized.
  • DAMARIS_BIND_ERROR error when trying a function as a signal.
  • DAMARIS_ERROR_UNKNOWN unknown error.
Enumerator
DAMARIS_OK 
DAMARIS_INIT_ERROR 
DAMARIS_FINALIZE_ERROR 
DAMARIS_CORE_IS_SERVER 
DAMARIS_NO_SERVER 
DAMARIS_ALLOCATION_ERROR 
DAMARIS_CONFIG_ERROR 
DAMARIS_ARGUMENT_ERROR 
DAMARIS_MPI_ERROR 
DAMARIS_DATASPACE_ERROR 
DAMARIS_CHANNEL_ERROR 
DAMARIS_INVALID_TAG 
DAMARIS_NOT_INITIALIZED 
DAMARIS_ALREADY_INITIALIZED 
DAMARIS_UNDEFINED_ACTION 
DAMARIS_UNDEFINED_PARAMETER 
DAMARIS_UNDEFINED_VARIABLE 
DAMARIS_INVALID_BLOCK 
DAMARIS_INVALID_DIMENSIONS 
DAMARIS_BLOCK_NOT_FOUND 
DAMARIS_REACTOR_NOT_FOUND 
DAMARIS_BIND_ERROR 
DAMARIS_ERROR_UNKNOWN 

◆ DAMARIS_PLUGIN_TYPE

To allow client/simulation code to introspect what Damaris has been compiled with. This can be useful when writing an XML configuration. Used in conjunction with damaris_has_plugin().

Enumerator
DAMARIS_HAS_HDF5 
DAMARIS_HAS_VISIT 
DAMARIS_HAS_PARAVIEW 
DAMARIS_HAS_PYTHON 

◆ DAMARIS_TYPE_STR

These define a set of types that a Damaris variable may be. Currently none of the unsisgned types are available as Layouts in Damaris. The value is returned in vartype by damaris_get_type(const char* variable_name, DAMARIS_TYPE_STR *vartype);

Enumerator
DAMARIS_TYPE_CHAR 
DAMARIS_TYPE_UCHAR 
DAMARIS_TYPE_SHORT 
DAMARIS_TYPE_USHORT 
DAMARIS_TYPE_INT 
DAMARIS_TYPE_UINT 
DAMARIS_TYPE_LONG 
DAMARIS_TYPE_ULONG 
DAMARIS_TYPE_FLOAT 
DAMARIS_TYPE_DOUBLE 
DAMARIS_TYPE_UNDEFINED 

Function Documentation

◆ damaris_alloc()

int damaris_alloc ( const char *  varname,
void **  ptr 
)

Allocates the data required for a variable to be entirely written in memory. Similar to damaris_alloc_block(varname,0,ptr).

Parameters
[in]varname: name of the variable to write.
[out]ptr: pointer to a pointer to the allocated memory.
Returns
DAMARIS_OK on success, other error codes on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_alloc_block()

int damaris_alloc_block ( const char *  varname,
int32_t  block,
void **  ptr 
)

Allocates the data required for a block of a variable to be written in memory.

Parameters
[in]varname: name of the variable to write.
[in]block: block id for which to allocate memory.
[out]ptr: pointer to a pointer to the allocated memory.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_bind()

int damaris_bind ( const char *  signal_name,
signal_t  sig 
)

Associates a signal name to a function from the executable.

Parameters
[in]signal_name: name of the signal.
[in]sig: function to bind.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_clear()

int damaris_clear ( const char *  varname)

Clears the specified variable. This call is equivalent to damaris_clear_block(varname,0). Will transfer the responsibility of the data to the dedicated cores.

Parameters
[in]varname: name of the variable to clear.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_clear_block()

int damaris_clear_block ( const char *  varname,
int32_t  block 
)

Clears the block for the specified variable.

Parameters
[in]varname: name of the variable to clear.
[in]block: block id.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_clear_block_iteration()

int damaris_clear_block_iteration ( const char *  varname,
int32_t  block,
int32_t  iteration 
)

Clears the block for the specified variable at a specified iteration.

Parameters
[in]varname: name of the variable to clear.
[in]iteration: iteration number.
[in]block: block id.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_clear_iteration()

int damaris_clear_iteration ( const char *  varname,
int32_t  iteration 
)

Clears the specified variable at a specified iteration.

Parameters
[in]varname: name of the variable to clear.
[in]iteration: iteration to clear.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_client_comm_get()

int damaris_client_comm_get ( MPI_Comm *  comm)

Gets the communicator that the clients must use.

Parameters
[out]comm: communicator gathering clients.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_commit()

int damaris_commit ( const char *  varname)

Commits data associated to the variable on current iteration. This function is equivalent to calling damaris_commit_block(varname,0).

Parameters
[in]varname: name of the variable to commit.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_commit_block()

int damaris_commit_block ( const char *  varname,
int32_t  block 
)

Commits a specific block of variable from the current iteration. The variable should be defined in the configuration file and the block id should be within the range defined by the number of domains per client.

Parameters
[in]varname: name of the variable to commit.
[in]block: block id.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_commit_block_iteration()

int damaris_commit_block_iteration ( const char *  varname,
int32_t  block,
int32_t  iteration 
)

Commits a specific block of variable from the given iteration. The variable should be defined in the configuration file and the block id should be within the range defined by the number of domains per client.

Parameters
[in]varname: name of the variable to commit.
[in]block: block id.
[in]iteration: iteration to commit.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_commit_iteration()

int damaris_commit_iteration ( const char *  varname,
int32_t  iteration 
)

Commits variable from the given iteration. This call is equivalent to damaris_commit_block_iteration(varname,0,iteration).

Parameters
[in]varname: name of the variable to commit.
[in]iteration: iteration to commit.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_end_iteration()

int damaris_end_iteration ( void  )

Ends the current iteration.

Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_error_string()

const char* damaris_error_string ( int  ERROR_NUMBER)
Here is the caller graph for this function:

◆ damaris_finalize()

int damaris_finalize ( void  )

Finalize Damaris. Should be called before MPI_Finalize. If Damaris was started (damaris_start), it should be stopped before this call.

Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_get_iteration()

int damaris_get_iteration ( int *  iteration)

Gets the current iteration number.

Parameters
[out]iteration: current iteration number.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_get_type()

int damaris_get_type ( const char *  variable_name,
DAMARIS_TYPE_STR vartype 
)

Checks what a variables layout type is and returns an enumerated constant indicating the type

Parameters
[in]varname: name of the variable to check the type of.
[out]vartype: enumerated constant indicating what data type the Variable data is defined with.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_has_plugin()

int damaris_has_plugin ( DAMARIS_PLUGIN_TYPE  plugin)

Checks if a particular Damaris plugin is available.

Parameters
[out]vartype: enumerated constant indicating what data type the Variable data is defined with.
Returns
1 on plugin being available, 0 otherwise

◆ damaris_initialize()

int damaris_initialize ( const char *  configfile,
MPI_Comm  comm 
)

Initializes Damaris, should be called after MPI_Init.

Parameters
[in]configfile: name of the XML configuration file.
[in]comm: MPI communicator gathering all the nodes.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_parameter_get()

int damaris_parameter_get ( const char *  param_name,
void *  buffer,
unsigned int  size 
)

Get the current value of a parameter.

Parameters
[in]param_name: name of the parameter to read.
[out]buffer: buffer in which to put the value.
[in]size: maximum size (in bytes) in the buffer.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_parameter_set()

int damaris_parameter_set ( const char *  param_name,
const void *  buffer,
unsigned int  size 
)

Set the value of a parameter.

Parameters
[in]param_name: name of the parameter.
[in]buffer: buffer from which to take the value.
[in]size: size of the buffer.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_set_block_position()

int damaris_set_block_position ( const char *  var_name,
int32_t  block,
const int64_t *  position 
)

Changes the position of a block of the variable.

Parameters
[in]var_name: name of the variable to move.
[in]block: block id.
[in]position: array of new coordinates.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_set_position()

int damaris_set_position ( const char *  var_name,
const int64_t *  position 
)

Changes the position of the variable. Sets the meta-data that represents the start of position within the variable of which the block stores the data of. Equivalent to a call to damaris_set_block_position(var_name,0,position).

Parameters
[in]var_name: name of the variable to move.
[in]position: array of new coordinates.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ damaris_signal()

int damaris_signal ( const char *  signal_name)

Sends a signal to the closest dedicated core.

Parameters
[in]signal_name: name of the signal to send, must correspond to an event or a script in the configuration file.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_start()

int damaris_start ( int *  is_client)

Starts the server. Sets is_client to 1 if this core is a client. Otherwise, this function starts the server and blocks until clients call damaris_stop, and is_client is set to 0.

Parameters
[out]is_client: indicates if this core is a client.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_stop()

int damaris_stop ( void  )

Stops the server. This function should only be called by client processes and these processes must have called damaris_start to start the servers before. When all client processes have called damaris_stop, server processes blocked on damaris_start will return (with is_client set to 0).

Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_write()

int damaris_write ( const char *  varname,
const void *  data 
)

Writes a variable (similar to damaris_write_block(varnale,0,data)).

Parameters
[in]varname: name of the variable to write.
[in]data: pointer to the data to write.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:

◆ damaris_write_block()

int damaris_write_block ( const char *  varname,
int32_t  block,
const void *  data 
)

Writes a block of a variable. The variable name should be the full name of a variable defined in the configuration file. The block id should be between 0 and the number of domains per client - 1, as defined in the configuration file.

Parameters
[in]varname: name of the variable to write.
[in]block: id of the block to write.
[in]data: pointer to the data to write.
Returns
DAMARIS_OK on success, other error codes on failures.
Here is the call graph for this function:
Here is the caller graph for this function: