1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 15:55:37 +00:00
Grid/benchmarks/Benchmark_IO.cc

48 lines
1.2 KiB
C++
Raw Normal View History

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)
{
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();
return EXIT_SUCCESS;
2018-03-30 13:39:20 +01:00
}