-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.C
85 lines (71 loc) · 2.55 KB
/
main.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#define OMPI_SKIP_MPICXX 1
#define MPICH_SKIP_MPICXX 1
#include "comm.h"
#include <stdio.h>
#include "cmdLineOptions.h"
#include "h5test.h"
#include "parallel_io.h"
#include "t3pio.h"
Comm P;
void outputResults(CmdLineOptions& cmd, ParallelIO& pio);
int main(int argc, char* argv[])
{
P.init(&argc, &argv, MPI_COMM_WORLD);
CmdLineOptions cmd(argc, argv);
CmdLineOptions::state_t state = cmd.state();
if (state != CmdLineOptions::iGOOD)
{
MPI_Finalize();
return (state == CmdLineOptions::iBAD);
}
ParallelIO pio;
if (cmd.h5slab || cmd.h5chunk)
pio.h5writer(cmd);
if (cmd.romio)
pio.MPIIOwriter(cmd);
if (P.myProc == 0)
outputResults(cmd, pio);
P.fini();
return 0;
}
void outputResults(CmdLineOptions& cmd, ParallelIO& pio)
{
double fileSz = pio.totalSz()/(1024.0 * 1024.0 * 1024.0);
const char* t3pioV = t3pio_version();
if (cmd.luaStyleOutput)
{
printf("%%%% { t3pioV = \"%s\", nprocs = %d, lSz = %ld, wrtStyle = \"%s\","
" xferStyle = \"%s\", iounits = %d, aggregators = %d, nstripes = %d, "
" stripeSzMB = %d, fileSzGB = %15.7g, time = %15.7g, totalTime = %15.7g,"
" rate = %15.7g },\n",
t3pioV, P.nProcs, cmd.localSz, cmd.wrtStyle.c_str(), cmd.xferStyle.c_str(),
pio.nIOUnits(), pio.aggregators(), pio.nStripes(), pio.stripeSzMB(),
fileSz, pio.time(), pio.totalTime(), pio.rate());
}
if (cmd.tableStyleOutput)
{
printf("\nunstructTest:\n"
"-------------------\n\n"
" Nprocs: %12d\n"
" lSz: %12ld\n"
" Numvar: %12d\n"
" iounits: %12d\n"
" aggregators: %12d\n"
" nstripes: %12d\n"
" stripeSz (MB): %12d\n"
" fileSz (GB): %12.3f\n"
" time (sec): %12.3f\n"
" totalTime (sec): %12.3f\n"
" rate (MB/s): %12.3f\n"
" wrtStyle: %12s\n"
" xferStyle: %12s\n"
" S_dne: %12d\n"
" S_auto_max: %12d\n"
" nStripesT3: %12d\n"
" t3pioV: %12s\n",
P.nProcs, cmd.localSz, pio.numvar(), pio.nIOUnits(), pio.aggregators(),
pio.nStripes(), pio.stripeSzMB(), fileSz, pio.time(), pio.totalTime(),
pio.rate(), cmd.wrtStyle.c_str(), cmd.xferStyle.c_str(), pio.dne_stripes(),
pio.auto_max_stripes(), pio.nStripesT3(), t3pioV);
}
}