ESDM
Middleware for Earth System Data
Macros | Functions
esdm.c File Reference

Entry point for ESDM API Implementation. More...

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <esdm-internal.h>
Include dependency graph for esdm.c:

Macros

#define ESDM_INSTANCE_INITIALIZERS
 

Functions

esdm_instance_tesdmI_esdm ()
 
esdm_status esdm_set_procs_per_node (int procs)
 
esdm_status esdm_set_total_procs (int procs)
 
esdm_status esdm_load_config_str (const char *str)
 
esdm_status esdm_dataset_get_dataspace (esdm_dataset_t *dset, esdm_dataspace_t **out_dataspace)
 
int esdm_is_initialized ()
 
esdm_status esdm_init ()
 
esdm_modules_tesdm_get_modules ()
 
esdm_status esdm_mkfs (int format_flags, data_accessibility_t target)
 
esdm_status esdm_finalize ()
 
esdm_status esdm_write (esdm_dataset_t *dataset, void *buf, esdm_dataspace_t *space)
 
esdm_status esdmI_readWithFillRegion (esdm_dataset_t *dataset, void *buf, esdm_dataspace_t *space, esdmI_hypercubeSet_t **out_fillRegion)
 
esdm_status esdm_read (esdm_dataset_t *dataset, void *buf, esdm_dataspace_t *space)
 
esdm_status esdm_sync ()
 
int esdm_container_get_mode_flags (esdm_container_t *c)
 
esdm_status esdm_dataset_set_fill_value (esdm_dataset_t *d, void const *value)
 
int esdm_dataset_is_fill_value_set (esdm_dataset_t *d)
 
esdm_status esdm_dataset_get_fill_value (esdm_dataset_t *d, void *value)
 
esdm_status esdm_dataset_change_name (esdm_dataset_t *d, char const *new_name)
 
esdm_status esdm_read_stream (esdm_dataset_t *d, esdm_dataspace_t *space, void *user_ptr, esdm_stream_func_t stream_func, esdm_reduce_func_t reduce_func)
 
esdm_statistics_t esdm_read_stats ()
 
esdm_statistics_t esdm_write_stats ()
 
esdm_config_tesdmI_getConfig ()
 

Detailed Description

Entry point for ESDM API Implementation.

Macro Definition Documentation

◆ ESDM_INSTANCE_INITIALIZERS

#define ESDM_INSTANCE_INITIALIZERS
Value:
.procs_per_node = 1,\
.total_procs = 1,\
.config = NULL

Function Documentation

◆ esdm_dataset_get_dataspace()

esdm_status esdm_dataset_get_dataspace ( esdm_dataset_t dset,
esdm_dataspace_t **  out_dataspace 
)

Inquire the shape of a dataset.

Parameters
[in]dsetthe dataset to question
[out]out_dataspacea reference to the dataset's dataspace
Returns
status

The dataset remains the owner of the dataspace, the caller must not destroy it.

◆ esdm_finalize()

esdm_status esdm_finalize ( )

Display status information for objects stored in ESDM.

Returns
status

◆ esdm_init()

esdm_status esdm_init ( )

Initialize ESDM:

  • allocate data structures for ESDM
  • allocate memory for node local caches
  • initialize submodules
  • initialize threadpool
Returns
status

◆ esdm_load_config_str()

esdm_status esdm_load_config_str ( const char *  str)

Set the configuration to use. Must not be called after init(), and must not be called twice.

Parameters
[in]stra string containing configuration data in JSON format
Returns
status

◆ esdm_read()

esdm_status esdm_read ( esdm_dataset_t dataset,
void *  buf,
esdm_dataspace_t subspace 
)

Identical to esdm_write except that it uses size/offset tuples instead of the subspace Reads a data fragment described by desc to the dataset dset.

Parameters
[in]datasetTODO, currently a stub, we assume it has been identified/created before.... , json description?
[out]bufa contiguous memory region that shall be filled with the data from permanent storage
[in]subspacean existing dataspace that describes the shape and location of the hypercube that is to be read
Returns
status

◆ esdm_read_stats()

esdm_statistics_t esdm_read_stats ( )

Get some statistics about the reads that have been performed.

◆ esdm_set_procs_per_node()

esdm_status esdm_set_procs_per_node ( int  procs)

Set the number of processes to use per node. Must not be called after init().

Parameters
[in]procsthe number of processes to use per node
Returns
status

◆ esdm_set_total_procs()

esdm_status esdm_set_total_procs ( int  procs)

Set the total number of processes to use. Must not be called after init().

Parameters
[in]procsthe number of processes to use
Returns
status

◆ esdm_write()

esdm_status esdm_write ( esdm_dataset_t dataset,
void *  buf,
esdm_dataspace_t subspace 
)

Write data with a given size and offset.

Parameters
[in]datasetTODO, currently a stub, we assume it has been identified/created before...., json description?
[in]bufthe pointer to a contiguous memory region that shall be written to permanent storage
[in]subspacean existing dataspace that describes the shape and location of the hypercube that is to be written
Returns
status

◆ esdm_write_stats()

esdm_statistics_t esdm_write_stats ( )

Get some statistics about the writes that have been performed.

◆ esdmI_readWithFillRegion()

esdm_status esdmI_readWithFillRegion ( esdm_dataset_t dataset,
void *  buf,
esdm_dataspace_t memspace,
esdmI_hypercubeSet_t **  out_fillRegion 
)

As esdm_read(), but also return the region that was filled with the fill value as a hypercube set. If no fill value is set and any region without data is detected, this call will still return an error.

Parameters
[in]datasetTODO, currently a stub, we assume it has been identified/created before.... , json description?
[out]bufa contiguous memory region that shall be filled with the data from permanent storage
[in]memspacea dataspace that describes the location, size, and memory layout of the part of the data that is to be read
[out]out_fillRegionreturns a new esdmI_hypercubeSet_t* that covers the region for which no data was found.
Returns
status