boost::uint64_t average_out_parallel(std::size_t vector_size) { boost::uint64_t start = hpx::util::high_resolution_clock::now(); // average out 100 executions to avoid varying results for(auto i = 0; i < test_count; i++) measure_parallel_foreach(vector_size); return (hpx::util::high_resolution_clock::now() - start) / test_count; }
int hpx_main(boost::program_options::variables_map& vm) { //pull values from cmd std::size_t vector_size = vm["vector_size"].as<std::size_t>(); chunk_size = vm["chunk_size"].as<int>(); //verify that input is within domain of program if(test_count == 0 || test_count < 0) { hpx::cout << "test_count cannot be zero or negative...\n" << hpx::flush; } else if (delay < 0) { hpx::cout << "delay cannot be a negative number...\n" << hpx::flush; } else { boost::uint64_t t=hpx::util::high_resolution_clock::now(); measure_parallel_foreach(vector_size); boost::uint64_t elapsed=hpx::util::high_resolution_clock::now()-t; std::cout<<(boost::format("%.14g")%(elapsed/ 1e9)) <<std::flush<<std::endl; } return hpx::finalize(); }