-
Notifications
You must be signed in to change notification settings - Fork 4
/
dsde_internal.h
90 lines (75 loc) · 3.87 KB
/
dsde_internal.h
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Copyright (c) 2012 The Trustees of University of Illinois.
* All rights reserved.
*
* Author(s): Torsten Hoefler <htor@illinois.edu>
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <limits>
#include <iostream>
#include <ctime>
#include <set>
#include <queue>
#include "mpi.h"
#include "dsde.h"
extern "C" {
/* -----------------------------------------
* DSDE_Free implementations
* ----------------------------------------- */
/* function pointer to a DSDE_Free implementation that takes a pointer to a handle */
typedef int(*DSDE_Free_fn)(DSDE_Handle*);
/* assumes that handle just points to one big block of memory that must be freed */
int DSDE_Free_single(DSDE_Handle* handle);
/* -----------------------------------------
* DSDE_Exchange implementations
* ----------------------------------------- */
int DSDE_Exchange_brucks_inline(
const void* sendbuf, int srankcount, const int sranks[], MPI_Aint sendcount, const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint recvcount, MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle,
int degree);
/* -----------------------------------------
* DSDE_Exchangev implementations
* ----------------------------------------- */
int DSDE_Exchangev_alltoall(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint* recvcounts[], MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle);
int DSDE_Exchangev_reduce_scatter(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint* recvcounts[], MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle);
int DSDE_Exchangev_accumulate(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint* recvcounts[], MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle);
int DSDE_Exchangev_ibarrier(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint* recvcounts[], MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle);
int DSDE_Exchangev_brucks(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sendcounts[], const MPI_Aint sdispls[], MPI_Datatype sendtype,
void** recvbuf, int* rrankcount, int* rranks[], MPI_Aint* recvcounts[], MPI_Aint* rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, DSDE_Handle* handle,
int degree);
/* -----------------------------------------
* DSDE_Reduce_scatter_block implementations
* ----------------------------------------- */
int DSDE_Reduce_scatter_block_brucks(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sdispls[],
int* flag, void* recvbuf, MPI_Aint count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm,
int degree);
/* avoids creating some datatypes at the cost of being restricted to homogeneous systems */
int DSDE_Reduce_scatter_block_hbrucks(
const void* sendbuf, int srankcount, const int sranks[], const MPI_Aint sdispls[],
int* flag, void* recvbuf, MPI_Aint count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm,
int degree);
} /* extern "C" */