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 structured mesh.
9
* Note that the mesh dimensions depend on the rank.
15
int main (int argc, char * argv[] )
17
char filename[]="structured.bp";
20
double t[NX], mean = 0;
21
MPI_Comm comm = MPI_COMM_WORLD;
22
char * str = "Jul, 2012";
26
uint64_t adios_groupsize, adios_totalsize;
29
MPI_Init (&argc, &argv);
30
MPI_Comm_rank (comm, &rank);
31
MPI_Comm_size (comm, &size);
36
int size2 = 2*size*NX;
38
for (i = 0; i< size; i++)
50
for (i = 0; i< NX; i++) {
55
adios_init ("structured.xml", comm);
57
adios_open (&adios_handle, "schema", filename, "w", comm);
64
+ sizeof(float) * (size) * (NX) \
65
+ sizeof(float) * (size) * (NX) \
66
+ sizeof(double) * (NX);
67
adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
68
adios_write (adios_handle, "NX", &NX);
69
adios_write (adios_handle, "size", &size);
70
//adios_write (adios_handle, "size2", &size2);
71
adios_write (adios_handle, "rank", &rank);
72
//adios_write (adios_handle, "mean", &mean);
73
//adios_write (adios_handle, "nspace", &nspace);
74
adios_write (adios_handle, "X", X);
75
adios_write (adios_handle, "Y", Y);
76
//adios_write (adios_handle, "XY", XY);
77
//adios_write (adios_handle, "date", str);
78
adios_write (adios_handle, "temperature", t);
80
adios_close (adios_handle);
84
adios_finalize (rank);