CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   index out of range when accessing boundaryField in debug mode (http://www.cfd-online.com/Forums/openfoam-bugs/116151-index-out-range-when-accessing-boundaryfield-debug-mode.html)

sr_tenedor April 14, 2013 04:21

index out of range when accessing boundaryField in debug mode
 
Dear Foamers,

currently I'm trying out an anti-diffusion method in interFoam. My code basically needs to access the values of alpha1 and change them in order to increase the interface steepness. The single processor case works fine when running in opt mode, but throws an index out of range exception when running in debug mode. I have also problems concerning the parallel case, but everything at its time.

This is how I compile in debug mode:

interFoam$ wmake
Making dependency list for source file interFoam.C
SOURCE=interFoam.C ; mpicxx -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels/incompressible/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels/interfaceProperties/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/turbulenceModel -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPDebug/interFoam.o
/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
mpicxx -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels/incompressible/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/transportModels/interfaceProperties/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/turbulenceModel -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPDebug/interFoam.o -L/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib \
-ltwoPhaseInterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -ldl -ggdb3 -DFULLDEBUG -lm -o interFoam


Using gdb I hopefully found the line, that is causing the debug version of the program to crash (I included alphaAntiDiffusion.H as third non-blank line in alphaEqnSubcycle.H):

verification_case$ gdb ./interFoam/interFoam
[...]
(gdb) b alphaAntiDiffusion.H : 182
Breakpoint 1 at 0x47696c: file alphaAntiDiffusion.H, line 182.
(gdb) run
Starting program: /home/fabian/OpenFOAM/fabian-2.1.1/run/interFoamAlphaAntiDiffusion/interFoam

[...]
(gdb) list 176,186
176 forAll(mesh.boundaryMesh(), patchI)
177 {
178 vectorField nf = mesh.boundary()[patchI].nf();
179 if (alpha1.boundaryField()[patchI].type() == "fixedValue")
180 // if (alpha1.boundaryField()[patchI].fixesValue())
181 {
182 forAll(alpha1.boundaryField()[patchI], faceI)
183 {
184 label faceIGlobal = faceI+mesh.boundaryMesh()[patchI].start();
185 label own = mesh.owner()[faceIGlobal];

186 gradAlphaNProjectedf.boundaryField()[patchI][faceI] = gradAlphaNCd[own] & nf[faceI];
(gdb) n
184 label faceIGlobal = faceI+mesh.boundaryMesh()[patchI].start();
(gdb) n
185 label own = mesh.owner()[faceIGlobal];
(gdb) print faceIGlobal
$3 = 112
(gdb) print mesh.owner()
$4 = (const Foam::labelUList &) @0x846198: {size_ = 112, v_ = 0x829d90}
(gdb) n


--> FOAM FATAL ERROR:
index 112 out of range 0 ... 111

From function UList<T>::checkIndex(const label)
in file /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H at line 109.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/printStack.C:201
#1 Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/error.C:249
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/errorManip.H:85
#3 Foam::UList<int>::checkIndex(int) const at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:113
#4 Foam::UList<int>::operator[](int) const at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:200
#5 main at interFoam/alphaAntiDiffusion.H:185
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7
in "/home/fabian/OpenFOAM/fabian-2.1.1/run/interFoamAlphaAntiDiffusion/interFoam"

Program received signal SIGABRT, Aborted.
0x00007ffff3266425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff3266425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff3269b8b in __GI_abort () at abort.c:91
#2 0x00007ffff528f68a in Foam::error::abort (this=0x7ffff5896d40) at lnInclude/error.C:249
#3 0x000000000047eec4 in Foam::operator<< <Foam::error> (os=..., m=...) at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/errorManip.H:84
#4 0x000000000048f36b in Foam::UList<int>::checkIndex (this=0x846198, i=112) at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:109
#5 0x000000000047f2a8 in Foam::UList<int>::operator[] (this=0x846198, i=112) at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:198
#6 0x00000000004769c5 in main (argc=1, argv=0x7fffffffd248) at alphaAntiDiffusion.H:185


Like I already mentioned, the opt Version runs fine and is able to access the element mesh.owner()[112]. This should return the owner of the first boundary face (which is interesting, since the size of mesh.owner() only allows indices from 0:111, but the boundary face owners have to be stored somewhere, too, don't they?). My computational domain contains 8x8 cells, hence 111 internal faces.

My settings are as follows:

OF 2.1.1, source pack build, one with optimization flags, the other one with debugging flags

verification_case$ echo $LD_LIBRARY_PATH
/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib/openmpi-system:/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPDebug/lib/openmpi-system:/usr/lib/openmpi/lib:/home/fabian/OpenFOAM/fabian-2.1.1/platforms/linux64GccDPDebug/lib:/home/fabian/OpenFOAM/site/2.1.1/platforms/linux64GccDPDebug/lib:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib:/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPDebug/lib:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib/dummy

alternatively the opt build:

~$ echo $LD_LIBRARY_PATH
/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64Gcc/paraview-3.12.0/lib/paraview-3.12:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/openmpi-system:/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib/openmpi-system:/usr/lib/openmpi/lib:/home/fabian/OpenFOAM/fabian-2.1.1/platforms/linux64GccDPOpt/lib:/home/fabian/OpenFOAM/site/2.1.1/platforms/linux64GccDPOpt/lib:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib:/home/fabian/OpenFOAM/ThirdParty-2.1.1/platforms/linux64GccDPOpt/lib:/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/dummy

verification_case$ mpicxx --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

verification_case$ mpicc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3


verification_case$ mpirun -V
mpirun (Open MPI) 1.4.3

verification_case$ gdb
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04


Kind regards
Fabian

ngj April 14, 2013 07:35

Hi Fabian,

It looks like you would like to access the gradient of the alpha field next to the boundary, correct? In that case, I would suggest that you do something along these lines:

Code:

forAll( mesh.boundaryMesh(), patchi )
{
    vectorField nf = mesh.boundary()[patchi].nf();

    // The face cells is essentially the owner list of the faces on the boundary
    const labelList & faceCells = mesh.boundary()[patchi].patch().faceCells();

    forAll( faceCells, facei )
    {
        <leftHandSide> = gradAlphaNCf[faceCells[facei]] & nf[facei];
    }
}

Kind regards,

Niels

sr_tenedor April 14, 2013 10:22

Thank you very much for this fast reply, Niels, but I think your solution is only an alternative approach to obtaining the boundary face owners. I'm quite sure, I have been using the same approach before without crashing. Furthermore one important question still remains: Why is this happening only when I compile a debugging enabled version - my optimized version never complained about an array index out of bounds? -> Maybe something went wrong during the debug build of OF?

Well at least your solution works (both debug and opt) until the same error shows up again (only debug), when I try using syncTools. I need syncTools in order to parallelize my solver by syncronizing the values of gradAlphaNfProjectedNf on my processor boundaries. Former Variable is a surfaceScalarField, surging from dot-multiplying a cellFaceGradient (surfaceVectorField) with the respective surface Vector .Sf(). To preserve global continuity this gradient must be the same on both processors sharing the face.

Here the responsible code segment:

Code:

    gradAlphaNfProjectedf = gradAlphaNf & mesh.Sf();
    syncTools::syncFaceList(mesh, gradAlphaNfProjectedf, minEqOp<scalar>());

    // using limitted divergence as numerator
    numerator = mag(fvc::div(gradAlphaNfProjectedf));
    denominator = Foam::pow(mag(gradAlphaNCd),2);
    numerator1 = denominator1 = numerator2 = denominator2 = 0.0;


Here's the actual debug session (single processor):

verification_case$ gdb ./interFoam/interFoam
[...]
(gdb) b alphaAntiDiffusion.H : 318
Breakpoint 1 at 0x477ab4: file alphaAntiDiffusion.H, line 318.
(gdb) run
Starting program: /home/fabian/OpenFOAM/fabian-2.1.1/run/interFoamAlphaAntiDiffusion/interFoam
[...]
Breakpoint 1, main (argc=1, argv=0x7fffffffd248) at alphaAntiDiffusion.H:318
318 gradAlphaNfProjectedf = gradAlphaNf & mesh.Sf();
(gdb) list 318,324
318 gradAlphaNfProjectedf = gradAlphaNf & mesh.Sf();
319 syncTools::syncFaceList(mesh, gradAlphaNfProjectedf, minEqOp<scalar>());
320
321 // using limitted divergence as numerator
322 numerator = mag(fvc::div(gradAlphaNfProjectedf));
323 denominator = Foam::pow(mag(gradAlphaNCd),2);
324 numerator1 = denominator1 = numerator2 = denominator2 = 0.0;
(gdb) n
319 syncTools::syncFaceList(mesh, gradAlphaNfProjectedf, minEqOp<scalar>());
(gdb) n

--> FOAM FATAL ERROR:
start 112 out of range 0 ... 111

From function UList<T>::checkStart(const label)
in file /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H at line 77.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/printStack.C:201
#1 Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/error.C:249
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/errorManip.H:85
#3 Foam::UList<double>::checkStart(int) const at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:81
#4 Foam::SubList<double>::SubList(Foam::UList<double> const&, int, int) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/SubListI.H:60
#5 void Foam::syncTools::syncFaceList<double, Foam::minEqOp<double> >(Foam::polyMesh const&, Foam::UList<double>&, Foam::minEqOp<double> const&) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/syncTools.H:394
#6 main at ~/OpenFOAM/fabian-2.1.1/run/interFoamAlphaAntiDiffusion/alphaAntiDiffusion.H:322

#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8
in "/home/fabian/OpenFOAM/fabian-2.1.1/run/interFoamAlphaAntiDiffusion/interFoam"

Program received signal SIGABRT, Aborted.
0x00007ffff3266425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff3266425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff3269b8b in __GI_abort () at abort.c:91
#2 0x00007ffff528f68a in Foam::error::abort (this=0x7ffff5896d40) at lnInclude/error.C:249
#3 0x000000000047ef1a in Foam::operator<< <Foam::error> (os=..., m=...)
at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/errorManip.H:84
#4 0x00000000004aa06f in Foam::UList<double>::checkStart (this=0x7fffffffa1b8, start=112)
at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H:77
#5 0x000000000049ab3f in Foam::SubList<double>::SubList (this=0x7fffffff7520, list=..., subSize=160,
startIndex=112) at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/SubListI.H:59
#6 0x00000000004899f1 in Foam::syncTools::syncFaceList<double, Foam::minEqOp<double> > (mesh=..., l=...,
cop=...) at /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/syncTools.H:392
#7 0x0000000000477b28 in main (argc=1, argv=0x7fffffffd248) at alphaAntiDiffusion.H:319


The 2-processor (debug) seems to fail at the same line. Here only the stderr output I'm getting from verification_case$ mpirun -np 2 ./interFoam/interFoam -parallel 2>log:

[0] [1]
[0]
[0] --> FOAM FATAL ERROR:
[0]
[1]
[1] --> FOAM FATAL ERROR:
[1] start 52 out of range 0 ... 51
[1]
[1] From function start 52 out of range 0 ... 51
[0]
[0] From function UList<T>::checkStart(const label)
[0] in file /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H at line UList<T>::checkStart(const label)
[1] in file /home/fabian/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/UListI.H at line 77.
[1]
FOAM parallel run aborting
[1]
77.
[0]
FOAM parallel run aborting
[0]
[1] #0 [0] #0 Foam::error::printStack(Foam::Ostream&)Foam::error ::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/printStack.C:201
[1] #1 at ~/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/printStack.C:201
[0] #1 Foam::error::abort()Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/error.C:230
[0] #2 at ~/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/error.C:230
[1] #2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>)Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>)
[0] #3
[1] #3 Foam::UList<double>::checkStart(int) const
[1] #4 Foam::UList<double>::checkStart(int) const
[0] #4 Foam::SubList<double>::SubList(Foam::UList<double> const&, int, int)
[1] Foam::SubList<double>::SubList(Foam::UList<double> const&, int, int)#5
[0] #5 void Foam::syncTools::syncFaceList<double, Foam::minEqOp<double> >(Foam::polyMesh const&, Foam::UList<double>&, Foam::minEqOp<double> const&)
[1] #void Foam::syncTools::syncFaceList<double, Foam::minEqOp<double> >(Foam::polyMesh const&, Foam::UList<double>&, Foam::minEqOp<double> const&)
[0] #6 6 main
[1] #7 main
[0] #7 __libc_start_main__libc_start_main in "/lib/ in "/lib/x86_64-lx86_64-linux-gnu/inux-gnu/libc.so.6"
[1] #8 libc.so.6"
[0] #8
[0]

[1]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
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.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun has exited due to process rank 0 with PID 14205 on
node fabian-ThinkPad-W520 exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[fabian-ThinkPad-W520:14204] 1 more process has sent help message help-mpi-api.txt / mpi-abort
[fabian-ThinkPad-W520:14204] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages


Why did I start using the debugging version of OF? Here is what happend after successfully solving some timesteps, when trying to solve the alphaEqn:

*** glibc detected *** ./interFoam/interFoam: free(): invalid pointer: 0x0000000001636540 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f184398eb96]
/home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib/libincompressibleRASModels.so(_ZN4Foam24zeroGradie ntFvPatchFieldINS_6VectorIdEEED0Ev+0x24)[0x7f18479f8402]
./interFoam/interFoam(_ZN4Foam14GeometricFieldINS_6VectorIdEEN S_12fvPatchFieldENS_7volMeshEED1Ev+0x77)[0x447877]
./interFoam/interFoam(main+0x4c7d)[0x42d60d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f184393176d]
./interFoam/interFoam[0x43588d]
======= Memory map: ========
[...]

[fabian-ThinkPad-W520:15393] *** Process received signal ***
[fabian-ThinkPad-W520:15393] Signal: Aborted (6)
[fabian-ThinkPad-W520:15393] Signal code: (-6)
[fabian-ThinkPad-W520:15393] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7fcf09240cb0]
[fabian-ThinkPad-W520:15393] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7fcf08ea8425]
[fabian-ThinkPad-W520:15393] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7fcf08eabb8b]
[fabian-ThinkPad-W520:15393] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7439e) [0x7fcf08ee639e]
[fabian-ThinkPad-W520:15393] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x7eb96) [0x7fcf08ef0b96]
[fabian-ThinkPad-W520:15393] [ 5] /home/fabian/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPDebug/lib/libincompressibleRASModels.so(_ZN4Foam24zeroGradie ntFvPatchFieldINS_6VectorIdEEED0Ev+0x24) [0x7fcf0cf5a402]
[fabian-ThinkPad-W520:15393] [ 6] ./interFoam/interFoam(_ZN4Foam14GeometricFieldINS_6VectorIdEEN S_12fvPatchFieldENS_7volMeshEED1Ev+0x77) [0x447877]
[fabian-ThinkPad-W520:15393] [ 7] ./interFoam/interFoam(main+0x4c7d) [0x42d60d]
[fabian-ThinkPad-W520:15393] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fcf08e9376d]
[fabian-ThinkPad-W520:15393] [ 9] ./interFoam/interFoam() [0x43588d]
[fabian-ThinkPad-W520:15393] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 15393 on node fabian-ThinkPad-W520 exited on signal 6 (Aborted).
--------------------------------------------------------------------------

Kind regards,
Fabian

ngj April 14, 2013 10:55

Hi Fabian,

Well, the reason why it is running in the optimised version, is probably because you have been lucky/unlucky depending on ones view-point. Performing the following small test:

Code:

const unallocLabelList & own = mesh.owner();
const unallocLabelList & nei = mesh.neighbour();

Info << "Sizes" << tab << own.size() << tab << nei.size() << endl;

in some arbitrary code gives me the following as output:

Code:

Sizes    12    12
so obviously, the owner list merely contain the internal faces. Therefore, in order to correctly address the neighbouring cells on a boundary you should use the faceCells() approach.

Conclusion: The debugging version of OpenFoam actually tells you the truth. Therefore, when running in the optimised version of OF, you really need to be careful that you are not accessing memory, which is not "yours". I suppose that this is what is happening, when you get the "invalid pointer" error.

Kind regards

Niels

ngj April 14, 2013 11:16

Hi,

I have just noticed that the syntax has changed at least when comparing OF2.2 and OF1.6-ext, so taken from fvMesh.H in OF2.2:

Code:

//- Internal face owner
            const labelUList& owner() const
            {
                return lduAddr().lowerAddr();
            }

The difference lies in the return type. This still shows, however, that owner is only returning the internal faces.

Kind regards,

Niels

sr_tenedor April 14, 2013 11:17

Hi Niels,

once again thank you for your clarifying reply!

So, I'm left only with finding an elegant solution for updating the boundary face values of my surfaceScalarField, because like you can see from my previous post syncFaceList fails at trying to access boundaryFace values on "fixed value"-patches, even it only should sync processor patches.

Code:

gradAlphaNfProjectedf = gradAlphaNf & mesh.Sf();
syncTools::syncFaceList(mesh, gradAlphaNfProjectedf, minEqOp<scalar>());

Kind regards,
Fabian

P.S. I noticed, that my thread is becoming more and more offtopic, so if there is no quick fix available to my problem, I will try to move this thread to another forum.

EDIT: Still don't know how to use syncFaceList, but after having a closer look at my code I realized, that a simple .correctBoundaryConditions() on another field, from which gradAlphaNfProjectedf can be calculated, works just fine -> parallel and sequential solver are giving the same result.


All times are GMT -4. The time now is 11:31.