|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* (C) 2018 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifndef DTPOOLS_H_INCLUDED
|
|
Packit Service |
c5cf8c |
#define DTPOOLS_H_INCLUDED
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* errors */
|
|
Packit Service |
c5cf8c |
#define DTP_SUCCESS (0)
|
|
Packit Service |
c5cf8c |
#define DTP_ERR_OTHER (1)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
typedef enum {
|
|
Packit Service |
c5cf8c |
DTP_POOL_TYPE__BASIC, /* basic type pool */
|
|
Packit Service |
c5cf8c |
DTP_POOL_TYPE__STRUCT, /* struct type pool */
|
|
Packit Service |
c5cf8c |
} DTP_pool_type;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* MPI_DATATYPE_NULL terminated list of datatypes */
|
|
Packit Service |
c5cf8c |
extern MPI_Datatype DTP_Basic_type[];
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
struct DTP_obj_array_s {
|
|
Packit Service |
c5cf8c |
MPI_Datatype DTP_obj_type;
|
|
Packit Service |
c5cf8c |
MPI_Aint DTP_obj_count;
|
|
Packit Service |
c5cf8c |
void *DTP_obj_buf;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* internal private structure to store datatype specific
|
|
Packit Service |
c5cf8c |
* information */
|
|
Packit Service |
c5cf8c |
void *private_info;
|
|
Packit Service |
c5cf8c |
};
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* main DTP object */
|
|
Packit Service |
c5cf8c |
typedef struct {
|
|
Packit Service |
c5cf8c |
DTP_pool_type DTP_pool_type;
|
|
Packit Service |
c5cf8c |
union {
|
|
Packit Service |
c5cf8c |
struct {
|
|
Packit Service |
c5cf8c |
MPI_Datatype DTP_basic_type;
|
|
Packit Service |
c5cf8c |
MPI_Aint DTP_basic_type_count;
|
|
Packit Service |
c5cf8c |
} DTP_pool_basic;
|
|
Packit Service |
c5cf8c |
struct {
|
|
Packit Service |
c5cf8c |
int DTP_num_types;
|
|
Packit Service |
c5cf8c |
MPI_Datatype *DTP_basic_type;
|
|
Packit Service |
c5cf8c |
int *DTP_basic_type_count;
|
|
Packit Service |
c5cf8c |
} DTP_pool_struct;
|
|
Packit Service |
c5cf8c |
} DTP_type_signature;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int DTP_num_objs;
|
|
Packit Service |
c5cf8c |
struct DTP_obj_array_s *DTP_obj_array;
|
|
Packit Service |
c5cf8c |
} *DTP_t;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* DTP manipulation functions */
|
|
Packit Service |
c5cf8c |
int DTP_pool_create(MPI_Datatype basic_type, MPI_Aint basic_type_count, DTP_t * dtp);
|
|
Packit Service |
c5cf8c |
int DTP_pool_create_struct(int num_types, MPI_Datatype * basic_types, int *basic_type_counts,
|
|
Packit Service |
c5cf8c |
DTP_t * dtp);
|
|
Packit Service |
c5cf8c |
int DTP_pool_free(DTP_t dtp);
|
|
Packit Service |
c5cf8c |
int DTP_obj_create(DTP_t dtp, int obj_idx, int val_start, int val_stride, MPI_Aint val_count);
|
|
Packit Service |
c5cf8c |
int DTP_obj_free(DTP_t dtp, int obj_idx);
|
|
Packit Service |
c5cf8c |
int DTP_obj_buf_check(DTP_t dtp, int obj_idx, int val_start, int val_stride, MPI_Aint val_count);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#endif /* DTPOOLS_H_INCLUDED */
|