1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef PMIX_GDS_DS_BASE_H_
14 #define PMIX_GDS_DS_BASE_H_
15
16 #include <pthread.h>
17 #include <src/include/pmix_config.h>
18 #include <pmix_common.h>
19
20 #include "src/include/pmix_globals.h"
21 #include "src/class/pmix_list.h"
22 #include "src/mca/gds/gds.h"
23 #include "src/mca/pshmem/pshmem.h"
24 #include "src/mca/common/dstore/dstore_file.h"
25
26 typedef void* pmix_common_dstor_lock_ctx_t;
27
28 typedef pmix_status_t (*pmix_common_dstor_lock_init_fn_t)(pmix_common_dstor_lock_ctx_t *ctx,
29 const char *base_path, const char *name,
30 uint32_t local_size, uid_t uid, bool setuid);
31 typedef void (*pmix_common_dstor_lock_finalize_fn_t)(pmix_common_dstor_lock_ctx_t *ctx);
32 typedef pmix_status_t (*pmix_common_dstor_lock_rd_get_fn_t)(pmix_common_dstor_lock_ctx_t ctx);
33 typedef pmix_status_t (*pmix_common_dstor_lock_rd_rel_fn_t)(pmix_common_dstor_lock_ctx_t ctx);
34 typedef pmix_status_t (*pmix_common_dstor_lock_wr_get_fn_t)(pmix_common_dstor_lock_ctx_t ctx);
35 typedef pmix_status_t (*pmix_common_dstor_lock_wr_rel_fn_t)(pmix_common_dstor_lock_ctx_t ctx);
36
37 typedef struct {
38 pmix_common_dstor_lock_init_fn_t init;
39 pmix_common_dstor_lock_finalize_fn_t finalize;
40 pmix_common_dstor_lock_rd_get_fn_t rd_lock;
41 pmix_common_dstor_lock_rd_rel_fn_t rd_unlock;
42 pmix_common_dstor_lock_wr_get_fn_t wr_lock;
43 pmix_common_dstor_lock_wr_rel_fn_t wr_unlock;
44 } pmix_common_lock_callbacks_t;
45
46 typedef struct pmix_common_dstore_ctx_s pmix_common_dstore_ctx_t;
47
48 PMIX_EXPORT pmix_common_dstore_ctx_t *pmix_common_dstor_init(const char *ds_name, pmix_info_t info[], size_t ninfo,
49 pmix_common_lock_callbacks_t *lock_cb,
50 pmix_common_dstore_file_cbs_t *file_cb);
51 PMIX_EXPORT void pmix_common_dstor_finalize(pmix_common_dstore_ctx_t *ds_ctx);
52 PMIX_EXPORT pmix_status_t pmix_common_dstor_add_nspace(pmix_common_dstore_ctx_t *ds_ctx,
53 const char *nspace, pmix_info_t info[], size_t ninfo);
54 PMIX_EXPORT pmix_status_t pmix_common_dstor_del_nspace(pmix_common_dstore_ctx_t *ds_ctx, const char* nspace);
55 PMIX_EXPORT pmix_status_t pmix_common_dstor_setup_fork(pmix_common_dstore_ctx_t *ds_ctx, const char *base_path_env,
56 const pmix_proc_t *peer, char ***env);
57 PMIX_EXPORT pmix_status_t pmix_common_dstor_cache_job_info(pmix_common_dstore_ctx_t *ds_ctx,
58 struct pmix_namespace_t *ns,
59 pmix_info_t info[], size_t ninfo);
60 PMIX_EXPORT pmix_status_t pmix_common_dstor_register_job_info(pmix_common_dstore_ctx_t *ds_ctx,
61 struct pmix_peer_t *pr,
62 pmix_buffer_t *reply);
63 PMIX_EXPORT pmix_status_t pmix_common_dstor_store_job_info(pmix_common_dstore_ctx_t *ds_ctx,
64 const char *nspace,
65 pmix_buffer_t *job_data);
66 PMIX_EXPORT pmix_status_t pmix_common_dstor_store(pmix_common_dstore_ctx_t *ds_ctx,
67 const pmix_proc_t *proc,
68 pmix_scope_t scope,
69 pmix_kval_t *kv);
70 PMIX_EXPORT pmix_status_t pmix_common_dstor_fetch(pmix_common_dstore_ctx_t *ds_ctx,
71 const pmix_proc_t *proc,
72 pmix_scope_t scope, bool copy,
73 const char *key,
74 pmix_info_t info[], size_t ninfo,
75 pmix_list_t *kvs);
76 PMIX_EXPORT pmix_status_t pmix_common_dstor_store_modex(pmix_common_dstore_ctx_t *ds_ctx,
77 struct pmix_namespace_t *nspace,
78 pmix_buffer_t *buff,
79 void *cbdata);
80 #endif