#include "Benchmark_IO.hpp" using namespace Grid; int main (int argc, char ** argv) { std::vector dir; unsigned int Ls; bool rb; if (argc < 4) { std::cerr << "usage: " << argv[0] << " [ ... ] [Grid options]"; std::cerr << std::endl; } Ls = std::stoi(argv[1]); rb = (std::string(argv[2]) == "1"); for (unsigned int i = 3; i < argc; ++i) { std::string a = argv[i]; if (a[0] != '-') { dir.push_back(std::string(argv[i])); } else { break; } } Grid_init(&argc,&argv); int64_t threads = GridThread::GetThreads(); auto mpi = GridDefaultMpi(); MSG << "Grid is setup to use " << threads << " threads" << std::endl; MSG << "MPI partition " << mpi << std::endl; MSG << SEP << std::endl; MSG << "Benchmark Grid std write" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; writeBenchmark(GridDefaultLatt(), d + "/ioBench", stdWrite, Ls, rb); } MSG << SEP << std::endl; MSG << "Benchmark Grid std read" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; readBenchmark(GridDefaultLatt(), d + "/ioBench", stdRead, Ls, rb); } #ifdef HAVE_LIME MSG << SEP << std::endl; MSG << "Benchmark Grid C-Lime write" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; writeBenchmark(GridDefaultLatt(), d + "/ioBench", limeWrite, Ls, rb); } MSG << SEP << std::endl; MSG << "Benchmark Grid C-Lime read" << std::endl; MSG << SEP << std::endl; for (auto &d: dir) { MSG << "-- Directory " << d << std::endl; readBenchmark(GridDefaultLatt(), d + "/ioBench", limeRead, Ls, rb); } #endif // MSG << SEP << std::endl; // MSG << "Benchmark single precision Lime write" << std::endl; // MSG << SEP << std::endl; // for (auto &d: dir) // { // MSG << "-- Directory " << d << std::endl; // writeBenchmark(GridDefaultLatt(), d + "/ioBench", limeWrite, Ls, rb); // } // MSG << SEP << std::endl; // MSG << "Benchmark single precision Lime read" << std::endl; // MSG << SEP << std::endl; // for (auto &d: dir) // { // MSG << "-- Directory " << d << std::endl; // readBenchmark(GridDefaultLatt(), d + "/ioBench", limeRead, Ls, rb); // } Grid_finalize(); return EXIT_SUCCESS; }