[Dune] A question on CollectiveCommunication

Jö Fahlke jorrit at jorrit.de
Mon Jan 19 17:41:52 CET 2015


Am Mon, 19. Jan 2015, 17:19:16 +0100 schrieb Aleksejs Fomins:
> Thank you for your replies, they are very useful.
> 
> There is still 1 thing I do not understand.
> 
> You say I can communicate a vector using &A[0]. Does this also apply
> to the DataHandle interface? Because in DataHandle the message buffer
> read() and write() only take 1 argument of type T. How would it then
> know the length of the array, given that it is not explicitly
> specified that T is an array?

When gather() is called on your data handle, just stuff all vector entries in
a loop into the message buffer.  When scatter is called, you can similarly
extract all items in a loop.  The number of items is passed as the last
argument to scatter().

You have to return false from the fixedsize() method of your data handle
though, otherwise the communication scheme assumes the number of items
communicated is the same (and given by the size() method on the data handle)
for each mesh element.

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

Der Horizont vieler Menschen ist ein Kreis mit Radius Null - und das
nennen sie ihren Standpunkt.
-- A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150119/5c9b5378/attachment.sig>


More information about the Dune mailing list