|
[Sponsors] |
codedMixed runs well on serial but crashes in parallel |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 23, 2024, 15:12 |
codedMixed runs well on serial but crashes in parallel
|
#1 |
New Member
Matias Alberto Aguirre
Join Date: Mar 2023
Posts: 12
Rep Power: 3 |
Hi foamers!
During a parallel simulation, I encounter an issue with a custom boundary condition in OpenFOAM. The boundary condition is applied to a patch (plasmaSurf) and works fine in serial runs. However, in parallel, the simulation crashes with errors related to field sizes and bad memory allocation. Key Details:
What I've Tried:
Suspected Cause: The problem seems related to how the codedMixed boundary condition handles patches with zero faces in parallel. This might be a bug in my implementation or an inconsistency in how OpenFOAM distributes the patch data. Question: How can I ensure the codedMixed boundary condition is robust to parallel runs where a patch might have zero faces on some processors? Are there best practices for handling such scenarios, or modifications needed to the codedMixed code to avoid these issues? Code Implemented: Code:
plasmaSurf { type codedMixed; namedummy_code; refValue uniform 300; refGradient uniform 0; valueFraction uniform 0; code #{ if (this->patch().size() == 0) // No faces on this processor { return; } scalarField& refGrad = this->refGrad(); scalarField& refVal = this->refValue(); scalarField& valueFraction = this->valueFraction(); // Initialize to zero or default values refGrad = scalarField(patch().size(), 0.0); refVal = scalarField(patch().size(), 300.0); valueFraction = scalarField(patch().size(), 0.0); #}; } Typical Error: Code:
[1] [1] [1] --> FOAM FATAL IO ERROR: [1] size 0 is not equal to the given value of -1871300200 [1] [1] file: IStringStream.sourceFile from line 0 to line 4. [1] [1] From function Foam::Field<Type>::Field(const Foam::word&, const Foam::dictionary&, Foam::label) [with Type = double; Foam::label = int] [1] in file /home/ubuntu/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/Field.C at line 208. [1] FOAM parallel run exiting [1] [0] [0] [0] --> FOAM FATAL ERROR: [0] bad size -534376040 [0] [0] From function void Foam::List<T>::setSize(Foam::label) [with T = double; Foam::label = int] [0] in file /home/ubuntu/OpenFOAM/OpenFOAM-11/src/OpenFOAM/lnInclude/List.C at line 285. [0] FOAM parallel run aborting [0] -------------------------------------------------------------------------- MPI_ABORT was invoked on rank 1 in communicator MPI COMMUNICATOR 3 SPLIT FROM 0 with errorcode 1. NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. -------------------------------------------------------------------------- [0] #0 Foam::error::printStack(Foam::Ostream&) |
|
Tags |
codedmixed, foamrun, parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
type limitTemperature problem | AdamRM | OpenFOAM Running, Solving & CFD | 6 | November 16, 2023 06:55 |
chtMultiRegionFoam is slower in parallel than serial | froberto | OpenFOAM Running, Solving & CFD | 2 | September 12, 2023 14:55 |
To continue from latestTime of a previous serial run in parallel | redbullah | OpenFOAM | 2 | July 26, 2018 15:01 |
Different results between parallel and serial processing | Sarah_Fluent | FLUENT | 5 | March 6, 2018 12:42 |
Moving mesh crashes in parallel (1.5-dev) | jploz | OpenFOAM Programming & Development | 8 | October 21, 2009 18:22 |