Skip to content

Commit

Permalink
Remove unused function; Redirect function to a newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
cscjlan committed Nov 12, 2024
1 parent fc65291 commit 69050e0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ template <typename T, int32_t stencil> class FsGrid {
std::vector<T>& getData() { return data; }
const std::vector<T>& getData() const { return data; }

void copyData(FsGrid& other) {
// Copy assignment
data = other.getData();
}

bool localIdInBounds(LocalID id) const { return 0 <= id && (size_t)id < data.size(); }

T* get(LocalID id) {
Expand Down Expand Up @@ -430,7 +425,7 @@ template <typename T, int32_t stencil> class FsGrid {

/*! Perform ghost cell communication.
*/
void updateGhostCells() {
template <typename D> void updateGhostCells(D& data) {
if (rank == -1) {
return;
}
Expand Down Expand Up @@ -468,6 +463,8 @@ template <typename T, int32_t stencil> class FsGrid {
"Synchronization at ghost cell update failed");
}

void updateGhostCells() { updateGhostCells(data); }

/*! Perform an MPI_Allreduce with this grid's internal communicator
* Function syntax is identical to MPI_Allreduce, except the final (communicator
* argument will not be needed) */
Expand All @@ -491,10 +488,9 @@ template <typename T, int32_t stencil> class FsGrid {
* \return a task for the grid's cartesian communicator
*/
Task_t getTaskForGlobalID(GlobalID id) const {
const auto taskIndex = coordinates.globalIdToTaskPos(id);
const auto taskPos = coordinates.globalIdToTaskPos(id);
Task_t taskID = -1;
FSGRID_MPI_CHECK(MPI_Cart_rank(comm3d, taskIndex.data(), &taskID), "Unable to find FsGrid rank for global ID ",
id);
FSGRID_MPI_CHECK(MPI_Cart_rank(comm3d, taskPos.data(), &taskID), "Unable to find FsGrid rank for global ID ", id);

return taskID;
}
Expand Down

0 comments on commit 69050e0

Please sign in to comment.