14 main(
int argc,
char *argv[])
17 int nprocs, rank, thlv;
19 MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &thlv);
20 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
21 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
25 MPI_Barrier(MPI_COMM_WORLD);
26 if (rank == 0) {printf(
"simple0...\n");}
39 assert(kvs0_ == 0 && kv0.klen == 0 && kv0.vlen == 0 && kvo != 0);
42 {5, 7, {
"key0"}, {
"value0"}},
43 {5, 7, {
"key1"}, {
"value1"}},
44 {5, 7, {
"key2"}, {
"value2"}},
45 {5, 7, {
"key3"}, {
"value3"}},
46 {5, 7, {
"key4"}, {
"value4"}}
48 for (
int i = 0; i < 5; i++) {
50 assert(cc_ == MPI_SUCCESS);
54 assert(cc == MPI_SUCCESS);
58 MPI_Barrier(MPI_COMM_WORLD);
Key-Value Stream (abstract).
int kmr_add_kv(KMR_KVS *kvs, const struct kmr_kv_box kv)
Adds a key-value pair.
#define kmr_create_kvs(MR, KF, VF)
Makes a new key-value stream (of type KMR_KVS) with the specified field datatypes.
int kmr_free_kvs(KMR_KVS *kvs)
Releases a key-value stream (type KMR_KVS).
Handy Copy of a Key-Value Field.
int kmr_dump_kvs(KMR_KVS *kvs, int flag)
Dumps contents of a key-value stream to stdout.
int kmr_fin(void)
Clears the environment.
#define kmr_init()
Sets up the environment.
int kmr_map_on_rank_zero(KMR_KVS *kvo, void *arg, struct kmr_option opt, kmr_mapfn_t m)
Maps on rank0 only.
KMR * kmr_create_context(const MPI_Comm comm, const MPI_Info conf, const char *name)
Makes a new KMR context (a context has type KMR).