File: dtpools.h

package info (click to toggle)
mpich 4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,184 kB
  • sloc: ansic: 1,040,629; cpp: 82,270; javascript: 40,763; perl: 27,933; python: 16,041; sh: 14,676; xml: 14,418; f90: 12,916; makefile: 9,270; fortran: 8,046; java: 4,635; asm: 324; ruby: 103; awk: 27; lisp: 19; php: 8; sed: 4
file content (51 lines) | stat: -rw-r--r-- 1,508 bytes parent folder | download | duplicates (4)
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
/*
 * Copyright (C) by Argonne National Laboratory
 *     See COPYRIGHT in top-level directory
 */

#ifndef DTPOOLS_H_INCLUDED
#define DTPOOLS_H_INCLUDED

/* errors */
#define DTP_SUCCESS                (0)
#define DTP_ERR_ARG                (-1)
#define DTP_ERR_OUT_OF_RESOURCES   (-2)
#define DTP_ERR_MPI                (-3)
#define DTP_ERR_MAXED_ATTEMPTS     (-4)
#define DTP_ERR_OTHER              (-5)

typedef struct {
    MPI_Datatype DTP_datatype;
    MPI_Aint DTP_type_count;

    MPI_Aint DTP_bufsize;
    MPI_Aint DTP_buf_offset;

    void *priv;
} DTP_obj_s;

typedef struct {
    MPI_Datatype DTP_base_type;

    void *priv;
} DTP_pool_s;

/* DTP manipulation functions */
int DTP_pool_create(const char *basic_type_str, MPI_Aint basic_type_count, int seed,
                    DTP_pool_s * dtp);
int DTP_pool_free(DTP_pool_s dtp);
int DTP_pool_set_rand_idx(DTP_pool_s dtp, int rand_idx);

int DTP_obj_create(DTP_pool_s dtp, DTP_obj_s * obj, MPI_Aint maxbufsize);
int DTP_obj_create_custom(DTP_pool_s dtp, DTP_obj_s * obj, const char *desc);

int DTP_obj_free(DTP_obj_s obj);
const char *DTP_obj_get_description(DTP_obj_s obj);

int DTP_obj_buf_init(DTP_obj_s obj, void *buf, int val_start, int val_stride, MPI_Aint val_count);
int DTP_obj_buf_check(DTP_obj_s obj, void *buf, int val_start, int val_stride, MPI_Aint val_count);

/* Some tests need be able to reset count, e.g. pt2pt tests */
int DTP_pool_update_count(DTP_pool_s dtp, MPI_Aint basic_type_count);

#endif /* DTPOOLS_H_INCLUDED */