2
* ADIOS is freely available under the terms of the BSD license described
3
* in the COPYING file in the top level directory of this source distribution.
5
* Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved.
8
/* ADIOS C Example: write a variable along with a rectilinear mesh.
9
* Note that the mesh dimensions depend on the rank.
15
int main (int argc, char * argv[] )
17
char filename []="rectilinear.bp";
20
double t[NX], mean = 0;
21
MPI_Comm comm = MPI_COMM_WORLD;
22
char * str = "Jul, 2012";
25
uint64_t adios_groupsize, adios_totalsize;
28
MPI_Init (&argc, &argv);
29
MPI_Comm_rank (comm, &rank);
30
MPI_Comm_size (comm, &size);
37
for (i = 1; i< size; i++)
43
for (i = 1; i< NX; i++)
48
for (i = 0; i < NX; i++)
56
adios_init ("rectilinear.xml", comm);
58
adios_open (&adios_handle, "schema", filename, "w", comm);
69
adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
70
adios_write (adios_handle, "NX", &NX);
71
adios_write (adios_handle, "size", &size);
72
adios_write (adios_handle, "rank", &rank);
73
adios_write (adios_handle, "mean", &mean);
74
adios_write (adios_handle, "xydim", &xydim);
75
adios_write (adios_handle, "X", X);
76
adios_write (adios_handle, "Y", Y);
77
adios_write (adios_handle, "date", str);
78
adios_write (adios_handle, "temperature", t);
80
adios_close (adios_handle);
84
adios_finalize (rank);