summaryrefslogtreecommitdiffstats
path: root/src/H5VLdaosm.h
blob: ab9d75418f77b031c5072315d78932e43ff71f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the files COPYING and Copyright.html.  COPYING can be found at the root   *
 * of the source code distribution tree; Copyright.html can be found at the  *
 * root level of an installed copy of the electronic HDF5 document set and   *
 * is linked from the top-level documents page.  It can also be found at     *
 * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
 * access to either file, you may request a copy from help@hdfgroup.org.     *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*
 * Programmer:  Neil Fortner <nfortne2@hdfgroup.org>
 *              September, 2016
 *
 * Purpose:	The private header file for the DAOS-M VOL plugin.
 */
#ifndef H5VLdaosm_H
#define H5VLdaosm_H

#define H5_HAVE_EFF 1 /* DSMINC */

/* Include package's public header */
#include "H5VLdaosm_public.h"

#ifdef H5_HAVE_EFF

#include "daos.h"

#define HDF5_VOL_DAOSM_VERSION_1	1	/* Version number of IOD VOL plugin */

#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef H5_HAVE_EFF

/* FAPL property to tell the VOL plugin to open a saved snapshot when opening a
 * file */
#define H5VL_DAOSM_SNAP_OPEN_ID "daosm_snap_open"

/* Common object and attribute information */
typedef struct H5VL_daosm_item_t {
    H5I_type_t type;
    struct H5VL_daosm_file_t *file;
    int rc;
} H5VL_daosm_item_t;

/* Common object information */
typedef struct H5VL_daosm_obj_t {
    H5VL_daosm_item_t item; /* Must be first */
    daos_obj_id_t oid;
    daos_handle_t obj_oh;
} H5VL_daosm_obj_t;

/* The file struct */
typedef struct H5VL_daosm_file_t {
    H5VL_daosm_item_t item; /* Must be first */
    daos_handle_t coh;
    daos_epoch_t epoch;
    int snap_epoch;
    char *file_name;
    uuid_t uuid;
    unsigned flags;
    daos_handle_t glob_md_oh;
    struct H5VL_daosm_group_t *root_grp;
    uint64_t max_oid;
    hbool_t max_oid_dirty;
    hid_t fcpl_id;
    hid_t fapl_id;
    MPI_Comm comm;
    MPI_Info info;
    int my_rank;
    int num_procs;
    hbool_t collective;
} H5VL_daosm_file_t;

/* The group struct */
typedef struct H5VL_daosm_group_t {
    H5VL_daosm_obj_t obj; /* Must be first */
    hid_t gcpl_id;
    hid_t gapl_id;
} H5VL_daosm_group_t;

/* The dataset struct */
typedef struct H5VL_daosm_dset_t {
    H5VL_daosm_obj_t obj; /* Must be first */
    hid_t type_id;
    hid_t space_id;
    hid_t dcpl_id;
    hid_t dapl_id;
} H5VL_daosm_dset_t;

/* The map struct */
typedef struct H5VL_daosm_map_t {
    H5VL_daosm_obj_t obj; /* Must be first */
    hid_t ktype_id;
    hid_t vtype_id;
} H5VL_daosm_map_t;

/* The attribute struct */
typedef struct H5VL_daosm_attr_t {
    H5VL_daosm_item_t item; /* Must be first */
    H5VL_daosm_obj_t *parent;
    char *name;
    hid_t type_id;
    hid_t space_id;
} H5VL_daosm_attr_t;

/* The link value struct */
typedef struct H5VL_daosm_link_val_t {
    H5L_type_t type;
    union {
        daos_obj_id_t hard;
        char *soft;
    } target;
} H5VL_daosm_link_val_t;

extern hid_t H5VL_DAOSM_g;

H5_DLL herr_t H5VL_daosm_init(void);

H5_DLL void * H5VL_daosm_map_create(void *_item, H5VL_loc_params_t loc_params, const char *name,
				    hid_t ktype_id, hid_t vtype_id, hid_t mcpl_id, hid_t mapl_id,
				    hid_t dxpl_id, void **req);
H5_DLL void * H5VL_daosm_map_open(void *_item, H5VL_loc_params_t loc_params, const char *name,
				  hid_t mapl_id, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_daosm_map_set(void *_map, hid_t key_mem_type_id, const void *key, 
				 hid_t val_mem_type_id, const void *value, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_daosm_map_get(void *_map, hid_t key_mem_type_id, const void *key, 
				 hid_t val_mem_type_id, void *value, hid_t dxpl_id, void **req);
H5_DLL herr_t H5VL_daosm_map_get_types(void *_map, hid_t *key_type_id, hid_t *val_type_id, void **req);
H5_DLL herr_t H5VL_daosm_map_get_count(void *_map, hsize_t *count, void **req);
H5_DLL herr_t H5VL_daosm_map_exists(void *_map, hid_t key_mem_type_id, const void *key, 
				    hbool_t *exists, void **req);
H5_DLL herr_t H5VL_daosm_map_close(void *_map, hid_t dxpl_id, void **req);

#endif /* H5_HAVE_EFF */

#ifdef __cplusplus
}
#endif

#endif /* H5VLdaosm_H */