Skip to content

Commit

Permalink
dont use trimean in exchange-strong
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed Aug 17, 2020
1 parent 79bdfcb commit d151a93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ add_executable(exchange-weak exchange_weak.cu)
target_link_libraries(exchange-weak stencil::stencil)
add_args(exchange-weak)

add_executable(exchange-strong exchange_strong.cu statistics.cpp)
add_executable(exchange-strong exchange_strong.cu)
target_link_libraries(exchange-strong stencil::stencil)
add_args(exchange-strong)

Expand Down
26 changes: 10 additions & 16 deletions bin/exchange_strong.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <nvToolsExt.h>

#include "statistics.hpp"

#include "argparse/argparse.hpp"
#include "stencil/stencil.hpp"

Expand Down Expand Up @@ -79,7 +77,6 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}


MethodFlags methods = MethodFlags::None;
if (useStaged) {
methods = MethodFlags::CudaMpi;
Expand Down Expand Up @@ -141,19 +138,15 @@ int main(int argc, char **argv) {

MPI_Barrier(MPI_COMM_WORLD);

Statistics stats;

double elapsed = MPI_Wtime();

for (int iter = 0; iter < nIters; ++iter) {
if (0 == rank) {
std::cerr << "exchange " << iter << "\n";
}
dd.exchange();
elapsed = MPI_Wtime() - elapsed;
}
elapsed = MPI_Wtime() - elapsed;
MPI_Allreduce(MPI_IN_PLACE, &elapsed, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
stats.insert(elapsed);

#ifdef STENCIL_SETUP_STATS
if (0 == rank) {
Expand Down Expand Up @@ -186,15 +179,16 @@ int main(int argc, char **argv) {
// clang-format off
// same as strong.cu
// header should be
// bin,config,naive,x,y,z,s,MPI (B),Colocated (B),cudaMemcpyPeer (B),direct (B)iters,gpus,nodes,ranks,mpi_topo,node_gpus,trimean (s)
// bin,config,naive,x,y,z,s,MPI (B),Colocated (B),cudaMemcpyPeer (B),direct (B)iters,gpus,nodes,ranks,mpi_topo,node_gpus,exchange (s)
// clang-format on
printf("exchange,%s,%d,%lu,%lu,%lu,%lu," // s
"%lu,%lu,%lu,%lu," // <- exchange bytes
"%d,%d,%d,%d,%e\n",
methodStr.c_str(), useNaivePlacement, x, y, z, x * y * z, dd.exchange_bytes_for_method(MethodFlags::CudaMpi),
dd.exchange_bytes_for_method(MethodFlags::CudaMpiColocated),
dd.exchange_bytes_for_method(MethodFlags::CudaMemcpyPeer),
dd.exchange_bytes_for_method(MethodFlags::CudaKernel), nIters, numSubdoms, numNodes, size, stats.trimean());
printf(
"exchange,%s,%d,%lu,%lu,%lu,%lu," // s
"%lu,%lu,%lu,%lu," // <- exchange bytes
"%d,%d,%d,%d,%e\n",
methodStr.c_str(), useNaivePlacement, x, y, z, x * y * z, dd.exchange_bytes_for_method(MethodFlags::CudaMpi),
dd.exchange_bytes_for_method(MethodFlags::CudaMpiColocated),
dd.exchange_bytes_for_method(MethodFlags::CudaMemcpyPeer),
dd.exchange_bytes_for_method(MethodFlags::CudaKernel), nIters, numSubdoms, numNodes, size, elapsed);
}
#endif // STENCIL_EXCHANGE_STATS

Expand Down

0 comments on commit d151a93

Please sign in to comment.