From 97ae2721ec6672fa26b0e3c7f8d2249d079f2343 Mon Sep 17 00:00:00 2001
From: Rafael Ravedutti <rafaelravedutti@gmail.com>
Date: Wed, 20 Dec 2023 18:37:06 +0100
Subject: [PATCH] Refactoring

Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
---
 runtime/domain/regular_6d_stencil.cpp |  2 --
 runtime/pairs.cpp                     | 11 -----------
 2 files changed, 13 deletions(-)

diff --git a/runtime/domain/regular_6d_stencil.cpp b/runtime/domain/regular_6d_stencil.cpp
index d1cec87..b01d2c7 100644
--- a/runtime/domain/regular_6d_stencil.cpp
+++ b/runtime/domain/regular_6d_stencil.cpp
@@ -111,8 +111,6 @@ void Regular6DStencil::fillArrays(int *neighbor_ranks, int *pbc, real_t *subdom)
 }
 
 void Regular6DStencil::communicateSizes(int dim, const int *send_sizes, int *recv_sizes) {
-    //std::cout << "communicateSizes" << std::endl;
-
     if(prev[dim] != rank) {
         MPI_Send(&send_sizes[dim * 2 + 0], 1, MPI_INT, prev[dim], 0, MPI_COMM_WORLD);
         MPI_Recv(&recv_sizes[dim * 2 + 0], 1, MPI_INT, next[dim], 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
diff --git a/runtime/pairs.cpp b/runtime/pairs.cpp
index 2639377..f3d5673 100644
--- a/runtime/pairs.cpp
+++ b/runtime/pairs.cpp
@@ -376,16 +376,6 @@ void PairsSimulation::communicateData(
         nrecv_all += nrecv[d * 2 + 1];
     }
 
-    /*
-    // TODO: this is hard-coded for 6D regular stencil, change it
-    int snd_offset = send_offsets[dim * 2 + 0] * elem_size * sizeof(real_t);
-    int rcv_offset = recv_offsets[dim * 2 + 0] * elem_size * sizeof(real_t);
-    int snd_size = (nsend[dim * 2 + 0] + nsend[dim * 2 + 1]) * elem_size * sizeof(real_t);
-    int rcv_size = (nrecv[dim * 2 + 0] + nrecv[dim * 2 + 1]) * elem_size * sizeof(real_t);
-
-    copyArraySliceToHost(send_buf_array, Ignore, snd_offset, snd_size * elem_size * sizeof(real_t));
-    */
-
     copyArrayToHost(send_buf_id, Ignore, nsend_all * elem_size * sizeof(real_t));
     array_flags->setHostFlag(recv_buf_id);
     array_flags->clearDeviceFlag(recv_buf_id);
@@ -400,7 +390,6 @@ void PairsSimulation::communicateData(
 
     #ifndef ENABLE_CUDA_AWARE_MPI
     this->getTimers()->start(DeviceTransfers);
-    //copyArraySliceToDevice(recv_buf_array, Ignore, rcv_offset, rcv_size * elem_size * sizeof(real_t));
     copyArrayToDevice(recv_buf_id, Ignore, nrecv_all * elem_size * sizeof(real_t));
     this->getTimers()->stop(DeviceTransfers);
     #endif
-- 
GitLab