-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathpcu_mpi.h
51 lines (41 loc) · 1.24 KB
/
pcu_mpi.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
/******************************************************************************
Copyright 2011 Scientific Computation Research Center,
Rensselaer Polytechnic Institute. All rights reserved.
This work is open source software, licensed under the terms of the
BSD license as described in the LICENSE file in the top-level directory.
*******************************************************************************/
#ifndef PCU_MPI_H
#define PCU_MPI_H
#include "pcu_buffer.h"
#include <mpi.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
pcu_buffer buffer;
MPI_Request request;
int peer;
} pcu_message;
void pcu_make_message(pcu_message* m);
void pcu_free_message(pcu_message* m);
struct pcu_mpi_struct
{
MPI_Comm original_comm;
MPI_Comm user_comm;
MPI_Comm coll_comm;
int rank;
int size;
};
typedef struct pcu_mpi_struct pcu_mpi_t;
int pcu_mpi_size(const pcu_mpi_t*);
int pcu_mpi_rank(const pcu_mpi_t*);
void pcu_mpi_send(const pcu_mpi_t*, pcu_message* m, MPI_Comm comm);
bool pcu_mpi_done(const pcu_mpi_t*, pcu_message* m);
bool pcu_mpi_receive(const pcu_mpi_t*, pcu_message* m, MPI_Comm comm);
void pcu_mpi_init(MPI_Comm comm, pcu_mpi_t* mpi);
void pcu_mpi_finalize(pcu_mpi_t* mpi);
#ifdef __cplusplus
}
#endif
#endif