-
Notifications
You must be signed in to change notification settings - Fork 0
/
testerrh.c
52 lines (37 loc) · 891 Bytes
/
testerrh.c
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
// SPDX-License-Identifier: MIT
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef NOWRAP
#include <mpi.h>
#else
#include "mpi.h"
#endif
void callback(MPI_Comm * comm, int *err, ...)
{
(void)comm;
(void)err;
}
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
MPI_Errhandler errh;
MPI_Comm_create_errhandler(callback, &errh);
MPI_Comm_set_errhandler(MPI_COMM_WORLD, errh);
MPI_Comm_call_errhandler(MPI_COMM_WORLD,99);
MPI_Comm dup;
MPI_Comm_dup(MPI_COMM_WORLD,&dup);
MPI_Errhandler temp0;
MPI_Comm_get_errhandler(MPI_COMM_WORLD,&temp0);
MPI_Errhandler temp1;
MPI_Comm_get_errhandler(dup,&temp1);
MPI_Comm_free(&dup);
MPI_Errhandler_free(&temp0);
MPI_Errhandler_free(&temp1);
MPI_Errhandler_free(&errh);
#if 0
MPI_Errhandler_free(&errh);
#endif
MPI_Finalize();
return 0;
}