From d0efcd1d3183caf3768cf78f2bca4d0f40f65537 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 21 May 2024 08:18:18 -0600 Subject: [PATCH 1/4] MPI_Request_free instead of just setting var to null --- src/interface/swarm_comms.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface/swarm_comms.cpp b/src/interface/swarm_comms.cpp index 67bff0a69565..ed797331eddf 100644 --- a/src/interface/swarm_comms.cpp +++ b/src/interface/swarm_comms.cpp @@ -644,7 +644,9 @@ void Swarm::ResetCommunication() { #ifdef MPI_PARALLEL for (int n = 0; n < pmb->neighbors.size(); n++) { NeighborBlock &nb = pmb->neighbors[n]; - vbswarm->bd_var_.req_send[nb.bufid] = MPI_REQUEST_NULL; + if (vbswarm->bd_var_.req_send[nb.bufid] != MPI_REQUEST_NULL) { + MPI_Request_Free(vbswarm->bd_var_.req_send[nb.bufid]); + } } #endif From e207e630790988c19f2f04caed8dd67be2995719 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 21 May 2024 08:21:25 -0600 Subject: [PATCH 2/4] CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f80b56f73e3e..c5faad1ecba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ## Current develop ### Added (new features/APIs/variables/...) -- [[PR1020]](https://github.com/parthenon-hpc-lab/parthenon/pull/1020) Add bi- and trilinear interpolation routines +- [[PR 1084]](https://github.com/parthenon-hpc-lab/parthenon/pull/1084) Properly free swarm boundary MPI requests +- [[PR 1020]](https://github.com/parthenon-hpc-lab/parthenon/pull/1020) Add bi- and trilinear interpolation routines - [[PR 1026]](https://github.com/parthenon-hpc-lab/parthenon/pull/1026) Particle BCs without relocatable device code - [[PR 1037]](https://github.com/parthenon-hpc-lab/parthenon/pull/1037) Add SwarmPacks - [[PR 1068]](https://github.com/parthenon-hpc-lab/parthenon/pull/1068) Add ability to dump sparse pack contents as a string From 1ab803370554bd1312754425902536e55e2d9665 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 21 May 2024 08:22:11 -0600 Subject: [PATCH 3/4] pointer --- src/interface/swarm_comms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/swarm_comms.cpp b/src/interface/swarm_comms.cpp index ed797331eddf..2639d042dfc9 100644 --- a/src/interface/swarm_comms.cpp +++ b/src/interface/swarm_comms.cpp @@ -645,7 +645,7 @@ void Swarm::ResetCommunication() { for (int n = 0; n < pmb->neighbors.size(); n++) { NeighborBlock &nb = pmb->neighbors[n]; if (vbswarm->bd_var_.req_send[nb.bufid] != MPI_REQUEST_NULL) { - MPI_Request_Free(vbswarm->bd_var_.req_send[nb.bufid]); + MPI_Request_Free(&(vbswarm->bd_var_.req_send[nb.bufid])); } } #endif From 4d133ed5ee35815fb0aa9426853a663855f5e872 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Tue, 21 May 2024 08:45:47 -0600 Subject: [PATCH 4/4] I cant compile in my head :( --- src/interface/swarm_comms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/swarm_comms.cpp b/src/interface/swarm_comms.cpp index 2639d042dfc9..d63a4e75a23a 100644 --- a/src/interface/swarm_comms.cpp +++ b/src/interface/swarm_comms.cpp @@ -645,7 +645,7 @@ void Swarm::ResetCommunication() { for (int n = 0; n < pmb->neighbors.size(); n++) { NeighborBlock &nb = pmb->neighbors[n]; if (vbswarm->bd_var_.req_send[nb.bufid] != MPI_REQUEST_NULL) { - MPI_Request_Free(&(vbswarm->bd_var_.req_send[nb.bufid])); + MPI_Request_free(&(vbswarm->bd_var_.req_send[nb.bufid])); } } #endif