[dune-pdelab] Sending bytes in communication breaks portability
Markus Blatt
markus at dr-blatt.de
Fri Jun 27 12:10:14 CEST 2014
Hi,
sorry for the late comment, but I could not find time earlier.
This or last week there was a patch for the communication in pdelab
where both the number of data items per entity and the data itself is
send in one communication. While this is probably a good idea, the way
it is done comes at a high price (concerning
maintainability/portability).
Unfortunately, this seems to be part of the release, too.
The implementation simply writes the size and data to a char array sends
this as bytes to the other processors. Unfortunately, this will break
behaviour that people expect from MPI libraries and
applications. Namely, that sending data between processes on different
hardware platforms works. With sending bytes this is not the case
anymore and might provoke rather hard to find errors in the
computations. (E.g. the size of size_t might be different or then
endianess and as a result what we reveive might not be what we send).
While this will not occur on supercomputers it will be an issue for
people using heterogeneous clusters or clusters in the cloud.
The easiest way to do this portable is to use MPI_Pack and MPI_Unpack
to write the values. I am not sure how fast this is but at least it is
safe. I therefore propose to fix this ASAP as is this will be
forgotten and people will be bitten by it at some time.
Markus
--
Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany, USt-Id: DE279960836
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20140627/92ad283b/attachment.sig>
More information about the dune-pdelab
mailing list