|
Packit Service |
c5cf8c |
DTPools Release 0.0
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
DTPools is a datatype library used to test MPI communication routines with
|
|
Packit Service |
c5cf8c |
different datatype combinations. DTPools' interface is used to create pools
|
|
Packit Service |
c5cf8c |
of datatypes, each having a specified signature (i.e., native type + count).
|
|
Packit Service |
c5cf8c |
Every pool supports different datatype layouts (defined internally by the
|
|
Packit Service |
c5cf8c |
library). For a list of the available layouts, go to section: "4. Supported
|
|
Packit Service |
c5cf8c |
Derived Datatype layouts".
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
This README is organized as follows:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
1. DTPools API
|
|
Packit Service |
c5cf8c |
2. Testing with DTPools
|
|
Packit Service |
c5cf8c |
3. Supported Derived Datatypes
|
|
Packit Service |
c5cf8c |
4. Supported Derived Datatype layouts
|
|
Packit Service |
c5cf8c |
5. Extending DTPools
|
|
Packit Service |
c5cf8c |
6. TODOs
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
1. DTPools API
|
|
Packit Service |
c5cf8c |
==============
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Follows a list of DTPools interfaces used for datatype testing:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_pool_create(MPI_Datatype basic_type, int basic_count, DTP_t *dtp)
|
|
Packit Service |
c5cf8c |
Create a new basic pool with defined datatype signature.
|
|
Packit Service |
c5cf8c |
- basic_type: native datatype part of signature
|
|
Packit Service |
c5cf8c |
- basic_count: native datatype count part of signature
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_pool_create_struct(int basic_type_count, MPI_Datatype *basic_types, int *basic_counts, DTP_t *dtp)
|
|
Packit Service |
c5cf8c |
Create a new struct pool with defined signature.
|
|
Packit Service |
c5cf8c |
- basic_type_count: number of native datatypes in struct
|
|
Packit Service |
c5cf8c |
- basic_type: array of native datatypes
|
|
Packit Service |
c5cf8c |
- basic_counts: array of native datatype counts
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_pool_free(DTP_t dtp)
|
|
Packit Service |
c5cf8c |
Free a previously created datatype pool.
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_obj_create(DTP_t dtp, int obj_idx, int val_start, int val_stride, int val_count)
|
|
Packit Service |
c5cf8c |
Create a datatype object (at index obj_idx) inside the specified pool. Also initialize
|
|
Packit Service |
c5cf8c |
the buffer elements using start, stride and count.
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
- obj_idx: number of datatype inside the pool to be created
|
|
Packit Service |
c5cf8c |
- val_start: start of initialization value for buffer at index obj_idx
|
|
Packit Service |
c5cf8c |
- val_stride: increment for next element in buffer
|
|
Packit Service |
c5cf8c |
- val_count: total number of elements to be initialized in buffer
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_obj_free(DTP_t dtp, int obj_idx)
|
|
Packit Service |
c5cf8c |
Free a previously created datatype object inside the specified pool.
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
- obj_idx: number of datatype inside the pool to be freed
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* int DTP_obj_buf_check(DTP_t dtp, int obj_idx, int val_start, int val_stride, int val_count)
|
|
Packit Service |
c5cf8c |
Checks whether the received buffer (used in communication routine) matches the sent buffer.
|
|
Packit Service |
c5cf8c |
- dtp: datatype pool object
|
|
Packit Service |
c5cf8c |
- obj_idx: number of datatype inside the pool to be checked
|
|
Packit Service |
c5cf8c |
- val_start: start of checking value for buffer at index obj_idx
|
|
Packit Service |
c5cf8c |
- val_stride: increment for next checked element in buffer
|
|
Packit Service |
c5cf8c |
- val_count: total number of elements to be checked in buffer
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
2. Testing with DTPools
|
|
Packit Service |
c5cf8c |
=======================
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Follows a simple test application that uses DTPools:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include <stdlib.h>
|
|
Packit Service |
c5cf8c |
#include <unistd.h>
|
|
Packit Service |
c5cf8c |
#include "mpi.h"
|
|
Packit Service |
c5cf8c |
#include "dtpools.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#define BASIC_TYPE_MAX_COUNT (1024)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int main(int argc, char *argv[]) {
|
|
Packit Service |
c5cf8c |
int i, j, err;
|
|
Packit Service |
c5cf8c |
int num_err = 0;
|
|
Packit Service |
c5cf8c |
int basic_type_count;
|
|
Packit Service |
c5cf8c |
int myrank = 0;
|
|
Packit Service |
c5cf8c |
MPI_Request req;
|
|
Packit Service |
c5cf8c |
DTP_t send_dtp, recv_dtp;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Init(NULL, NULL);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
basic_type_count = BASIC_TYPE_MAX_COUNT;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
err = DTP_pool_create(MPI_INT, basic_type_count, &send_dtp);
|
|
Packit Service |
c5cf8c |
if (err != DTP_SUCCESS) {
|
|
Packit Service |
c5cf8c |
/* error hanling */;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
err = DTP_pool_create(MPI_INT, basic_type_count * 2, &recv_dtp);
|
|
Packit Service |
c5cf8c |
if (err != DTP_SUCCESS) {
|
|
Packit Service |
c5cf8c |
/* error hanling */;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < send_dtp->DTP_num_objs; i++) {
|
|
Packit Service |
c5cf8c |
err = DTP_obj_create(send_dtp, i, 0, 2, basic_type_count);
|
|
Packit Service |
c5cf8c |
if (err != DTP_SUCCESS) {
|
|
Packit Service |
c5cf8c |
/* error handling */;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (j = 0; j < recv_dtp->DTP_num_objs; j++) {
|
|
Packit Service |
c5cf8c |
err = DTP_obj_create(recv_dtp, j, 0, 0, 0);
|
|
Packit Service |
c5cf8c |
if (err != DTP_SUCCESS) {
|
|
Packit Service |
c5cf8c |
/* error handling */;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Irecv(recv_dtp->DTP_obj_array[j].DTP_obj_buf,
|
|
Packit Service |
c5cf8c |
recv_dtp->DTP_obj_array[j].DTP_obj_count,
|
|
Packit Service |
c5cf8c |
recv_dtp->DTP_obj_array[j].DTP_obj_type,
|
|
Packit Service |
c5cf8c |
myrank, 0, MPI_COMM_WORLD, &req;;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Send(send_dtp->DTP_obj_array[i].DTP_obj_buf,
|
|
Packit Service |
c5cf8c |
send_dtp->DTP_obj_array[i].DTP_obj_count,
|
|
Packit Service |
c5cf8c |
send_dtp->DTP_obj_array[i].DTP_obj_type,
|
|
Packit Service |
c5cf8c |
myrank, 0, MPI_COMM_WORLD);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Wait(&req, MPI_STATUS_IGNORE);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (DTP_obj_buf_check(recv_dtp, j, 0, 2, basic_type_count) != DTP_SUCCESS) {
|
|
Packit Service |
c5cf8c |
num_err++;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
DTP_obj_free(recv_dtp, j);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
DTP_obj_free(send_dtp, i);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
DTP_pool_free(send_dtp);
|
|
Packit Service |
c5cf8c |
DTP_pool_free(recv_dtp);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (num_err > 0) {
|
|
Packit Service |
c5cf8c |
fprintf(stdout, " No Errors\n");
|
|
Packit Service |
c5cf8c |
fflush(stdout);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Finalize();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return err;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
3. Supported Derived Datatypes
|
|
Packit Service |
c5cf8c |
==============================
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Currently the following derived datatype are supported:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* MPI_Type_contiguous
|
|
Packit Service |
c5cf8c |
* MPI_Type_vector
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_hvector
|
|
Packit Service |
c5cf8c |
* MPI_Type_indexed
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_hindexed
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_indexed_block
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_hindexed_block
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_subarray
|
|
Packit Service |
c5cf8c |
* MPI_Type_create_struct
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
The following native datatypes are also supported:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* MPI_CHAR,
|
|
Packit Service |
c5cf8c |
* MPI_WCHAR,
|
|
Packit Service |
c5cf8c |
* MPI_SHORT,
|
|
Packit Service |
c5cf8c |
* MPI_INT,
|
|
Packit Service |
c5cf8c |
* MPI_LONG,
|
|
Packit Service |
c5cf8c |
* MPI_LONG_LONG_INT,
|
|
Packit Service |
c5cf8c |
* MPI_UNSIGNED_CHAR,
|
|
Packit Service |
c5cf8c |
* MPI_UNSIGNED_SHORT,
|
|
Packit Service |
c5cf8c |
* MPI_UNSIGNED,
|
|
Packit Service |
c5cf8c |
* MPI_UNSIGNED_LONG,
|
|
Packit Service |
c5cf8c |
* MPI_UNSIGNED_LONG_LONG,
|
|
Packit Service |
c5cf8c |
* MPI_FLOAT,
|
|
Packit Service |
c5cf8c |
* MPI_DOUBLE,
|
|
Packit Service |
c5cf8c |
* MPI_LONG_DOUBLE,
|
|
Packit Service |
c5cf8c |
* MPI_INT8_T,
|
|
Packit Service |
c5cf8c |
* MPI_INT16_T,
|
|
Packit Service |
c5cf8c |
* MPI_INT32_T,
|
|
Packit Service |
c5cf8c |
* MPI_INT64_T,
|
|
Packit Service |
c5cf8c |
* MPI_UINT8_T,
|
|
Packit Service |
c5cf8c |
* MPI_UINT16_T,
|
|
Packit Service |
c5cf8c |
* MPI_UINT32_T,
|
|
Packit Service |
c5cf8c |
* MPI_UINT64_T,
|
|
Packit Service |
c5cf8c |
* MPI_C_COMPLEX,
|
|
Packit Service |
c5cf8c |
* MPI_C_FLOAT_COMPLEX,
|
|
Packit Service |
c5cf8c |
* MPI_C_DOUBLE_COMPLEX,
|
|
Packit Service |
c5cf8c |
* MPI_C_LONG_DOUBLE_COMPLEX,
|
|
Packit Service |
c5cf8c |
* MPI_FLOAT_INT,
|
|
Packit Service |
c5cf8c |
* MPI_DOUBLE_INT,
|
|
Packit Service |
c5cf8c |
* MPI_LONG_INT,
|
|
Packit Service |
c5cf8c |
* MPI_2INT,
|
|
Packit Service |
c5cf8c |
* MPI_SHORT_INT,
|
|
Packit Service |
c5cf8c |
* MPI_LONG_DOUBLE_INT
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
4. Supported Derived Datatype layouts
|
|
Packit Service |
c5cf8c |
=====================================
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
The following layouts for derived datatypes are currently supported:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* Simple layout
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__CONTIG: type_count = 1; type_stride = -; type_blklen = basic_type_count;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__VECTOR: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__HVECTOR: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__INDEXED: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__HINDEXED: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__BLOCK_INDEXED: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_SIMPLE__BLOCK_HINDEXED: type_count = basic_type_count; type_stride = 2; type_blklen = 1;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* Complex layout
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__VECTOR: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__HVECTOR: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__INDEXED: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__HINDEXED: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__BLOCK_INDEXED: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__BLOCK_HINDEXED: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__SUBARRAY_C: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK__SUBARRAY_F: type_count = small; type_blklen = large; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__VECTOR: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__HVECTOR: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__INDEXED: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__HINDEXED: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__BLOCK_INDEXED: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__BLOCK_HINDEXED: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__SUBARRAY_C: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT__SUBARRAY_F: type_count = large; type_blklen = small; type_stride = type_blklen + 1;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__VECTOR: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__HVECTOR: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__INDEXED: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__HINDEXED: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__BLOCK_INDEXED: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__BLOCK_HINDEXED: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__SUBARRAY_C: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_BLK_STRD__SUBARRAY_F: type_count = small; type_blklen = large; type_stride = type_blklen * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__VECTOR: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__HVECTOR: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__INDEXED: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__HINDEXED: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__BLOCK_INDEXED: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__BLOCK_HINDEXED: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__SUBARRAY_C: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
- DTPI_OBJ_LAYOUT_LARGE_CNT_STRD__SUBARRAY_F: type_count = large; type_blklen = small; type_stride = type_count * 2;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
5. Extending DTPools
|
|
Packit Service |
c5cf8c |
====================
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Extending DTPools with new datatype layouts is as simple as adding the
|
|
Packit Service |
c5cf8c |
type descriptor in `test/mpi/dtpools/include/dtpools_internal.h`, the
|
|
Packit Service |
c5cf8c |
corresponding type create and buf check functions in
|
|
Packit Service |
c5cf8c |
`test/mpi/dtpools/src/dtpools_internal.c`, and including the new layout to
|
|
Packit Service |
c5cf8c |
the pool create function in `test/mpi/dtpools/src/dtpools.c`.
|
|
Packit Service |
c5cf8c |
Additionally the type create function should also be added to creators
|
|
Packit Service |
c5cf8c |
function vector `DTPI_Init_creators`.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Example:
|
|
Packit Service |
c5cf8c |
/* dtpools_internal.h */
|
|
Packit Service |
c5cf8c |
enum {
|
|
Packit Service |
c5cf8c |
...,
|
|
Packit Service |
c5cf8c |
DTPI_OBJ_LAYOUT_MYLAYOUT__NESTED_VECTOR,
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
};
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int DTPI_Nested_vector_create(struct DTPI_Par *par, DTP_t dtp);
|
|
Packit Service |
c5cf8c |
int DTPI_Nested_vector_check_buf(struct DTPI_Par *par, DTP_t dtp);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* dtpools_internal.c */
|
|
Packit Service |
c5cf8c |
void DTPI_Init_creators(DTPI_Creator * creators) {
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
creators[DTPI_OBJ_LAYOUT_MYLAYOUT__NESTED_VECTOR] = DTPI_Nested_vector_create;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int DTPI_Nested_vector_create(struct DTPI_Par *par, DTP_t dtp) {
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
int DTPI_Nested_vector_check_buf(struct DTPI_Par *par, DTP_t dtp) {
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* dtpools.c */
|
|
Packit Service |
c5cf8c |
int DTP_obj_create(DTP_t dtp, int obj_idx, int val_start, int var_stride, int val_count) {
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
switch(obj_idx) {
|
|
Packit Service |
c5cf8c |
case XXX:
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
case DTPI_OBJ_LAYOUT_MYLAYOUT__NESTED_VECTOR:
|
|
Packit Service |
c5cf8c |
/* set up parameters for create function */
|
|
Packit Service |
c5cf8c |
par.core.type_count = X(count); /* signature count */
|
|
Packit Service |
c5cf8c |
par.core.type_blklen = Y(count);
|
|
Packit Service |
c5cf8c |
par.core.type_stride = Z(count);
|
|
Packit Service |
c5cf8c |
break;
|
|
Packit Service |
c5cf8c |
default:;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
...
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
----------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
6. TODOs
|
|
Packit Service |
c5cf8c |
========
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Follows a list of known issues that should be fixed in a future release:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
1. Resized datatypes (using MPI_TYPE_CREATE_RESIZED) are not currently supported.
|
|
Packit Service |
c5cf8c |
2. The framework does not provide an interface to reset the type buffer:
|
|
Packit Service |
c5cf8c |
`DTP_obj_reset(DTP_t dtp, int obj_idx, int val_start, int val_stride, int val_count)`
|
|
Packit Service |
c5cf8c |
3. The interface should return an object handle that can be used to directly
|
|
Packit Service |
c5cf8c |
reference the created datatype, its count, and buffer instead of accessing
|
|
Packit Service |
c5cf8c |
directly the object array:
|
|
Packit Service |
c5cf8c |
`DTP_obj_create(DTP_t dtp, int obj_idx, int val_start, int val_stride, int val_count, DTP_Obj_t *obj)`
|
|
Packit Service |
c5cf8c |
4. Currently datatypes in the pools have count of 1. The framework should be extended
|
|
Packit Service |
c5cf8c |
to support counts > 1.
|