Commit cda87e9f authored by Hal Finkel's avatar Hal Finkel
Browse files

The GIO write benchmark should not use completely trivial data (so compression is not trivial)

parent 72ac664b
......@@ -43,6 +43,7 @@
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <string>
#include <cassert>
......@@ -56,6 +57,18 @@
using namespace std;
using namespace gio;
template <typename T>
struct Generator {
Generator(T start, T inc) : value(start), inc(inc) {}
T operator()() {
value += inc;
return value;
}
T value;
T inc;
};
int main(int argc, char *argv[]) {
MPI_Init(&argc, &argv);
......@@ -119,14 +132,14 @@ int main(int argc, char *argv[]) {
id.resize(Np + GIO.requestedExtraSpace()/sizeof(ID_T));
mask.resize(Np + GIO.requestedExtraSpace()/sizeof(MASK_T));
std::fill(xx.begin(), xx.end(), 25);
std::fill(yy.begin(), yy.end(), 25);
std::fill(zz.begin(), zz.end(), 25);
std::fill(vx.begin(), vx.end(), 25);
std::fill(vy.begin(), vy.end(), 25);
std::fill(vz.begin(), vz.end(), 25);
std::fill(phi.begin(), phi.end(), 25);
std::fill(id.begin(), id.end(), 25);
std::generate(xx.begin(), xx.end(), Generator<POSVEL_T>(25, 3));
std::generate(yy.begin(), yy.end(), Generator<POSVEL_T>(25, 3));
std::generate(zz.begin(), zz.end(), Generator<POSVEL_T>(25, 3));
std::generate(vx.begin(), vx.end(), Generator<POSVEL_T>(25, 3));
std::generate(vy.begin(), vy.end(), Generator<POSVEL_T>(25, 3));
std::generate(vz.begin(), vz.end(), Generator<POSVEL_T>(25, 3));
std::generate(phi.begin(), phi.end(), Generator<POSVEL_T>(25, 3));
std::generate(id.begin(), id.end(), Generator<ID_T>(25, 3));
std::fill(mask.begin(), mask.end(), 25);
GIO.addVariable("x", xx, CoordFlagsX | GenericIO::VarHasExtraSpace);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment