Fenix @develop
 
Loading...
Searching...
No Matches
fenix_data_group.hpp
1/*
2//@HEADER
3// ************************************************************************
4//
5//
6// _|_|_|_| _|_|_|_| _| _| _|_|_| _| _|
7// _| _| _|_| _| _| _| _|
8// _|_|_| _|_|_| _| _| _| _| _|
9// _| _| _| _|_| _| _| _|
10// _| _|_|_|_| _| _| _|_|_| _| _|
11//
12//
13//
14//
15// Copyright (C) 2016 Rutgers University and Sandia Corporation
16//
17// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18// the U.S. Government retains certain rights in this software.
19//
20// Redistribution and use in source and binary forms, with or without
21// modification, are permitted provided that the following conditions are
22// met:
23//
24// 1. Redistributions of source code must retain the above copyright
25// notice, this list of conditions and the following disclaimer.
26//
27// 2. Redistributions in binary form must reproduce the above copyright
28// notice, this list of conditions and the following disclaimer in the
29// documentation and/or other materials provided with the distribution.
30//
31// 3. Neither the name of the Corporation nor the names of the
32// contributors may be used to endorse or promote products derived from
33// this software without specific prior written permission.
34//
35// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
36// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
39// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46//
47// Author Marc Gamell, Eric Valenzuela, Keita Teranishi, Manish Parashar,
48// Michael Heroux, and Matthew Whitlock
49//
50// Questions? Contact Keita Teranishi (knteran@sandia.gov) and
51// Marc Gamell (mgamell@cac.rutgers.edu)
52//
53// ************************************************************************
54//@HEADER
55*/
56#ifndef __FENIX_DATA_GROUP_H__
57#define __FENIX_DATA_GROUP_H__
58
59#include <vector>
60
61#include <mpi.h>
62#include "fenix.h"
63#include "fenix_data_member.hpp"
64#include "fenix_data_packet.hpp"
65#include "fenix_util.hpp"
66#include "fenix_data_subset.h"
67
68#define __FENIX_DEFAULT_GROUP_SIZE 32
69
71typedef struct __fenix_group fenix_group_t;
72
73
74//This defines the functions which must be implemented by the group
75typedef struct __fenix_group_vtbl {
76 int (*group_delete)(fenix_group_t* group);
77
78 int (*member_create)(fenix_group_t* group, fenix_member_entry_t* mentry);
79
80 int (*member_delete)(fenix_group_t* group, int member_id);
81
82 int (*get_redundant_policy)(fenix_group_t*, int* policy_name,
83 void* policy_value, int* flag);
84
85 int (*member_store)(fenix_group_t* group, int member_id,
86 Fenix_Data_subset subset_specifier);
87
88 int (*member_storev)(fenix_group_t* group, int member_id,
89 Fenix_Data_subset subset_specifier);
90
91 int (*member_istore)(fenix_group_t* group, int member_id,
92 Fenix_Data_subset subset_specifier, Fenix_Request *request);
93
94 int (*member_istorev)(fenix_group_t* group, int member_id,
95 Fenix_Data_subset subset_specifier, Fenix_Request *request);
96
97 int (*commit)(fenix_group_t* group);
98
99 int (*snapshot_delete)(fenix_group_t* group, int time_stamp);
100
101 int (*barrier)(fenix_group_t* group);
102
103 int (*member_restore)(fenix_group_t* group, int member_id,
104 void* target_buffer, int max_count, int time_stamp,
105 Fenix_Data_subset* data_found);
106
107 int (*member_lrestore)(fenix_group_t* group, int member_id,
108 void* target_buffer, int max_count, int time_stamp,
109 Fenix_Data_subset* data_found);
110
111 int (*member_restore_from_rank)(fenix_group_t* group, int member_id,
112 void* target_buffer, int max_count, int time_stamp,
113 int source_rank);
114
115 int (*get_number_of_snapshots)(fenix_group_t* group,
116 int* number_of_snapshots);
117
118 int (*get_snapshot_at_position)(fenix_group_t* group, int position,
119 int* time_stamp);
120
121 int (*reinit)(fenix_group_t* group, int* flag);
122
123 int (*member_get_attribute)(fenix_group_t* group, fenix_member_entry_t* mentry,
124 int attributename, void* attributevalue, int* flag, int sourcerank);
125
126 int (*member_set_attribute)(fenix_group_t* group, fenix_member_entry_t* mentry,
127 int attributename, void* attributevalue, int* flag);
128
130
131//We keep basic bookkeeping info here, policy specific
132//information is kept by the policy's data type.
133typedef struct __fenix_group {
135 int groupid;
136 MPI_Comm comm;
137 int comm_size;
138 int current_rank;
139 int timestart;
140 int timestamp;
141 int depth;
142 int policy_name;
143 fenix_member_t *member;
145
146typedef struct __fenix_data_recovery {
147 size_t count;
148 size_t total_size;
149 fenix_group_t **group;
151
152typedef struct __group_entry_packet {
153 int groupid;
154 int timestamp;
155 int depth;
156 int rank_separation;
158
159fenix_data_recovery_t * __fenix_data_recovery_init();
160
161int __fenix_group_delete(int groupid);
162
163int __fenix_member_delete(int groupid, int memberid);
164
165void __fenix_data_recovery_destroy( fenix_data_recovery_t *fx_data_recovery );
166
167void __fenix_data_recovery_reinit( fenix_data_recovery_t *dr, fenix_two_container_packet_t packet);
168
169void __fenix_ensure_data_recovery_capacity( fenix_data_recovery_t *dr);
170
171int __fenix_search_groupid( int key, fenix_data_recovery_t *dr);
172
173int __fenix_find_next_group_position( fenix_data_recovery_t *dr );
174
175#endif // FENIX_DATA_GROUP_H
Contains all API function calls and Fenix types. This is the only header file a user should include.
Definition fenix_data_subset.h:71
<span class="mlabel"> UNIMPLEMENTED </span> As MPI_Request, but for Fenix asynchronous data recove...
Definition fenix.h:346
Definition fenix_data_group.hpp:146
Definition fenix_data_group.hpp:75
Definition fenix_data_group.hpp:133
Definition fenix_data_member.hpp:66
Definition fenix_data_member.hpp:74
Definition fenix_data_group.hpp:152
Definition fenix_data_packet.hpp:60