1 |
#include <mpi.h> |
2 |
void bron_f1(MPI_Comm *, int *, int *, MPI_Comm *); |
3 |
void bron_f2(int *); |
4 |
void bron_f3(char *, int *, int *, void *); |
5 |
void bron_f4(int *); |
6 |
|
7 |
// Initialization function. |
8 |
// Only compute ranks return. |
9 |
void asyncio_bron_f_f1_( MPI_Comm *mpiCommParent, |
10 |
int *mpiComputeNP, |
11 |
int *totalNumTiles, |
12 |
MPI_Comm *mpiCommCompute ) { |
13 |
bron_f1(mpiCommParent, mpiComputeNP, totalNumTiles, mpiCommCompute ); |
14 |
} |
15 |
|
16 |
// Each compute rank calls this to register the |
17 |
// tileID(s) it owns. For multiple tileIDs per |
18 |
// rank call multiple times. Indicate that |
19 |
// registration is finished by calling with tileID=-1 |
20 |
void asyncio_bron_f_f2_( int *tileID ) { |
21 |
bron_f2(tileID); |
22 |
} |
23 |
|
24 |
// Call this from each rank to post data for writing. |
25 |
// fldNum is a numeric code for field to write (passing strings between |
26 |
// Fortran and C is a pain). epochID is timestep number. |
27 |
void asyncio_bron_f_f3_( int *fldNum, int *tileID, int *epochID, void *data){ |
28 |
char fldCode; |
29 |
//if ( *fldNum == 1 ) { fldCode='u'; } |
30 |
//if ( *fldNum == 2 ) { fldCode='v'; } |
31 |
//if ( *fldNum == 3 ) { fldCode='t'; } |
32 |
//if ( *fldNum == 4 ) { fldCode='s'; } |
33 |
//if ( *fldNum == 5 ) { fldCode='x'; } |
34 |
//if ( *fldNum == 6 ) { fldCode='y'; } |
35 |
//if ( *fldNum == 7 ) { fldCode='n'; } |
36 |
//if ( *fldNum == 8 ) { fldCode='d'; } |
37 |
//if ( *fldNum == 9 ) { fldCode='h'; } |
38 |
|
39 |
//if ( *fldNum == 10 ) { fldCode='a'; } // seaice fields |
40 |
//if ( *fldNum == 11 ) { fldCode='b'; } |
41 |
//if ( *fldNum == 12 ) { fldCode='c'; } |
42 |
//if ( *fldNum == 13 ) { fldCode='d'; } |
43 |
//if ( *fldNum == 14 ) { fldCode='e'; } |
44 |
//if ( *fldNum == 15 ) { fldCode='f'; } |
45 |
//if ( *fldNum == 16 ) { fldCode='g'; } |
46 |
fldCode = *fldNum; |
47 |
bron_f3(&fldCode, tileID, epochID, data); |
48 |
} |
49 |
|
50 |
// Call this once from one rank to make I/O ranks clean up and |
51 |
// finish/return. Indicate that the compute |
52 |
// ranks are done processing and sending data. |
53 |
void asyncio_bron_f_f4_( int *epochID ){ |
54 |
bron_f4(epochID); |
55 |
} |