diff --git a/src/include/array/array_base.h b/src/include/array/array_base.h index 97e48a7..bf529d5 100644 --- a/src/include/array/array_base.h +++ b/src/include/array/array_base.h @@ -149,6 +149,19 @@ namespace CNORXZ /** check if container views the data, i.e. it does not own it */ virtual bool isView() const = 0; + /** Perform compatibility checks + @tparam Acc index type or index pack type + @param acc index or index pack. + */ + template + void checkFormatCompatibility(const Acc& acc) const; + + /** check if format is trivial + @return true if container is data owning array, else return + result of the corresponding container index + */ + virtual bool formatIsTrivial() const = 0; + protected: RangePtr mRange; /**< the container range */ @@ -171,18 +184,6 @@ namespace CNORXZ template const_iterator itLexSave(const Acc& acc) const; - /** Perform compatibility checks - @tparam Acc index type or index pack type - @param acc index or index pack. - */ - template - void checkFormatCompatibility(const Acc& acc) const; - - /** check if format is trivial - @return true if container is data owning array, else return - result of the corresponding container index - */ - virtual bool formatIsTrivial() const = 0; }; /** **** diff --git a/src/opt/mpi/include/rarray.cc.h b/src/opt/mpi/include/rarray.cc.h index 9d67dee..3d84b5a 100644 --- a/src/opt/mpi/include/rarray.cc.h +++ b/src/opt/mpi/include/rarray.cc.h @@ -221,14 +221,13 @@ namespace CNORXZ } template - template - void RCArray::load(const Sptr& lpi, const Sptr& ai, - const Sptr>& imap) const + template + void RCArray::load(const Sptr>& lpi, const Sptr>& ai, + const Sptr& i, const Sptr>& imap) const { - // TODO: blocks!!! - const SizeT blocks = 0; assert(0); // TODO!!! - - setupBuffer(ai, lpi, imap, *mA, mBuf, mMap, blocks); + mA->checkFormatCompatibility(ai->local()*i); + const SizeT blocks = i->pmax().val(); + setupBuffer(lpi, ai, imap, *mA, mBuf, mMap, blocks); } template @@ -242,7 +241,7 @@ namespace CNORXZ } template - void setupBuffer(const Sptr>& rgj, const Sptr>& rgi, + void setupBuffer(const Sptr>& rgi, const Sptr>& rgj, const Sptr>& imap, const CArrayBase& data, Vector& buf, Vector& map, const SizeT blocks) { diff --git a/src/opt/mpi/include/rarray.h b/src/opt/mpi/include/rarray.h index 3766e0e..c0414d0 100644 --- a/src/opt/mpi/include/rarray.h +++ b/src/opt/mpi/include/rarray.h @@ -117,15 +117,16 @@ namespace CNORXZ */ const Vector buffermap() const; - /** Load all data from other ranks that is accessed by i2 in a loop over i1. - imap indicates the position of i2 for a given position of i1. - @param lpi Loop index. - @param ai Access index. + /** Load all data from other ranks that is accessed by ai in a loop over lpi. + imap indicates the global (!) position of ai for a given (local) position of lpi. + @param lpi Loop rank index. + @param ai Access rank index. + @param i Index for non-ranked dimensions. @param imap Index position map. */ - template - void load(const Sptr& lpi, const Sptr& ai, - const Sptr>& imap) const; + template + void load(const Sptr>& lpi, const Sptr>& ai, + const Sptr& i, const Sptr>& imap) const; /** Load all data from other ranks that is accessed by f(i). @param lpi Loop index.