From 0b765c0b7d5c6e1532bf0aec5cf57393b0392bf8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 3 Feb 2017 14:51:04 +0000 Subject: [PATCH] Time: when "writeFormat" is set to "binary" disallow compression Compressing and decompressing binary files introduces a significant IO overhead without a providing significant reduction in file-size. --- src/OpenFOAM/db/Time/TimeIO.C | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index 436661040..39e88a66d 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -347,6 +347,20 @@ void Foam::Time::readDict() ( controlDict_.lookup("writeCompression") ); + + if + ( + writeFormat_ == IOstream::BINARY + && writeCompression_ == IOstream::COMPRESSED + ) + { + IOWarningInFunction(controlDict_) + << "Selecting compressed binary is inefficient and ineffective" + ", resetting to uncompressed binary" + << endl; + + writeCompression_ = IOstream::UNCOMPRESSED; + } } controlDict_.readIfPresent("graphFormat", graphFormat_);