数值风云

openFOAM并行计算遇到问题

各位大佬,
我在运行tutorials自带的solitary算例时,无法并行计算,其报错如下

mpirun -np 2 interFoam -parallel
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2006                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v2006 OPENFOAM=2006 patch=200727
Arch   : "LSB;label=32;scalar=64"
Exec   : interFoam -parallel
Date   : Aug 07 2021
Time   : 12:59:20
Host   : dyfluid
PID    : 8771
I/O    : uncollated
Case   : /home/dyfluid/OpenFOAM/OpenFOAM-v2006/tutorials/multiphase/interFoam/laminar/waves/mangroveInteraction
nProcs : 2
Hosts  :
(
    (dyfluid 2)
)
Pstream initialized with:
    floatTransfer      : 0
    nProcsSimpleSum    : 0
    commsType          : nonBlocking
    polling iterations : 0
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
RAS
{
    RASModel        kEpsilon;
    turbulence      on;
    printCoeffs     on;
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              0;
    sigmak          1;
    sigmaEps        1.3;
}


Reading g

Reading hRef
Calculating field g.h

No MRF models present

Creating finite volume options from "system/fvOptions"

Selecting finite volume options type multiphaseMangrovesSource
    Source: Mangroves
Selecting finite volume options type multiphaseMangrovesTurbulenceModel
    Source: TurbulenciaMangroves
DICPCG:  Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

Reading set description:
    s1
    s2
    s3
    s4
    s5
    s6
    s7
    s8
    s9
    s10

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.01
Time = 0.01

PIMPLE: iteration 1
Selecting waveModel Boussinesq
[1] #0  Foam::error::printStack(Foam::Ostream&)[0] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
 at ??:?
[0] #1  Foam::sigFpe::sigHandler(int)[1] #1  Foam::sigSegv::sigHandler(int) at ??:?
[0] #2  ? at ??:?
[1] #2  ? in /lib/x86_64-linux-gnu/libpthread.so.0
[1] #3   in /lib/x86_64-linux-gnu/libpthread.so.0
[0] #3  Foam::waveModels::solitaryWaveModel::solitaryWaveModel(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&, bool)Foam::waveModels::solitaryWaveModel::solitaryWaveModel(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&, bool) at ??:?
[0] #4   at ??:?
Foam::waveModels::Boussinesq::Boussinesq(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&, bool)[1] #4  Foam::waveModels::Boussinesq::Boussinesq(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&, bool) at ??:?
[1] #5   at ??:?
Foam::waveModel::addpatchConstructorToTable<Foam::waveModels::Boussinesq>::New(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&)[0] #5  Foam::waveModel::addpatchConstructorToTable<Foam::waveModels::Boussinesq>::New(Foam::dictionary const&, Foam::fvMesh const&, Foam::polyPatch const&) at ??:?
[1] #6   at ??:?
[0] #6  Foam::waveModel::New(Foam::word const&, Foam::fvMesh const&, Foam::polyPatch const&)Foam::waveModel::New(Foam::word const&, Foam::fvMesh const&, Foam::polyPatch const&) at ??:?
[1] #7   at ??:?
Foam::waveModel::lookupOrCreate(Foam::polyPatch const&, Foam::fvMesh const&, Foam::word const&)[0] #7  Foam::waveModel::lookupOrCreate(Foam::polyPatch const&, Foam::fvMesh const&, Foam::word const&) at ??:?
 at ??:?
[1] #8  [0] #8  Foam::waveAlphaFvPatchScalarField::updateCoeffs()Foam::waveAlphaFvPatchScalarField::updateCoeffs() at ??:?
[0]  at #9  ??:?
[1] #9  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::evaluate()Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::evaluate() in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[0] #10   in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[1] #10  ?? in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[0] #11   in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[1] #11  ?? in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[1] #12  __libc_start_main in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[0] #12  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
[1] #13   in /lib/x86_64-linux-gnu/libc.so.6
[0] #13  ?? in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[dyfluid:08772] *** Process received signal ***
[dyfluid:08772] Signal: Segmentation fault (11)
[dyfluid:08772] Signal code:  (-6)
[dyfluid:08772] Failing at address: 0x3e800002244
[dyfluid:08772] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f8e6b8633c0]
[dyfluid:08772] [ 1] /lib/x86_64-linux-gnu/libpthread.so.0(raise+0xcb)[0x7f8e6b86324b]
[dyfluid:08772] [ 2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f8e6b8633c0]
[dyfluid:08772] [ 3] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam10waveModels17solitaryWaveModelC1ERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchEb+0x62c)[0x7f8e6c76b18c]
[dyfluid:08772] [ 4] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam10waveModels10BoussinesqC1ERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchEb+0x19)[0x7f8e6c76d0d9]
[dyfluid:08772] [ 5] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel26addpatchConstructorToTableINS_10waveModels10BoussinesqEE3NewERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchE+0x3d)[0x7f8e6c76d5cd]
[dyfluid:08772] [ 6] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel3NewERKNS_4wordERKNS_6fvMeshERKNS_9polyPatchE+0x66d)[0x7f8e6c7668dd]
[dyfluid:08772] [ 7] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel14lookupOrCreateERKNS_9polyPatchERKNS_6fvMeshERKNS_4wordE+0xd3)[0x7f8e6c7671c3]
[dyfluid:08772] [ 8] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam27waveAlphaFvPatchScalarField12updateCoeffsEv+0x82)[0x7f8e6c790d32]
[dyfluid:08772] [ 9] interFoam(_ZN4Foam14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEE8Boundary8evaluateEv+0x23c)[0x55db1563a08c]
[dyfluid:08772] [10] interFoam(+0x60269)[0x55db15629269]
[dyfluid:08772] [11] interFoam(+0x5418b)[0x55db1561d18b]
[dyfluid:08772] [12] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f8e6b6830b3]
[dyfluid:08772] [13] interFoam(+0x5c24e)[0x55db1562524e]
[dyfluid:08772] *** End of error message ***
 in ~/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/bin/interFoam
[dyfluid:08771] *** Process received signal ***
[dyfluid:08771] Signal: Floating point exception (8)
[dyfluid:08771] Signal code:  (-6)
[dyfluid:08771] Failing at address: 0x3e800002243
[dyfluid:08771] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fd2358ec3c0]
[dyfluid:08771] [ 1] /lib/x86_64-linux-gnu/libpthread.so.0(raise+0xcb)[0x7fd2358ec24b]
[dyfluid:08771] [ 2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fd2358ec3c0]
[dyfluid:08771] [ 3] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam10waveModels17solitaryWaveModelC1ERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchEb+0x648)[0x7fd2367f41a8]
[dyfluid:08771] [ 4] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam10waveModels10BoussinesqC1ERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchEb+0x19)[0x7fd2367f60d9]
[dyfluid:08771] [ 5] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel26addpatchConstructorToTableINS_10waveModels10BoussinesqEE3NewERKNS_10dictionaryERKNS_6fvMeshERKNS_9polyPatchE+0x3d)[0x7fd2367f65cd]
[dyfluid:08771] [ 6] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel3NewERKNS_4wordERKNS_6fvMeshERKNS_9polyPatchE+0x66d)[0x7fd2367ef8dd]
[dyfluid:08771] [ 7] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam9waveModel14lookupOrCreateERKNS_9polyPatchERKNS_6fvMeshERKNS_4wordE+0xd3)[0x7fd2367f01c3]
[dyfluid:08771] [ 8] /home/dyfluid/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib/libwaveModels.so(_ZN4Foam27waveAlphaFvPatchScalarField12updateCoeffsEv+0x82)[0x7fd236819d32]
[dyfluid:08771] [ 9] interFoam(_ZN4Foam14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEE8Boundary8evaluateEv+0x23c)[0x562a5b58a08c]
[dyfluid:08771] [10] interFoam(+0x60269)[0x562a5b579269]
[dyfluid:08771] [11] interFoam(+0x5418b)[0x562a5b56d18b]
[dyfluid:08771] [12] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fd23570c0b3]
[dyfluid:08771] [13] interFoam(+0x5c24e)[0x562a5b57524e]
[dyfluid:08771] *** End of error message ***
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 0 on node dyfluid exited on signal 11 (Segmentation fault).

这个算例位于tutorials/multiphase/interFoam/laminar/waves/solitary,其他波浪算例均可并行计算,只有与孤立波相关的算例无法并行计算,想请教各位,是哪里出了问题呢?
我的OS是Ubuntu20.04LTS,OF version是ofv-2006
Ubuntu原始的编译器,openmpi等都正常,算例连接如下solitary 0807.zip (9.2 KB)

这个可能是个bug。可能大量算波浪的人也不会用自带库。

感谢汪博回复!
我也向官方反映这个问题了,@kuti 说可能是OS的问题,@kuti用的是openSUSE以及clang编译器,我正在尝试在openSUSE上编译OpenFOAM,试一下效果。
另外,我对linux系统了解甚浅,您说的这个“自带库”是指ubuntu自带的gcc编译器吗?如果是的话,我是不是应该将gcc换做clang(不清楚我这样的说法是否正确 :sweat_smile:

是因为大家大部分人用waves2foam

这样啊,我明白了 :joy:,那我还是整个waves2foam试试吧,谢谢您~

我很早就发现了。但是一想也没啥。原来那个issue是你提的呀。我也提了。

waves2foam和olaflow都行。后者安装容易点。前者因为要在github上clone东西,有点蛋疼。

目前官方已经对这个bug进行了修复,具体方法可见 链接 总共修改了两行代码,修改之后再重新编译一下即可

1 个赞

修改内容如图


但是我不清楚这样改的原理 :sweat_smile: 请大佬们赐教~