From aa2d88ee2fea99ff29efe244ebba925514d200a5 Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Tue, 14 Sep 2021 13:27:32 +0200 Subject: [PATCH] Fix the problem with MPI_Request --- atrip.org | 21 ++++++++------------- include/atrip/SliceUnion.hpp | 2 +- include/atrip/Unions.hpp | 19 +++++++------------ 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/atrip.org b/atrip.org index 5fd9b9d..3343246 100644 --- a/atrip.org +++ b/atrip.org @@ -1046,7 +1046,7 @@ namespace atrip { if (slice.info.state == Slice::Fetch) { // TODO: do it through the slice class slice.info.state = Slice::Dispatched; - MPI_Request request = nullptr; + MPI_Request request; slice.request = request; MPI_Irecv( slice.data , slice.size @@ -1280,10 +1280,9 @@ namespace atrip { void sliceIntoBuffer(size_t it, Tensor &to, Tensor const& from) override { - const int rank = Atrip::rank - , Nv = sliceLength[0] + const int Nv = sliceLength[0] , No = sliceLength[1] - , a = rankMap.find({static_cast(rank), it}); + , a = rankMap.find({static_cast(Atrip::rank), it}); ; @@ -1319,9 +1318,8 @@ namespace atrip { void sliceIntoBuffer(size_t it, Tensor &to, Tensor const& from) override { - const int rank = Atrip::rank - , No = sliceLength[0] - , a = rankMap.find({static_cast(rank), it}) + const int No = sliceLength[0] + , a = rankMap.find({static_cast(Atrip::rank), it}) ; sliceIntoVector( sources[it] @@ -1357,8 +1355,7 @@ namespace atrip { const int Nv = sliceLength[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ; @@ -1396,8 +1393,7 @@ namespace atrip { const int Nv = from.lens[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ; @@ -1437,8 +1433,7 @@ namespace atrip { const int Nv = from.lens[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ; diff --git a/include/atrip/SliceUnion.hpp b/include/atrip/SliceUnion.hpp index 922287d..66d149e 100644 --- a/include/atrip/SliceUnion.hpp +++ b/include/atrip/SliceUnion.hpp @@ -453,7 +453,7 @@ namespace atrip { if (slice.info.state == Slice::Fetch) { // TODO: do it through the slice class slice.info.state = Slice::Dispatched; - MPI_Request request = nullptr; + MPI_Request request; slice.request = request; MPI_Irecv( slice.data , slice.size diff --git a/include/atrip/Unions.hpp b/include/atrip/Unions.hpp index 8961a21..de924ee 100644 --- a/include/atrip/Unions.hpp +++ b/include/atrip/Unions.hpp @@ -63,10 +63,9 @@ namespace atrip { void sliceIntoBuffer(size_t it, Tensor &to, Tensor const& from) override { - const int rank = Atrip::rank - , Nv = sliceLength[0] + const int Nv = sliceLength[0] , No = sliceLength[1] - , a = rankMap.find({static_cast(rank), it}); + , a = rankMap.find({static_cast(Atrip::rank), it}); ; @@ -102,9 +101,8 @@ namespace atrip { void sliceIntoBuffer(size_t it, Tensor &to, Tensor const& from) override { - const int rank = Atrip::rank - , No = sliceLength[0] - , a = rankMap.find({static_cast(rank), it}) + const int No = sliceLength[0] + , a = rankMap.find({static_cast(Atrip::rank), it}) ; sliceIntoVector( sources[it] @@ -140,8 +138,7 @@ namespace atrip { const int Nv = sliceLength[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ; @@ -179,8 +176,7 @@ namespace atrip { const int Nv = from.lens[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ; @@ -220,8 +216,7 @@ namespace atrip { const int Nv = from.lens[0] , No = sliceLength[1] - , rank = Atrip::rank - , el = rankMap.find({static_cast(rank), it}) + , el = rankMap.find({static_cast(Atrip::rank), it}) , a = el % Nv , b = el / Nv ;