Skip to content

Commit

Permalink
clang-format file
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Nov 11, 2019
1 parent 4fc3db0 commit 90be121
Showing 1 changed file with 21 additions and 36 deletions.
57 changes: 21 additions & 36 deletions libs/checkpoint/examples/print_time_results.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,76 +16,61 @@
#include <string>

///////////////////////////////////////////////////////////////////////////////
void print_time_results(
std::uint32_t num_localities
, std::uint64_t num_os_threads
, std::uint64_t elapsed
, std::uint64_t nx
, std::uint64_t np
, std::uint64_t nt
, bool header
)
void print_time_results(std::uint32_t num_localities,
std::uint64_t num_os_threads, std::uint64_t elapsed, std::uint64_t nx,
std::uint64_t np, std::uint64_t nt, bool header)
{
if (header)
std::cout << "Localities,OS_Threads,Execution_Time_sec,"
"Points_per_Partition,Partitions,Time_Steps\n"
<< std::flush;
"Points_per_Partition,Partitions,Time_Steps\n"
<< std::flush;

std::string const locs_str = hpx::util::format("{},", num_localities);
std::string const threads_str = hpx::util::format("{},", num_os_threads);
std::string const nx_str = hpx::util::format("{},", nx);
std::string const np_str = hpx::util::format("{},", np);
std::string const nt_str = hpx::util::format("{} ", nt);

hpx::util::format_to(std::cout, "{:-6} {:-6} {:.14g}, {:-21} {:-21} {:-21}\n",
locs_str, threads_str, elapsed / 1e9, nx_str, np_str,
nt_str) << std::flush;
hpx::util::format_to(std::cout,
"{:-6} {:-6} {:.14g}, {:-21} {:-21} {:-21}\n", locs_str, threads_str,
elapsed / 1e9, nx_str, np_str, nt_str)
<< std::flush;
}

///////////////////////////////////////////////////////////////////////////////
void print_time_results(
std::uint64_t num_os_threads
, std::uint64_t elapsed
, std::uint64_t nx
, std::uint64_t np
, std::uint64_t nt
, bool header
)
void print_time_results(std::uint64_t num_os_threads, std::uint64_t elapsed,
std::uint64_t nx, std::uint64_t np, std::uint64_t nt, bool header)
{
if (header)
std::cout << "OS_Threads,Execution_Time_sec,"
"Points_per_Partition,Partitions,Time_Steps\n"
<< std::flush;
"Points_per_Partition,Partitions,Time_Steps\n"
<< std::flush;

std::string const threads_str = hpx::util::format("{},", num_os_threads);
std::string const nx_str = hpx::util::format("{},", nx);
std::string const np_str = hpx::util::format("{},", np);
std::string const nt_str = hpx::util::format("{} ", nt);

hpx::util::format_to(std::cout, "{:-21} {:.14g}, {:-21} {:-21} {:-21}\n",
threads_str, elapsed / 1e9, nx_str, np_str,
nt_str) << std::flush;
threads_str, elapsed / 1e9, nx_str, np_str, nt_str)
<< std::flush;
}

void print_time_results(
std::uint64_t num_os_threads
, std::uint64_t elapsed
, std::uint64_t nx
, std::uint64_t nt
, bool header
)
void print_time_results(std::uint64_t num_os_threads, std::uint64_t elapsed,
std::uint64_t nx, std::uint64_t nt, bool header)
{
if (header)
std::cout << "OS_Threads,Execution_Time_sec,"
"Grid_Points,Time_Steps\n"
<< std::flush;
"Grid_Points,Time_Steps\n"
<< std::flush;

std::string const threads_str = hpx::util::format("{},", num_os_threads);
std::string const nx_str = hpx::util::format("{},", nx);
std::string const nt_str = hpx::util::format("{} ", nt);

hpx::util::format_to(std::cout, "{:-21} {:10.12}, {:-21} {:-21}\n",
threads_str, elapsed / 1e9, nx_str, nt_str) << std::flush;
threads_str, elapsed / 1e9, nx_str, nt_str)
<< std::flush;
}

#endif

0 comments on commit 90be121

Please sign in to comment.