View Issue Details

IDProjectCategoryView StatusLast Update
0001938OpenFOAMBugpublic2016-04-25 16:40
Reporteruser4Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSOpenSuSEOS Version12.3
Product Versiondev 
Fixed in Versiondev 
Summary0001938: upToDate checking not synchronised in parallell
Description- cacheing of grad(U) uses eventNo
- eventNo not synchronised in parallel
- so if overflow one processor might trigger update
- not synchronised -> crash
Steps To ReproduceRun attached code on e.g. pitzDaily on two processors.
TagsNo tags attached.

Activities

user4

2015-12-02 14:17

 

simpleFoam.C (2,933 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Application
    simpleFoam

Description
    Steady-state solver for incompressible, turbulent flow

\*---------------------------------------------------------------------------*/

#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "fvIOoptionList.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"

    simpleControl simple(mesh);

    #include "createFields.H"
    #include "createMRF.H"
    #include "createFvOptions.H"
    #include "initContinuityErrs.H"


    objectRegistry::debug = 1;

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Pout<< "\nStarting time loop\n" << endl;

    // Increment event counter (and make sure it is different on different
    // procs)
    while (mesh.getEvent() < labelMax-2-Pstream::myProcNo());

    while (simple.loop())
    {
        Pout<< "Time = " << runTime.timeName() << nl << endl;

        Pout<< "U:" << U.eventNo() << endl;
        Pout<< "gradU:" << gradU.eventNo() << endl;

        if (!gradU.upToDate(U))
        {
            Pout<< "Triggering update of gradU" << endl;

            gradU = fvc::grad(U);

            Pout<< "After: U:" << U.eventNo() << endl;
            Pout<< "After: gradU:" << gradU.eventNo() << endl;
        }

        U.correctBoundaryConditions();

        Pout<< "updated U:" << U.eventNo() << endl;

        Pout<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
            << nl << endl;
    }

    Info<< "End\n" << endl;

    return 0;
}


// ************************************************************************* //
simpleFoam.C (2,933 bytes)   

henry

2016-04-20 21:06

manager   ~0006145

Can you provide a patch to correct this problem? I have not seen the issue arise on any cases I have run.

MattijsJ

2016-04-21 20:17

reporter   ~0006152

Last edited: 2016-04-21 20:21

Bit more info
- The problem only comes up after running huge number of iterations.
- the upToDate checking (event counter) is local only and cannot be parallel consistent
- the issue comes up if the event counter overruns and starts from zero and this gets flagged as out-of-date. This still is not a problem (just some additional evaluation) but it might be a problem in parallel if another processor does not yet overflow.
- solutions:
1) handle event counter overflow
2) go through code and avoid excessive event number generation (better).

henry

2016-04-21 20:28

manager   ~0006153

Do you have a patch for either solution?

MattijsJ

2016-04-22 11:29

reporter  

henry

2016-04-25 16:40

manager   ~0006172

Resolved by commit a4e2afa4b39e2f33f7b66051844cccf0296be520

Issue History

Date Modified Username Field Change
2015-12-02 14:17 user4 New Issue
2015-12-02 14:17 user4 File Added: simpleFoam.C
2016-04-20 21:06 henry Note Added: 0006145
2016-04-21 20:17 MattijsJ Note Added: 0006152
2016-04-21 20:21 MattijsJ Note Edited: 0006152
2016-04-21 20:28 henry Note Added: 0006153
2016-04-22 11:29 MattijsJ File Added: forAllBoundaryField.sed
2016-04-25 16:40 henry Note Added: 0006172
2016-04-25 16:40 henry Status new => resolved
2016-04-25 16:40 henry Fixed in Version => dev
2016-04-25 16:40 henry Resolution open => fixed
2016-04-25 16:40 henry Assigned To => henry