Fenix @develop
 
Loading...
Searching...
No Matches
Data Recovery

Functions for storing and restoring data in Fenix. More...

Macros

#define FENIX_DATA_GROUP_WORLD_ID   10
 
#define FENIX_GROUP_ID_MAX   11
 
#define FENIX_DATA_MEMBER_ALL   -1
 
#define FENIX_DATA_MEMBER_ATTRIBUTE_BUFFER   11
 
#define FENIX_DATA_MEMBER_ATTRIBUTE_COUNT   12
 
#define FENIX_DATA_MEMBER_ATTRIBUTE_DATATYPE   13
 
#define FENIX_DATA_MEMBER_ATTRIBUTE_SIZE   14
 
#define FENIX_DATA_SNAPSHOT_LATEST   -1
 
#define FENIX_DATA_SNAPSHOT_ALL   -2
 
#define FENIX_DATA_RESTORE_INPLACE   NULL
 
#define FENIX_DATA_RESTORE_FULL   INT_MAX
 
#define FENIX_RESIZEABLE   0
 
#define FENIX_DATA_SUBSET_CREATED   2
 
#define FENIX_STOREV_ALL   -1
 
#define FENIX_SERIALIZE   -2
 
#define FENIX_DESERIALIZE   -3
 
#define FENIX_DATA_POLICY_IN_MEMORY_RAID   13
 
#define FENIX_DATA_POLICY_IMR   FENIX_DATA_POLICY_IN_MEMORY_RAID
 
#define FENIX_DATA_POLICY_LOCAL   14
 
#define FENIX_TIME_STAMP_IGNORE   NULL
 

Typedefs

typedef void(* Fenix_Serialize_file_fn) (FILE *, int, void *, int, int, void *)
 Serializer function type for file-serializable data members.
 

Functions

int Fenix_Data_group_create (int group_id, MPI_Comm comm, int start_time_stamp, int depth, int policy_name, void *policy_value, int *flag)
 Create a Data Group.
 
int Fenix_Data_group_created (int group_id)
 Query if a data group exists on this rank.
 
int Fenix_Data_member_create (int group_id, int member_id, void *buffer, int count, MPI_Datatype datatype)
 Create a data member for store/restore operations.
 
int Fenix_Data_member_fcreate (int group_id, int member_id, void *buffer, int count, MPI_Datatype datatype, Fenix_Serialize_file_fn serializer, void *ctx)
 Create a data member to be (de)serialized with a file pointer.
 
int Fenix_Data_member_define (int group_id, int member_id, void *buffer, int count, MPI_Datatype datatype)
 Idempotent version of Fenix_Data_member_create.
 
int Fenix_Data_member_fdefine (int group_id, int member_id, void *buffer, int count, MPI_Datatype datatype, Fenix_Serialize_file_fn serializer, void *ctx)
 Idempotent version of Fenix_Data_member_fcreate.
 
int Fenix_Data_member_created (int group_id, int member_id)
 Query if a data member exists on this rank.
 
int Fenix_Data_group_get_redundancy_policy (int group_id, int *policy_name, void *policy_value, int *flag)
 Get the storage policy of a data group.
 
int Fenix_Data_wait (Fenix_Request request)
  UNIMPLEMENTED Block on completion of the store operation specified by the request.
 
int Fenix_Data_test (Fenix_Request request, int *flag)
  UNIMPLEMENTED Query completion of the store operation specified by the request.
 
int Fenix_Data_member_stage (int group_id, int member_id, const Fenix_Data_subset subset)
 Serialize a group member's data into the member's local store.
 
int Fenix_Data_member_stage_inplace (int group_id, int member_id, void *buf, const Fenix_Data_subset subset)
 As Fenix_Data_member_stage, but takes ownership of buf to possibly avoid a copy.
 
int Fenix_Data_member_stage_begin (int group_id, int member_id, FILE **fpp)
 Open a file for manually staging a member into.
 
int Fenix_Data_member_stage_end (int group_id, int member_id)
 Concludes a Fenix_Data_member_stage_begin.
 
int Fenix_Data_member_store (int group_id, int member_id, const Fenix_Data_subset subset)
 Store a particular group member into the group's resilient storage space, in uncommitted storage.
 
int Fenix_Data_member_storev (int group_id, int member_id, const Fenix_Data_subset subset)
  UNIMPLEMENTED As [store](Fenix_Data_member_store), but subsets may vary rank-to-rank.
 
int Fenix_Data_member_istore (int group_id, int member_id, const Fenix_Data_subset subset, Fenix_Request *request)
  UNIMPLEMENTED As [store](Fenix_Data_member_store), but asynchronous.
 
int Fenix_Data_member_istorev (int group_id, int member_id, const Fenix_Data_subset subset, Fenix_Request *request)
  UNIMPLEMENTED As [istore](Fenix_Data_member_istore), but asynchronous.
 
int Fenix_Data_commit (int group_id, int *time_stamp)
 Commit stored data members to the group's next snapshot.
 
int Fenix_Data_commit_barrier (int group_id, int *time_stamp)
 As commit, but ensures a globally consistent commit.
 
int Fenix_Data_checkpoint (int group_id, const Fenix_Data_subset subset, int num_storev, int *storev_ids, int *time_stamp)
 Store all members of a group and then commit that group.
 
int Fenix_Data_member_repair (int group_id, int member_id)
 Repair the resilient storage of committed data for this member.
 
int Fenix_Data_member_load (int group_id, int member_id, int time_stamp, Fenix_Data_subset *found_data)
 Load this member's committed data into user's data.
 
int Fenix_Data_member_load_to (int group_id, int member_id, void *target, int target_count, int time_stamp, Fenix_Data_subset *found_data)
 As Fenix_Data_member_load, but with a custom load destination.
 
int Fenix_data_member_load_begin (int group_id, int member_id, FILE **fpp, int time_stamp, Fenix_Data_subset *found_data)
 Get a file to read this member's committed data from.
 
int Fenix_Data_member_load_end (int group_id, int member_id)
 Concludes a #Fenix_Data_member_load_begin.
 
int Fenix_Data_member_restore (int group_id, int member_id, void *target_buffer, int max_count, int time_stamp, Fenix_Data_subset *found_data)
 Repair and load a member.
 
int Fenix_Data_member_lrestore (int group_id, int member_id, void *target_buffer, int max_count, int time_stamp, Fenix_Data_subset *found_data)
 Local-only version of Fenix_Data_member_restore.
 
int Fenix_Data_member_restore_from_rank (int group_id, int member_id, void *data, int max_count, int time_stamp, Fenix_Data_subset *found_data, int source_rank)
  UNIMPLEMENTED As Fenix_Data_member_restore, but restores from a specific rank's data.
 
int Fenix_Data_subset_create (int num_blocks, int start_offset, int end_offset, int stride, Fenix_Data_subset *subset)
 Create a data subset for use in store operations.
 
int Fenix_Data_subset_createv (int num_blocks, int *array_start_offsets, int *array_end_offsets, Fenix_Data_subset *subset)
 As Fenix_Data_subset_create, but with varying start and end offsets.
 
int Fenix_Data_subset_delete (Fenix_Data_subset *subset)
 Delete a data subset.
 
int Fenix_Data_group_get_number_of_members (int group_id, int *number_of_members)
 Get the number of members in a data group.
 
int Fenix_Data_group_get_member_at_position (int group_id, int *member_id, int position)
 Get member ID based on member index.
 
int Fenix_Data_group_get_number_of_snapshots (int group_id, int *number_of_snapshots)
 Get the number of locally-available snapshots in a data group.
 
int Fenix_Data_group_get_snapshot_at_position (int group_id, int position, int *time_stamp)
 Get the time stamp of a snapshot at a given index.
 
int Fenix_Data_group_get_cohort (int group_id, MPI_Group *cohort)
 Get the cohort (redundancy partner group) for a data group.
 
int Fenix_Data_member_attr_get (int group_id, int member_id, int attributename, void *attributevalue, int *flag)
  UNIMPLEMENTED Get the value of a member's attribute.
 
int Fenix_Data_member_attr_set (int group_id, int member_id, int attribute_name, void *attribute_value, int *flag)
 Set the value of a member's attribute.
 
int Fenix_Data_snapshot_delete (int group_id, int time_stamp)
 Delete a snapshot from a data group.
 
int Fenix_Data_group_delete (int group_id)
 Delete a data group.
 
int Fenix_Data_member_delete (int group_id, int member_id)
 Delete a data member.
 

Variables

const Fenix_Data_subset FENIX_DATA_SUBSET_FULL
 A standin for checkpointing/recovering the full member's data.
 
const Fenix_Data_subset FENIX_DATA_SUBSET_EMPTY
 A standin for checkpointing/recovering no data.
 
const Fenix_Data_subset FENIX_DATA_SUBSET_PRESTAGED
 A standin for checkpointing/recovering all of pre-staged data.
 
Fenix_Data_subsetFENIX_DATA_SUBSET_IGNORE
 

Overview

Functions for storing and restoring data in Fenix.

Fenix provides options for redundant storage of application data to facilitate application data recovery in a transparent manner. Fenix contains functions to control consistency of collections of such data, as well as their level of persistence. Functions with the prefix Fenix_Data_ perform store, versioning, restore, and other relevant operations and form the Fenix data recovery API. The user can select a specific set of application data, identified by its location in memory, label it using Fenix_Data_member_create, and copy it into Fenix's redundant storage space through Fenix_Data_member(i)store(v) at a point in time. Subsequently, Fenix_Data_commit finalizes all preceding Fenix store operations involving this data group and assigns a unique time stamp to the resulting data snapshot, marking the data as potentially recoverable after a loss of ranks. Individual pieces of data can then be restored whenever they are needed with Fenix_Data_member_restore, for example after a failure occurs. We note that Fenix's data storage and recovery facility aims primarily to support in-memory recovery.

Populating redundant data storage using Fenix may involve the dispersion of data created by one rank to other ranks within the system, making the store operation semantically a collective operation. However, Fenix does not require store operations to be globally synchronizing. For example, execution of Fenix_Data_member_store for a particular collection of data could potentially be finished in some ranks, but not yet in others. And if certain ranks nominally participating in the storage operations have no actual data movement responsibility, Fenix is allowerd to let them exit the operation immediately. Consequently, Fenix data storage functions should not be used for synchronization purposes.

Multiple distinct pieces (members) of data assigned to Fenix-managed redundant storage, can be associated with a specific instance of a Fenix data group to form a semantic unit. Committing such a group ensures that the data involved is available for recovery.


Data Groups

A Fenix data group provides dual functionality. First, it serves as a container for a set of data objects (members) that are committed together, and hence provides transaction semantics. Second, it recognizes that Fenix_Data_member_store is an operation carried out collectively by a group of ranks, but not necessarily by all active ranks in the MPI environment. Hence, it adopts the convenient MPI vehicle of communicators to indicate the subset of ranks involved. Data groups are composed of members that describe the actual application data and the redundancy policy to be used for securely storing the members.

Data groups can and should be recreated after each failure (i.e. do not conditionally skip the creation after initialization).

See Fenix_Data_group_create for creating a data group.


Data Redundancy Policies

Fenix internally uses an extensible system for defining data policies to keep the door open to easily adding new data policies and configuring them on a per-data-group basis. We currently support a single, configurable, memory-based policy.

In Memory Redundancy Policy (IMR)

IMR is referenced with the FENIX_DATA_POLICY_IN_MEMORY_RAID definition, and takes as input an array of integers with the following usage:

The policy is designed to localize recovery as much as possible. Communication amongst group members is required (as failure during recovery operations can lead to inconsistent beliefs about which ranks have recovered data), but groups without recovering ranks may then all recover locally rather than communicating further. Groups need not wait for ranks outside of their group to enter or exit recovery.

These options enable users to trade reliability and computation for memory space, which may be necessary for applications with large memory usage.

Typedef Documentation

◆ Fenix_Serialize_file_fn

typedef void(* Fenix_Serialize_file_fn) (FILE *, int, void *, int, int, void *)

Serializer function type for file-serializable data members.

Arguments are: FILE* fp: memory-backed file pointer to (de)serialize into int direction: one of FENIX_SERIALIZE or FENIX_DESERIALIZE void* buf: pointer to user buffer int offset: first index to be (de)serialized int count: number of entries to (de)serialize, or FENIX_RESIZEABLE void* context: pointer to user-defined context

Fenix will invoke this function to (de)serialize the data of a member. Will be invoked once per contiguous data region to be (de)serialized.

When direction=FENIX_SERIALIZE, fp is write-only and buf is the data member's buffer (as FENIX_DATA_MEMBER_ATTRIBUTE_BUFFER). Function should write data values [offset, offset+count) directly into fp. Will be invoked with offset=0 and count=FENIX_RESIZEABLE if staging FENIX_DATA_SUBSET_FULL of a member of size FENIX_RESIZEABLE, which indicates that all data should be serialized.

When direction=FENIX_DESERIALIZE, fp is read-only and buf is the target buffer of the restore or lrestore operation being completed. Function should read data values [offset, offset+count) directly from fp.

The user should not manipulate the file's position indicator in any way other than directly writing/reading to/from the file.

Function Documentation

◆ Fenix_Data_checkpoint()

int Fenix_Data_checkpoint ( int group_id,
const Fenix_Data_subset subset,
int num_storev,
int * storev_ids,
int * time_stamp )
collective

Store all members of a group and then commit that group.

Stores each member in order of their creation in the group. Equivalent to invoking Fenix_Data_member_store with the specified subset. If a member's id is listed in storev_ids, this is instead equivalent to invoking Fenix_Data_member_storev.

After storing, equivalent to invoking Fenix_Data_commit.

This function supports inline recovery when it is active (see Fenix_Mlog_activate).

Parameters
[in]group_idThe group to checkpoint
[in]subsetThe subset of each member to store.
[in]num_storevThe size of the storev_ids array, or FENIX_STOREV_ALL.
[in]storev_idsArray of member ids to store as storev. May be null if num_storev is zero or FENIX_STOREV_ALL.
[out]time_stampPointer to store the time stamp of the commit to, or FENIX_TIME_STAMP_IGNORE.

◆ Fenix_Data_commit()

int Fenix_Data_commit ( int group_id,
int * time_stamp )
collectivelocal

Commit stored data members to the group's next snapshot.

This function is used to freeze the current state of a data group, together with all its application data that has been stored in Fenix’ redundant storage, and label it with a time stamp, thus creating a snapshot of the stored application data. Only data that has been committed is eligible for recovery through Fenix_Data_member_restore. An application needs to call Fenix_Data_wait for all pending asynchronous Fenix_Data_member_istore(v) operations in the group before committing.

Parameters
[in]group_idThe group to commit
[out]time_stampThe time stamp of the new snapshot
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_commit_barrier()

int Fenix_Data_commit_barrier ( int group_id,
int * time_stamp )
collective

As commit, but ensures a globally consistent commit.

This function does not function as a traditional barrier. The commit will proceed if all non-failed ranks reach the barrier. This allows for commits to be made when a rank fails after storing all of its data into resilient storage.

Parameters
[in]group_idThe group to commit
[out]time_stampThe time stamp of the new snapshot
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_group_create()

int Fenix_Data_group_create ( int group_id,
MPI_Comm comm,
int start_time_stamp,
int depth,
int policy_name,
void * policy_value,
int * flag )
collective

Create a Data Group.

If a group with this group_id was already created in the past and has not been deleted, the parameters of this call are ignored and this function simply serves to coordinate with any ranks that have not yet created this group (e.g. due to a failure).

All calling ranks must pass the same values for the parameters group_id, comm, start_time_stamp, policy_name, and policy_value.

Parameters
group_idA unique identifier to this group.
commA resilient communicator on which the group is formed.
start_time_stampThe time_stamp to be used for the first commit in this group.
depth

The number of successive snapshots of this group that are retained by Fenix, in addition to the most recent one, and that can be recovered by calling Fenix data member restore functions.

For example, a depth of 0 means Fenix will keep only the necessary data to restore the most recent snapshot, freeing or overwriting older snapshots automatically. A depth of -1 is currently not supported, but would ordinarily indicate that no snapshots should be removed automatically.

policy_nameCurrently, may only be FENIX_DATA_POLICY_IN_MEMORY_RAID
policy_valuePointer to data passed along to the policy. See the specific policy for more information.
flagpointer to store policy-specific status or errors
Returns
FENIX_SUCCESS, or an error value.

◆ Fenix_Data_group_created()

int Fenix_Data_group_created ( int group_id)
local

Query if a data group exists on this rank.

Parameters
group_idGroup identifier
Returns
A truthy value if the group exists

◆ Fenix_Data_group_delete()

int Fenix_Data_group_delete ( int group_id)
local

Delete a data group.

Parameters
[in]group_idThe group to delete
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_group_get_cohort()

int Fenix_Data_group_get_cohort ( int group_id,
MPI_Group * cohort )

Get the cohort (redundancy partner group) for a data group.

The cohort is the set of ranks that participate in backing up each other's data for this group. It includes the calling rank and all partner ranks. For local-only policies with no redundancy, the cohort contains only the calling rank.

The returned group is a duplicate and must be freed by the caller with MPI_Group_free when no longer needed.

Parameters
[in]group_idThe group to query
[out]cohortThe cohort group (never MPI_GROUP_NULL)
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_group_get_member_at_position()

int Fenix_Data_group_get_member_at_position ( int group_id,
int * member_id,
int position )

Get member ID based on member index.

See Fenix_Data_group_get_number_of_members

Parameters
[in]group_idThe group to query
[out]member_idThe member id at this index in the group
[in]positionThe position to check, [0, number_of_members)

◆ Fenix_Data_group_get_number_of_members()

int Fenix_Data_group_get_number_of_members ( int group_id,
int * number_of_members )

Get the number of members in a data group.

Parameters
[in]group_idThe group to query
[out]number_of_membersNumber of members in the group

◆ Fenix_Data_group_get_number_of_snapshots()

int Fenix_Data_group_get_number_of_snapshots ( int group_id,
int * number_of_snapshots )

Get the number of locally-available snapshots in a data group.

May include snapshots that are inconsistent across the group.

Parameters
[in]group_idThe group to query
[out]number_of_snapshotsThe number of snapshots in the group
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_group_get_redundancy_policy()

int Fenix_Data_group_get_redundancy_policy ( int group_id,
int * policy_name,
void * policy_value,
int * flag )

Get the storage policy of a data group.

Parameters
group_idIdentified to the data group to query
policy_nameThe identifier of the policy name of the data group.
policy_valueA location within which to store the policy_values this group's policy was configured with.
flagA location set to true if a policy value was extracted, else false.
Returns
FENIX_SUCCESS, or an error value.

◆ Fenix_Data_group_get_snapshot_at_position()

int Fenix_Data_group_get_snapshot_at_position ( int group_id,
int position,
int * time_stamp )

Get the time stamp of a snapshot at a given index.

Snapshots are indexed in reverse order in which the user committed them (e.g. the most recent available snapshot has position=0).

Parameters
[in]group_idThe group to query
[in]positionThe index of the snapshot, which must be [0, number_of_snapshots)
[out]time_stampThe time stamp of the snapshot

◆ Fenix_Data_member_attr_set()

int Fenix_Data_member_attr_set ( int group_id,
int member_id,
int attribute_name,
void * attribute_value,
int * flag )

Set the value of a member's attribute.

Valid names are FENIX_DATA_MEMBER_ATTRIBUTE_BUFFER, FENIX_DATA_MEMBER_ATTRIBUTE_COUNT, and FENIX_DATA_MEMBER_ATTRIBUTE_DATATYPE.

The COUNT and DATATYPE attributes may only be set before the first store operation. Contrary to the Fenix specification, returning to Fenix_Init after a failure does not allow the user to set these attributes again.

Parameters
[in]group_idThe group to update
[in]member_idThe member to update
[in]attribute_nameThe attribute to update
[in]attribute_valueThe new value of the attribute
[out]flagSet to true if the attribute was set, else false
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_create()

int Fenix_Data_member_create ( int group_id,
int member_id,
void * buffer,
int count,
MPI_Datatype datatype )
collectivelocal

Create a data member for store/restore operations.

All calling ranks in the group's communicator must pass the same values for the parameters member_id, datatype, group_id, and count.

Parameters
group_idIdentifier to a data group within which to create the member.
member_idAn integer unique within the data group that identifies the data in source_buffer. Must be nonnegative and less than FENIX_MEMBER_ID_MAX, which is guaranteed to be at least 2^30.
bufferAddress of the data to be copied to redundant storage maintained by Fenix. Note that this parameter may also be specified using Fenix_Data_member_attr_set, which is critical for non-survivor ranks after a failure which will have an invalid address which was generated on the failed rank and must update.
countThe maximum number of contiguous elements of type datatype of the data to be stored. A value of FENIX_RESIZEABLE allows this member to have a varying data size.
datatypeThe MPI_Datatype of the elements in source_buffer
Returns
FENIX_SUCCESS, or an error value.

◆ Fenix_Data_member_created()

int Fenix_Data_member_created ( int group_id,
int member_id )
local

Query if a data member exists on this rank.

Parameters
group_idGroup identifier
member_idMember identifier
Returns
A truthy value if the member exists

◆ Fenix_Data_member_define()

int Fenix_Data_member_define ( int group_id,
int member_id,
void * buffer,
int count,
MPI_Datatype datatype )

Idempotent version of Fenix_Data_member_create.

If this member does not exist, behaves as Fenix_Data_member_create. If this member does exist, updates its attributes (with the same restrictions as Fenix_Data_member_attr_set).

◆ Fenix_Data_member_delete()

int Fenix_Data_member_delete ( int group_id,
int member_id )
local

Delete a data member.

Parameters
[in]group_idThe group to delete from
[in]member_idThe member to delete
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_fdefine()

int Fenix_Data_member_fdefine ( int group_id,
int member_id,
void * buffer,
int count,
MPI_Datatype datatype,
Fenix_Serialize_file_fn serializer,
void * ctx )

Idempotent version of Fenix_Data_member_fcreate.

If this member does not exist, behaves as Fenix_Data_member_fcreate. If this member does exist, updates its attributes (with the same restrictions as Fenix_Data_member_attr_set) and its serializer function. Note that providing a nullptr for serializer will remove any existing serializer.

◆ Fenix_Data_member_load()

int Fenix_Data_member_load ( int group_id,
int member_id,
int time_stamp,
Fenix_Data_subset * found_data )
local

Load this member's committed data into user's data.

Attempts to load up to ATTRIBUTE_COUNT elements into ATTRIBUTE_BUFFER.

For members without a serializer, data is loaded by directly copying memory. Otherwise, data is loaded by calls to this member's serializer.

If time stamp is FENIX_DATA_SNAPSHOT_ALL, this function attempts to load elements [0, MEMBER_ATTRIBUTE_COUNT-1] by loading each element from the most recent available snapshot the individual element was committed in.

If a snapshot at the specified time stamp is not locally available, raises FENIX_ERROR_NODATA_FOUND. If any elements from [0, MEMBER_ATTRIBUTE_COUNT-1] were not loaded from the snapshot(s), returns FENIX_WARNING_PARTIAL_RESTORE.

User is responsible for freeing the subset returned in found_data, unless found_data is FENIX_DATA_SUBSET_IGNORE (in which case no subset is returned).

Parameters
[in]group_idThe group of the member to load
[in]member_idThe member to load
[in]time_stampTime stamp of the snapshot to load
[in,out]found_dataSubset of the elements successfully loaded
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_data_member_load_begin()

int Fenix_data_member_load_begin ( int group_id,
int member_id,
FILE ** fpp,
int time_stamp,
Fenix_Data_subset * found_data )
local

Get a file to read this member's committed data from.

As Fenix_Data_member_load, but opens a file to read data from instead of directly loading the data.

It is an error to call any staging, storing, loading, or restoring function involving this member before a corresponding call to Fenix_Data_member_load_end. Returned file is read-only and must not be closed by the user. The value of any data outside the found_data subset is undefined.

Note that time_stamp must not be FENIX_DATA_SNAPSHOT_ALL.

Parameters
[in]group_idThe group of the member to load
[in]member_idThe member to load
[out]fppOutput location for the file pointer to be written to
[in]time_stampTime stamp of the snapshot to load
[in,out]found_dataSubset of the elements successfully loaded
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_load_end()

int Fenix_Data_member_load_end ( int group_id,
int member_id )
local

Concludes a #Fenix_Data_member_load_begin.

Throws (or returns) FENIX_ERROR_INVALID_LOGIC_CALL if there has not been a corresponding #Fenix_Data_member_load_begin.

Parameters
group_idGroup of the member to end loading for
member_idMember to end loading for
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_load_to()

int Fenix_Data_member_load_to ( int group_id,
int member_id,
void * target,
int target_count,
int time_stamp,
Fenix_Data_subset * found_data )
local

As Fenix_Data_member_load, but with a custom load destination.

Attempts to load up to target_count elements into target. Otherwise behaves as Fenix_Data_member_load.

If target_count is FENIX_DATA_RESTORE_FULL, assumes buffer has space to load all available elements.

Parameters
[in]group_idThe group of the member to load
[in]member_idThe member to load
[in,out]targetThe custom load destination
[in]target_countThe number of elements to attempt to load
[in]time_stampTime stamp of the snapshot to load
[in,out]found_dataSubset of the elements successfully loaded
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_lrestore()

int Fenix_Data_member_lrestore ( int group_id,
int member_id,
void * target_buffer,
int max_count,
int time_stamp,
Fenix_Data_subset * found_data )
deprecated

Local-only version of Fenix_Data_member_restore.

DEPRECATED: Use member_load functions instead.

This function restores the data of a group member from the local snapshot.

Parameters
[in]group_idThe group to restore from
[in]member_idThe member to restore
[out]target_bufferThe buffer to store the restored data
[in]max_countThe maximum number of elements to restore
[in]time_stampThe time stamp of the snapshot to restore from
[out]found_dataThe subset of the data that was found in the snapshot
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_repair()

int Fenix_Data_member_repair ( int group_id,
int member_id )
collective

Repair the resilient storage of committed data for this member.

All ranks in this group must call with the same group_id and member_id. May also be matched by a call to Fenix_Data_member_restore.

Member does not have to exist locally. If member does not exist locally, this function is equivalent to calling Fenix_Data_member_create with a null buffer before this function's normal behavior. If the group's policy is unable to rebuild this member (i.e., in the case of an unrecoverable failure pattern), raises FENIX_ERROR_NODATA_FOUND.

Note that this may not raise any error if the member exists but its committed data is unable to be restored. This may present as if the member simply never committed any data.

Behavior is currently undefined if this group's comm has a different size than it had when it committed any of the group's snapshots.

Parameters
[in]group_idThe group of the member to repair
[in]member_idThe member to repair
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_restore()

int Fenix_Data_member_restore ( int group_id,
int member_id,
void * target_buffer,
int max_count,
int time_stamp,
Fenix_Data_subset * found_data )
collective

Repair and load a member.

Consolidating function to take the following steps:

  1. Repair the member
  2. If the member did not exist already, set the member's buffer to target_buffer (or NULL if target_buffer is FENIX_DATA_RESTORE_INPLACE)
  3. Load max_count elements to target_buffer (or member's buffer if target_buffer is FENIX_DATA_RESTORE_INPLACE).

This function is collective amongst the ranks of this member's group, but it may be matched remotely by Fenix_Data_member_repair.

Parameters
[in]group_idThe group to restore from
[in]member_idThe member to restore
[out]target_bufferThe buffer to load to
[in]max_countThe maximum number of elements to load
[in]time_stampThe time stamp of the snapshot to load
[in,out]found_dataSubset of the elements successfully loaded
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_stage()

int Fenix_Data_member_stage ( int group_id,
int member_id,
const Fenix_Data_subset subset )
local

Serialize a group member's data into the member's local store.

A store operation can broken into two parts: locally staging the data within Fenix, then policy-specific operations to make the data resilient to faults. This function performs ONLY the first part. Applications should subsequently make a store of this member to the FENIX_DATA_SUBSET_PRESTAGED data subset.

It is undefined behaviour to commit staged-but-not-stored data.

Parameters
group_idGroup of the member to stage to
member_idMember to stage to
subsetWhich subset of the data to stage. FENIX_DATA_SUBSET_ALL is invalid if member size is FENIX_RESIZEABLE. FENIX_DATA_SUBSET_PRESTAGED is invalid.
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_stage_begin()

int Fenix_Data_member_stage_begin ( int group_id,
int member_id,
FILE ** fpp )
local

Open a file for manually staging a member into.

It is an error to call any staging, storing, loading, or restoring function involving this member before a corresponding call to Fenix_Data_member_stage_end.

Parameters
group_idGroup of the member to stage to
member_idMember to stage to
fppOutput location for the file pointer to be written to. File must not be closed by the user. It is an error to use this file after the corresponding Fenix_Data_member_stage_end.
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_stage_end()

int Fenix_Data_member_stage_end ( int group_id,
int member_id )
local

Concludes a Fenix_Data_member_stage_begin.

This function is equivalent to performing a Fenix_Data_member_stage_inplace with buf pointing to the written data and a subset of FENIX_DATA_SUBSET_FULL. For resizable members, the subset is instead of the range [0, staging_file_size/element_size] and it is an error if the staging file's size is not divisible by the element size.

Throws (or returns) FENIX_ERROR_INVALID_LOGIC_CALL if there has not been a corresponding Fenix_Data_member_stage_begin.

Parameters
group_idGroup of the member to end staging for
member_idMember to end staging for
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_stage_inplace()

int Fenix_Data_member_stage_inplace ( int group_id,
int member_id,
void * buf,
const Fenix_Data_subset subset )
local

As Fenix_Data_member_stage, but takes ownership of buf to possibly avoid a copy.

Fenix takes this buf as the new location to stage all data to. Any prior staged but uncommitted data is lost. Even if subset is not contiguous or begins after 0, buf must contain all elements from 0 to the maximum of (member's count, subset's end). Elements not belonging to the subset may be written to with subsequent calls to Fenix_Data_member_stage.

There is no guarantee that the pointer to buf will remain valid after this call. Fenix may overwrite, reallocate, or free this buffer at any time, including before returning from this function.

Parameters
group_idGroup of the member to stage to
member_idMember to stage to
bufThe data buffer which Fenix will take ownership of
subsetWhich subset of the data to stage. See Fenix_Data_member_stage
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_member_store()

int Fenix_Data_member_store ( int group_id,
int member_id,
const Fenix_Data_subset subset )
collective

Store a particular group member into the group's resilient storage space, in uncommitted storage.

The user can safely modify the member's data buffer after this call, as the current state is copied immediately. Multiple calls may be used to incrementally store data (using subsets), or overwrite old data prior to a commit.

Parameters
group_idAll ranks must provide the same group_id
member_idAll ranks must provide the same member_id
subsetWhich subset of the data to store. If this member was created with size FENIX_RESIZEABLE, FENIX_DATA_SUBSET_ALL is an invalid input.
Returns
FENIX_SUCCESS, or an error value.

◆ Fenix_Data_snapshot_delete()

int Fenix_Data_snapshot_delete ( int group_id,
int time_stamp )
local

Delete a snapshot from a data group.

Parameters
[in]group_idThe group to delete from
[in]time_stampThe time stamp of the snapshot to delete
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_subset_create()

int Fenix_Data_subset_create ( int num_blocks,
int start_offset,
int end_offset,
int stride,
Fenix_Data_subset * subset )

Create a data subset for use in store operations.

Creates a subset based on num_blocks pairs of {start_offset,end_offset}, {start_offset+stride,end_offset+stride}, {start_offset+2*stride,end_offset+2*stride}, etc.

The value of start_offset must be smaller than or equal to the value of end_offset to indicate non-negative block size. Otherwise, the function returns an error code.

Created subsets must be deleted with Fenix_Data_subset_delete to free memory.

Parameters
[in]num_blocksThe number of contiguous data blocks.
[in]start_offsetThe index of the first element in the first data block.
[in]end_offsetThe index of the last element in the first data block.
[in]strideRegular shift between successive data blocks.
[out]subsetThe created subset.
Returns
FENIX_SUCCESS if successful, any return code otherwise.

◆ Fenix_Data_subset_createv()

int Fenix_Data_subset_createv ( int num_blocks,
int * array_start_offsets,
int * array_end_offsets,
Fenix_Data_subset * subset )

As Fenix_Data_subset_create, but with varying start and end offsets.

Creates a subset based on num_blocks pairs of {start_offset,end_offset}. The value of start_offset must be smaller than or equal to end_offset to indicate non-negative block size. Otherwise, the function returns an error code.

Created subsets must be deleted with Fenix_Data_subset_delete to free memory.

Parameters
[in]num_blocksThe number of contiguous data blocks.
[in]array_start_offsetsThe index of the first element in each data block.
[in]array_end_offsetsThe index of the last element in each data block.
[out]subsetThe created subset.

◆ Fenix_Data_subset_delete()

int Fenix_Data_subset_delete ( Fenix_Data_subset * subset)

Delete a data subset.

Frees the memory associated with a data subset object.

Parameters
[in]subsetThe subset to delete.
Returns
FENIX_SUCCESS if successful, any return code otherwise.