View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002315 | OpenFOAM | Bug | public | 2016-11-01 16:05 | 2016-11-05 21:22 |
Reporter | ilyapopov | Assigned To | henry | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | Linux Ubuntu | OS Version | 16.10 |
Summary | 0002315: lagrangian Particle Tracking hangs in parallel | ||||
Description | I was working with lagrangian particle tracking. In parallel simulation, sometimes we encountered a hang up or a crash. The problem appears to depend on decomposition and initial position relative to processor boundaries. There is no problem detected when running on single CPU. I was able to reproduce the problem on several systems, including Ubuntu 16.04 and 16.10, RHEL and on both OpenFOAM 3.0.x and 4.x. Small reproduction case attached. It works in serial and hangs in parallel. | ||||
Steps To Reproduce | Unpack the case and run ./run_parallel.sh The simulation hangs on the first time step. | ||||
Tags | No tags attached. | ||||
|
|
|
@ilyapopov: This is excellent! I stumbled on this bug a couple of weeks ago, I've had the fix for it stuck in my time-schedule because I was missing a unit test case which which to double-check if the fix worked as intended. You case is what I was missing! In attachment is the file "Cloud.C.4.x" meant for updating the file "src/lagrangian/basic/Cloud/Cloud.C". After you replace the one you have in OpenFOAM 4.x, please run "Allwmake" in the main OpenFOAM-4.x folder so that all dependencies are updated accordingly. Then please let us know if this also works for your other case(s) as well, not just this test unit. I'll have the updated file for OpenFOAM-dev as well in a few minutes, after I've tested it without and with the patch, to see if it's actually working or not. ---- Background description of the actual bug and fix: Attached is also the file "Cloud.C.patch" which provides the summary of changes needed, which is essentially a missing check on the flag "td.switchProcessor". Without this check, the particles that land exactly on a face that is shared between 2 or more processors, ends up getting caught in a constant switching between processors, hence the infinite loop we witnessed. The weird part is that once the particle lands on another processor subdomain, it was meant to keep travelling on that other processor... problem is when the particle is not meant to continue travelling for the current global time step, which is why it gets stuck in an infinite loop. |
|
Cloud.C.patch (776 bytes)
diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index 4bbfc9f..7bbbc91 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -261,7 +261,12 @@ void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime) { // If we are running in parallel and the particle is on a // boundary face - if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces()) + if + ( + Pstream::parRun() + && td.switchProcessor + && p.face() >= pMesh().nInternalFaces() + ) { label patchi = pbm.whichPatch(p.face()); |
|
|
|
Attached is the file "Cloud.C_dev" for OpenFOAM-dev, synced to commit 2d3ddd4204934ffb39d4377ba3e74c45dee41558. This updated file was tested successfully with the attached case and OpenFOAM-dev too. |
|
Thank you very much for your quick reply! I will test the fix on the real case today. |
|
Thanks Bruno Resolved in OpenFOAM-4.x by commit 61195404f7cd198407ad068f45a14eba5e348491 Resolved in OpenFOAM-dev by commit 379c16d410f96b4671d7b3c368828044151ab515 |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-11-01 16:05 | ilyapopov | New Issue | |
2016-11-01 16:05 | ilyapopov | File Added: minimal.tgz | |
2016-11-01 18:41 | wyldckat | File Added: Cloud.C_4.x | |
2016-11-01 18:41 | wyldckat | Note Added: 0007084 | |
2016-11-01 18:41 | wyldckat | File Added: Cloud.C.patch | |
2016-11-01 21:37 | wyldckat | File Added: Cloud.C_dev | |
2016-11-01 21:39 | wyldckat | Note Added: 0007085 | |
2016-11-02 08:32 | ilyapopov | Note Added: 0007086 | |
2016-11-05 21:22 | henry | Assigned To | => henry |
2016-11-05 21:22 | henry | Status | new => resolved |
2016-11-05 21:22 | henry | Resolution | open => fixed |
2016-11-05 21:22 | henry | Fixed in Version | => 4.x |
2016-11-05 21:22 | henry | Note Added: 0007109 |