Commit b1a866c3 authored by mattijs's avatar mattijs
Browse files

BUG: collated: correctly handle ascii writing. See #1545.

The collated container ('decomposedBlockData') is always binary
but the 'payload' might be ascii so use that header information
instead of the decomposeBlockData header.
parent 4e73d0e4
......@@ -658,7 +658,7 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
Pstream::scatter(ok, Pstream::msgType(), comm);
//- Set stream properties from isPtr on master
//- Set stream properties from realIsPtr on master
// Scatter master header info
string ver;
......@@ -667,12 +667,12 @@ Foam::autoPtr<Foam::ISstream> Foam::decomposedBlockData::readBlocks
unsigned scalarByteSize;
if (UPstream::master(comm))
{
ver = isPtr().version().str();
ver = realIsPtr().version().str();
OStringStream os;
os << isPtr().format();
os << realIsPtr().format();
format = os.str();
labelByteSize = isPtr().labelByteSize();
scalarByteSize = isPtr().scalarByteSize();
labelByteSize = realIsPtr().labelByteSize();
scalarByteSize = realIsPtr().scalarByteSize();
}
Pstream::scatter(ver); //, Pstream::msgType(), comm);
Pstream::scatter(format); //, Pstream::msgType(), comm);
......
  • Probably not really a bug. The arch information is only emitted for binary files since we don't want to add additional noise to ASCII files and more importantly we'd like to avoid people accidentally adding in incorrect arch information when copying across (ASCII) config files to another setup.

    However, for the decomposed blocks, there should not really be a situation in which the collated container and the payload could have different label/scalar sizes. We only support the native sizes when writing, for the ASCII payload they are simply just missing (suppressed).

  • mentioned in issue #1545 (closed)

    Toggle commit list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment