2018-03-29 19:57:41 +01:00
|
|
|
|
2018-10-15 17:25:08 +01:00
|
|
|
#include "Benchmark_IO.hpp"
|
2018-03-29 19:57:41 +01:00
|
|
|
|
|
|
|
#ifndef BENCH_IO_LMAX
|
|
|
|
#define BENCH_IO_LMAX 40
|
|
|
|
#endif
|
|
|
|
|
2018-10-15 17:25:08 +01:00
|
|
|
using namespace Grid;
|
2018-03-29 19:57:41 +01:00
|
|
|
|
2018-10-15 17:25:08 +01:00
|
|
|
std::string filestem(const int l)
|
2018-03-29 19:57:41 +01:00
|
|
|
{
|
2018-10-15 17:25:08 +01:00
|
|
|
return "iobench_l" + std::to_string(l);
|
2018-03-29 19:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main (int argc, char ** argv)
|
|
|
|
{
|
2020-05-04 18:26:20 +01:00
|
|
|
#ifdef HAVE_LIME
|
2018-03-29 19:57:41 +01:00
|
|
|
Grid_init(&argc,&argv);
|
|
|
|
|
|
|
|
int64_t threads = GridThread::GetThreads();
|
2018-10-15 17:25:08 +01:00
|
|
|
MSG << "Grid is setup to use " << threads << " threads" << std::endl;
|
|
|
|
MSG << SEP << std::endl;
|
|
|
|
MSG << "Benchmark Lime write" << std::endl;
|
|
|
|
MSG << SEP << std::endl;
|
2018-03-29 19:57:41 +01:00
|
|
|
for (int l = 4; l <= BENCH_IO_LMAX; l += 2)
|
|
|
|
{
|
2018-10-15 17:25:08 +01:00
|
|
|
auto mpi = GridDefaultMpi();
|
|
|
|
std::vector<int> latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]};
|
|
|
|
|
|
|
|
std::cout << "-- Local volume " << l << "^4" << std::endl;
|
|
|
|
writeBenchmark<LatticeFermion>(latt, filestem(l), limeWrite<LatticeFermion>);
|
2018-03-29 19:57:41 +01:00
|
|
|
}
|
|
|
|
|
2018-10-15 17:25:08 +01:00
|
|
|
MSG << "Benchmark Lime read" << std::endl;
|
|
|
|
MSG << SEP << std::endl;
|
2018-03-29 19:57:41 +01:00
|
|
|
for (int l = 4; l <= BENCH_IO_LMAX; l += 2)
|
|
|
|
{
|
2018-10-15 17:25:08 +01:00
|
|
|
auto mpi = GridDefaultMpi();
|
|
|
|
std::vector<int> latt = {l*mpi[0], l*mpi[1], l*mpi[2], l*mpi[3]};
|
|
|
|
|
|
|
|
std::cout << "-- Local volume " << l << "^4" << std::endl;
|
|
|
|
readBenchmark<LatticeFermion>(latt, filestem(l), limeRead<LatticeFermion>);
|
2018-03-29 19:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Grid_finalize();
|
2020-05-04 18:26:20 +01:00
|
|
|
#endif
|
2018-03-29 19:57:41 +01:00
|
|
|
return EXIT_SUCCESS;
|
2018-03-30 13:39:20 +01:00
|
|
|
}
|