SimFlowCFD / RapidCFD-dev

RapidCFD is an OpenFOAM fork running fully on CUDA platform. Brought to you by
https://sim-flow.com
Other
328 stars 95 forks source link

looping over mesh cells within a solvers #87

Open vdalessa opened 3 years ago

vdalessa commented 3 years ago

Dear All, it is very clear that standard forAll (mesh.C , celli ) .... does not run in RapidCFD environment. However, looking source code I do not still understand a possible alternative. Could you help me ?

Valerio

TonkomoLLC commented 3 years ago

Hello, Valerio,

I am not sure I follow. If you type grep -r "forAll" * from $WM_PROJECT_DIR/src you will see many instances of forAll loops.

Does this address your question?

Best regards,

Eric

vdalessa commented 3 years ago

Hi Eric, thank you very much for the suggestion. I wil see on Wednesday. Tomorrow the system on which I am working has a programmed stop. Sincerely, Valerio

vdalessa commented 3 years ago

Dear Eric,

i have fixed my previous issue swicthing to another programming strategy. Now, the solver seems to be ok, but the it crashes when I uses forces computation. Library seems to be ok and I have already followed forces.H details. Could you help on this issue ?

Valerio

forces { type forces; functionObjectLibs ("libforces.so"); log yes; patches (parete); rhoInf 1.4; CofR (0 0 0); }

}

TonkomoLLC commented 3 years ago

Dear Valerio,

I am honestly not sure what the problem is. I recommend using OpenFOAM v2.3.1 tutorials as a template for the forces function object.

I ran the cavity example with some dummy parameters for the forces calculation. These are totally nonsense parameters, but merely show that the forces function object is running. Firstly, here is the controlDict for the OpenFOAM cavity tutorial, with the forces function object added:

controlDict.txt

Here is screen output:

Time = 0.5

Courant Number mean: 0.222158 max: 0.852134
smoothSolver:  Solving for Ux, Initial residual = 2.57283e-07, Final residual = 2.57283e-07, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 5.52242e-07, Final residual = 5.52242e-07, No Iterations 0
AINVPCG:  Solving for p, Initial residual = 9.29243e-07, Final residual = 9.29243e-07, No Iterations 0
time step continuity errors : sum local = 7.93191e-09, global = -1.29735e-18, cumulative = 4.76985e-18
AINVPCG:  Solving for p, Initial residual = 9.74121e-07, Final residual = 9.74121e-07, No Iterations 0
time step continuity errors : sum local = 8.29978e-09, global = 1.43433e-19, cumulative = 4.91329e-18
ExecutionTime = 2.42 s  ClockTime = 2 s

forceCoeffs forces output:
    Cm    = 2.9948e-08
    Cd    = 8.50524e-06
    Cl    = 4.63552e-317
    Cl(f) = 2.9948e-08
    Cl(r) = -2.9948e-08

End

Error at lnInclude/DeviceStreamI.H:11
driver shutting down
Error at lnInclude/DeviceStreamI.H:11
driver shutting down

I do not know what the error is at the end, but it appears to not impact the results. I have not seen this error before.

I hope this feedback helps.

Best regards,

Eric

vdalessa commented 3 years ago

Dear Eric,

thank you very much for your very fast response. I attach the error that I obtain using your Dict. I am really interested in fixing this issue. So, I can share many other details about our solver that we have already pubilshed on Computers and Fluids ( in its cpu version).

Sincerely, Valerio

vdalessa@login02 $ mpirun -np 4 rhoEnergyFoamSuth2 -parallel /---------------------------------------------------------------------------\ | RapidCFD by simFlow (sim-flow.com) | *---------------------------------------------------------------------------*/ Build : dev Exec : rhoEnergyFoamSuth2 -parallel Date : Jun 29 2021 Time : 23:57:59 Host : "login02" PID : 106901 Case : /m100/home/userexternal/vdalessa/RapidCFD/cyl nProcs : 4 Slaves : 3 ( "login02.106902" "login02.106903" "login02.106904" )

Pstream initialized with: floatTransfer : 0 nProcsSimpleSum : 0 commsType : nonBlocking polling iterations : 0 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations

// * // Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package { type hePsiThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; }

Reading field U

Creating turbulence model

Selecting turbulence model type laminar Reading thermophysicalProperties

Ls = 15 f = 1 a = 1 M = 0.2 LAD = 0.75 etatg = 40

gamma = 1.4 pinf = 1 Tinf = 1

rho0 = 1.4 Eref0 = 1.80571428571 Uinf_x = 0.2 Uinf_y = 0 Uinf_z = 0

sigma0 = 0.442096337855

Starting time loop Start Timing = 1 s

forceCoeffs forces: Not including porosity effects

Time = 0.0001

ExecutionTime = 1.63 s ClockTime = 2 s

terminate called after throwing an instance of 'thrust::system::system_error' what(): parallel_for failed: cudaErrorInvalidDeviceFunction: invalid device function [login02:106903] Process received signal [login02:106903] Signal: Aborted (6) [login02:106903] Signal code: (-6) [login02:106903] [ 0] linux-vdso64.so.1(kernel_sigtramp_rt64+0x0)[0x7fff840a04d8] [login02:106903] [ 1] /lib64/power9/libc.so.6(gsignal+0xd8)[0x7fff7b6c3798] [login02:106903] [ 2] /lib64/power9/libc.so.6(abort+0x164)[0x7fff7b6a3bac] [login02:106903] [ 3] /lib64/libstdc++.so.6(_ZN9__gnu_cxx27verbose_terminate_handlerEv+0x158)[0x7fff7bab4a58] [login02:106903] [ 4] /lib64/libstdc++.so.6(+0xaf6d4)[0x7fff7baaf6d4] [login02:106903] [ 5] /lib64/libstdc++.so.6(_ZSt9terminatev+0x20)[0x7fff7baaf790] [login02:106903] [ 6] /lib64/libstdc++.so.6(cxa_throw+0x7c)[0x7fff7baafc6c] [login02:106903] [ 7] rhoEnergyFoamSuth2(_ZN6thrust8cuda_cub14throw_on_errorE9cudaErrorPKc+0xc4)[0x10039804] [login02:106903] [ 8] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN6thrust4copyINS_20permutation_iteratorINS_10device_ptrIKN4Foam6TensorIdEEEENS2_IKiEEEENS2_IS5_EEEET0_T_SDSC+0x12c)[0x7fff8128788c] [login02:106903] [ 9] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam7fvPatch18patchInternalFieldINS_6TensorIdEEEEvRKNS_7gpuListIT_EERNS_8gpuFieldIS5_EE+0xa4)[0x7fff813cec94] [login02:106903] [10] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam21processorFvPatchFieldINS_6TensorIdEEE12initEvaluateENS_8UPstream10commsTypesE+0x6c)[0x7fff813e460c] [login02:106903] [11] terminate called after throwing an instance of 'thrust::system::system_error' what(): parallel_for failed: cudaErrorInvalidDeviceFunction: invalid device function terminate called after throwing an instance of 'thrust::system::system_error' what(): /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryField8evaluateEv+0x274)[0x7fff81aa3614] [login02:106903] [12] parallel_for failed: cudaErrorInvalidDeviceFunction: invalid device function [login02:106901] Process received signal [login02:106902] Process received signal [login02:106902] Signal: Aborted (6) [login02:106902] Signal code: (-6) [login02:106902] [ 0] [login02:106901] Signal: Aborted (6) [login02:106901] Signal code: (-6) [login02:106901] [ 0] linux-vdso64.so.1(kernel_sigtramp_rt64+0x0)[0x7fffb6af04d8] linux-vdso64.so.1(kernel_sigtramp_rt64+0x0)[0x7fff905304d8] [login02:106902] [ 1] terminate called after throwing an instance of 'thrust::system::system_error' [login02:106901] [ 1] /lib64/power9/libc.so.6(gsignal+0xd8)[0x7fffae113798] [login02:106901] [ 2] what(): parallel_for failed: cudaErrorInvalidDeviceFunction: invalid device function /lib64/power9/libc.so.6(gsignal+0xd8)[0x7fff87b53798] [login02:106902] [ 2] /lib64/power9/libc.so.6(abort+0x164)[0x7fffae0f3bac] [login02:106901] [ 3] [login02:106904] Process received signal [login02:106904] Signal: Aborted (6) [login02:106904] Signal code: (-6) [login02:106904] [ 0] /lib64/power9/libc.so.6(abort+0x164)[0x7fff87b33bac] [login02:106902] [ 3] linux-vdso64.so.1(kernel_sigtramp_rt64+0x0)[0x7fffb09804d8] [login02:106904] [ 1] /lib64/libstdc++.so.6(_ZN9gnu_cxx27__verbose_terminate_handlerEv+0x158)[0x7fffae504a58] [login02:106901] [ 4] /lib64/power9/libc.so.6(gsignal+0xd8)[0x7fffa7fa3798] [login02:106904] [ 2] /lib64/libstdc++.so.6(_ZN9gnu_cxx27verbose_terminate_handlerEv+0x158)[0x7fff87f44a58] [login02:106902] [ 4] /lib64/power9/libc.so.6(abort+0x164)[0x7fffa7f83bac] [login02:106904] [ 3] /lib64/libstdc++.so.6(+0xaf6d4)[0x7fff87f3f6d4] [login02:106902] [ 5] /lib64/libstdc++.so.6(+0xaf6d4)[0x7fffae4ff6d4] [login02:106901] [ 5] /lib64/libstdc++.so.6(_ZN9__gnu_cxx27verbose_terminate_handlerEv+0x158)[0x7fffa8394a58] [login02:106904] [ 4] /lib64/libstdc++.so.6(_ZSt9terminatev+0x20)[0x7fffae4ff790] [login02:106901] [ 6] /lib64/libstdc++.so.6(_ZSt9terminatev+0x20)[0x7fff87f3f790] [login02:106902] [ 6] /lib64/libstdc++.so.6(+0xaf6d4)[0x7fffa838f6d4] [login02:106904] [ 5] /lib64/libstdc++.so.6(cxa_throw+0x7c)[0x7fff87f3fc6c] [login02:106902] [ 7] /lib64/libstdc++.so.6(__cxa_throw+0x7c)[0x7fffae4ffc6c] [login02:106901] [ 7] /lib64/libstdc++.so.6(_ZSt9terminatev+0x20)[0x7fffa838f790] [login02:106904] [ 6] rhoEnergyFoamSuth2(_ZN6thrust8cuda_cub14throw_on_errorE9cudaErrorPKc+0xc4)[0x10039804] [login02:106902] [ 8] rhoEnergyFoamSuth2(_ZN6thrust8cuda_cub14throw_on_errorE9cudaErrorPKc+0xc4)[0x10039804] [login02:106901] [ 8] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam2fv9gaussGradINS_6VectorIdEEE5gradfERKNS_14GeometricFieldIS3_NS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_4wordE+0x788)[0x7fff81aa4648] [login02:106903] [13] /lib64/libstdc++.so.6(cxa_throw+0x7c)[0x7fffa838fc6c] [login02:106904] [ 7] rhoEnergyFoamSuth2(_ZN6thrust8cuda_cub14throw_on_errorE9cudaErrorPKc+0xc4)[0x10039804] [login02:106904] [ 8] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN6thrust4copyINS_20permutation_iteratorINS_10device_ptrIKN4Foam6TensorIdEEEENS2_IKiEEEENS2_IS5_EEEET0_T_SDSC+0x12c)[0x7fff8d71788c] [login02:106902] [ 9] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN6thrust4copyINS_20permutation_iteratorINS_10device_ptrIKN4Foam6TensorIdEEEENS2_IKiEEEENS2_IS5_EEEET0_T_SDSC+0x12c)[0x7fffb3cd788c] [login02:106901] [ 9] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN6thrust4copyINS_20permutation_iteratorINS_10device_ptrIKN4Foam6TensorIdEEEENS2_IKiEEEENS2_IS5_EEEET0_T_SDSC+0x12c)[0x7fffadb6788c] [login02:106904] [ 9] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv9gaussGradINS_6VectorIdEEE8calcGradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0x94)[0x7fff81aa4b24] [login02:106903] [14] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam7fvPatch18patchInternalFieldINS_6TensorIdEEEEvRKNS_7gpuListIT_EERNS_8gpuFieldIS5_EE+0xa4)[0x7fffb3e1ec94] [login02:106901] [10] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam7fvPatch18patchInternalFieldINS_6TensorIdEEEEvRKNS_7gpuListIT_EERNS_8gpuFieldIS5_EE+0xa4)[0x7fff8d85ec94] [login02:106902] [10] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam7fvPatch18patchInternalFieldINS_6TensorIdEEEEvRKNS_7gpuListIT_EERNS_8gpuFieldIS5_EE+0xa4)[0x7fffadcaec94] [login02:106904] [10] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv10gradSchemeINS_6VectorIdEEE4gradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0xa8)[0x7fff81789ea8] [login02:106903] [15] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam21processorFvPatchFieldINS_6TensorIdEEE12initEvaluateENS_8UPstream10commsTypesE+0x6c)[0x7fffb3e3460c] [login02:106901] [11] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam21processorFvPatchFieldINS_6TensorIdEEE12initEvaluateENS_8UPstream10commsTypesE+0x6c)[0x7fff8d87460c] [login02:106902] [11] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam21processorFvPatchFieldINS_6TensorIdEEE12initEvaluateENS_8UPstream10commsTypesE+0x6c)[0x7fffadcc460c] [login02:106904] [11] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryField8evaluateEv+0x274)[0x7fff8df33614] [login02:106902] [12] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EERKNS_4wordE+0x88)[0x7fff817b9af8] [login02:106903] [16] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryField8evaluateEv+0x274)[0x7fffb44f3614] [login02:106901] [12] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam14GeometricFieldINS_6TensorIdEENS_12fvPatchFieldENS_7volMeshEE22GeometricBoundaryField8evaluateEv+0x274)[0x7fffae383614] [login02:106904] [12] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam2fv9gaussGradINS_6VectorIdEEE5gradfERKNS_14GeometricFieldIS3_NS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_4wordE+0x788)[0x7fffb44f4648] [login02:106901] [13] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam2fv9gaussGradINS_6VectorIdEEE5gradfERKNS_14GeometricFieldIS3_NS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_4wordE+0x788)[0x7fff8df34648] [login02:106902] [13] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EE+0xc4)[0x7fff817b9ca4] [login02:106903] [17] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libcompressibleTurbulenceModel.so(_ZNK4Foam12compressible7laminar10devRhoReffEv+0xf4)[0x7fff7f5277d4] [login02:106903] [18] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0x80)[0x7fff4ce53c20] [login02:106903] [19] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam2fv9gaussGradINS_6VectorIdEEE5gradfERKNS_14GeometricFieldIS3_NS_13fvsPatchFieldENS_11surfaceMeshEEERKNS_4wordE+0x788)[0x7fffae384648] [login02:106904] [13] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam6forces16calcForcesMomentEv+0xddc)[0x7fff4ce5536c] [login02:106903] [20] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam11forceCoeffs5writeEv+0x34)[0x7fff4ce93a64] [login02:106903] [21] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam26OutputFilterFunctionObjectINS_11forceCoeffsEE7executeEb+0xa4)[0x7fff4ce9a974] [login02:106903] [22] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv9gaussGradINS_6VectorIdEEE8calcGradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0x94)[0x7fff8df34b24] [login02:106902] [14] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv9gaussGradINS_6VectorIdEEE8calcGradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0x94)[0x7fffb44f4b24] [login02:106901] [14] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList7executeEb+0x98)[0x7fff7c288988] [login02:106903] [23] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv9gaussGradINS_6VectorIdEEE8calcGradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0x94)[0x7fffae384b24] [login02:106904] [14] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam4Time4loopEv+0xb4)[0x7fff7c2a2354] [login02:106903] [24] rhoEnergyFoamSuth2[0x10026e84] [login02:106903] [25] /lib64/power9/libc.so.6(+0x241f8)[0x7fff7b6a41f8] [login02:106903] [26] /lib64/power9/libc.so.6(libc_start_main+0xb4)[0x7fff7b6a43e4] [login02:106903] End of error message /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv10gradSchemeINS_6VectorIdEEE4gradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0xa8)[0x7fff8dc19ea8] [login02:106902] [15] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv10gradSchemeINS_6VectorIdEEE4gradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0xa8)[0x7fffb41d9ea8] [login02:106901] [15] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZNK4Foam2fv10gradSchemeINS_6VectorIdEEE4gradERKNS_14GeometricFieldIS3_NS_12fvPatchFieldENS_7volMeshEEERKNS_4wordE+0xa8)[0x7fffae069ea8] [login02:106904] [15] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EERKNS_4wordE+0x88)[0x7fff8dc49af8] [login02:106902] [16] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EERKNS_4wordE+0x88)[0x7fffb4209af8] [login02:106901] [16] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EERKNS_4wordE+0x88)[0x7fffae099af8] [login02:106904] [16] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EE+0xc4)[0x7fff8dc49ca4] [login02:106902] [17] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EE+0xc4)[0x7fffb4209ca4] [login02:106901] [17] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libcompressibleTurbulenceModel.so(_ZNK4Foam12compressible7laminar10devRhoReffEv+0xf4)[0x7fff8b9b77d4] [login02:106902] [18] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libcompressibleTurbulenceModel.so(_ZNK4Foam12compressible7laminar10devRhoReffEv+0xf4)[0x7fffb1f777d4] [login02:106901] [18] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0x80)[0x7fffa00c3c20] [login02:106901] [19] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam6forces16calcForcesMomentEv+0xddc)[0x7fffa00c536c] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0x80)[0x7fff70103c20] [login02:106902] [19] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam6forces16calcForcesMomentEv+0xddc)[0x7fff7010536c] [login02:106902] [20] [login02:106901] [20] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam11forceCoeffs5writeEv+0x34)[0x7fff70143a64] [login02:106902] [21] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam26OutputFilterFunctionObjectINS_11forceCoeffsEE7executeEb+0xa4)[0x7fff7014a974] [login02:106902] [22] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libfiniteVolume.so(_ZN4Foam3fvc4gradINS_6VectorIdEEEENS_3tmpINS_14GeometricFieldINS_12outerProductIS3_T_E4typeENS_12fvPatchFieldENS_7volMeshEEEEERKNS5_IS7_SA_SB_EE+0xc4)[0x7fffae099ca4] [login02:106904] [17] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam11forceCoeffs5writeEv+0x34)[0x7fffa0103a64] [login02:106901] [21] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam26OutputFilterFunctionObjectINS_11forceCoeffsEE7executeEb+0xa4)[0x7fffa010a974] [login02:106901] [22] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libcompressibleTurbulenceModel.so(_ZNK4Foam12compressible7laminar10devRhoReffEv+0xf4)[0x7fffabe077d4] [login02:106904] [18] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0x80)[0x7fff6d593c20] [login02:106904] [19] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam6forces16calcForcesMomentEv+0xddc)[0x7fff6d59536c] [login02:106904] [20] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam11forceCoeffs5writeEv+0x34)[0x7fff6d5d3a64] [login02:106904] [21] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libforces.so(_ZN4Foam26OutputFilterFunctionObjectINS_11forceCoeffsEE7executeEb+0xa4)[0x7fff6d5da974] [login02:106904] [22] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList7executeEb+0x98)[0x7fff88718988] [login02:106902] [23] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList7executeEb+0x98)[0x7fffaecd8988] [login02:106901] [23] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam18functionObjectList7executeEb+0x98)[0x7fffa8b68988] [login02:106904] [23] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam4Time4loopEv+0xb4)[0x7fffaecf2354] [login02:106901] [24] rhoEnergyFoamSuth2[0x10026e84] [login02:106901] [25] /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam4Time4loopEv+0xb4)[0x7fff88732354] [login02:106902] [24] rhoEnergyFoamSuth2[0x10026e84] [login02:106902] [25] /lib64/power9/libc.so.6(+0x241f8)[0x7fffae0f41f8] [login02:106901] [26] /lib64/power9/libc.so.6(+0x241f8)[0x7fff87b341f8] [login02:106902] [26] /lib64/power9/libc.so.6(libc_start_main+0xb4)[0x7fff87b343e4] /lib64/power9/libc.so.6(libc_start_main+0xb4)[0x7fffae0f43e4] [login02:106901] End of error message [login02:106902] End of error message /m100/home/userexternal/vdalessa/RapidCFD/RapidCFD-dev/platforms/linuxPPC64leNvccDPOpt/lib/libOpenFOAM.so(_ZN4Foam4Time4loopEv+0xb4)[0x7fffa8b82354] [login02:106904] [24] rhoEnergyFoamSuth2[0x10026e84] [login02:106904] [25] /lib64/power9/libc.so.6(+0x241f8)[0x7fffa7f841f8] [login02:106904] [26] /lib64/power9/libc.so.6(libc_start_main+0xb4)[0x7fffa7f843e4] [login02:106904] 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 login02 exited on signal 6 (Aborted).

vdalessa@login02 $

TonkomoLLC commented 3 years ago

Dear Valerio,

Hmm. I normally associate errors like cudaErrorInvalidDeviceFunction: invalid device function to be a compilation issue such as when the sm_# is not set correctly in wmake rules. What I am referring to is the -arch=sm_30 value in the wmake rules. The value 30 needs to be set to the appropriate value for your GPU. If you do change this value (and the corresponding -arch=sm_30 flag) in the c rules, then you'll need to wclean all from the $WM_PROJECT_DIR and do a fresh recompile from scratch. Maybe also the rules files you need to change will be in a different directory than linux64Nvcc since I see you are using a Power PC CPU and a PPC directory does not exist in the RapidCFD wmake rules directory.

Let's suppose the -arch=sm_## flag is set appropriately and that's not the root problem. Then I would run the cavity tutorial from the test case repo and replace system/controlDict with the version i sent above (with the function object included for forces). If this cavity test with forces function object works, then the error message you see is related to something specific with your cas (e.g., a setting in the forces settings within controlDict). However, if the cavity case with the forces function object fails, then the root cause for the error you provided is probably due to something with the compilation of RapidCFD because the forces function object clearly works on my system with cavity.

I hope this advice makes sense and I look forward to learning what happens.

By the way, is this the CPU version of the code you are working on? https://github.com/davidem88/rhoEnergyFoam

Good luck!

Cheers, Eric

vdalessa commented 3 years ago

Dear Eric, thank you very much for you kind response. Actually, I have tested cavity problem with your dict for forces computation and icoFoam crashes. So I have a compilation issue. I am attemping to work on Marconi 100 system https://www.hpc.cineca.it/hardware/marconi100 As you can see V100 cards are available. I attach the rules dir that I am using. https://github.com/vdalessa/L17/blob/master/linuxPPC64leNvcc.tgz Moreover, I have built RCFD using following modules

module load spectrum_mpi/10.4.0--binary module load gnu/8.4.0 module load hpc-sdk/2020--binary module load cuda/10.2

CPU starting point is the following: https://github.com/vdalessa/caafoam which shares several points in m2 version with rhoEnergyFoam. In this specific version .C file is still named from rhoEnergyFoam starting point. Please note that, in this moment, solvers runs correctly. My problems are strictly related to forces computations.

Could you take a look to my rules dir ??? Thanks again for your help. Valerio

TonkomoLLC commented 3 years ago

Dear Valerio,

Thanks for this information. I agree that your settings in the wmake rules look fine. And as you said, the whole code seems to run fine except for the forces function object.

I am not sure this will work, but let's just be sure. Please go to $WM_PROJECT_DIR/src/postProcessing/functionObjects/forces - the location of the forces function object code - and type wclean followed by wmake. This will recompile libforces.so. I am asking to do this just in case this code is compiled for a different compute capability, and maybe it was missed in a wclean of your RapidCFD installation.

After recompiling, please try the cavity case again (it's fast, plus I have access to it so we can troubleshoot on cavity together).

If cavity fails again, please confirm that you also try running cavity with just one GPU (no MPI).

If icoFoam & cavity still fail to run with forces, then I wonder if the next step is to get a fresh copy of RapidCFD, change the wmake rules again and whatever else you need to do accommodate the PPC CPU's, and recompile from scratch. I do not know the history of your RapidCFD compilation. If there are compiled components leftover from a previous compilation then this may fix the issue.

Another idea, especially if you are going to recompile, is to update your CUDA version to 11.1. I know 11.4 is out, but I have not tested > 11.1. Sometimes bugs get fixed in newer versions of CUDA.

Anyhow, I do not know specifically what is causing your problem, but maybe these are some ideas to try... even if these ideas do not fix the problem immediately, they may help narrow the specific cause of the problem.

Thanks for the background on your solver. This is interesting work and I hope that you have some success in the near future.

Best regards,

Eric

vdalessa commented 3 years ago

Dear Eric, I apologize for the late response. In these days I am really busy since I am co-char of an approcching conference www.aigeancona.univpm.it I hope you can understand. Honestly, I am really interested in fixing the forces issue. I think it could be very interesting run some large cases on M100 GPU. I hope you are still available from next week for guidance in fixing my issues. Kind regards, Valerio

TonkomoLLC commented 3 years ago

Dear Valerio,

No worries on the conference commitment. That looks like a great conference.

I am happy to correspond with you on the forces problem. Since I cannot reproduce the problem on my machine and I don't have the same hardware as you, at present I can only help guide your troubleshooting. I do not know the exact answer to resolve the error you are receiving.

Thanks for your understanding.

Best regards,

Eric

jiaqiwang969 commented 2 years ago

grep -r "forAll" *

Hi,vdalessa, could you say something about how you solve it? I also meet the same problem.

vdalessa commented 2 years ago

Dear jiaqui, many thanks for you message and for your interest in my work. Unfortunately, I have stopped my efforts in this direction since I did not have enough access to GPU and I have found some funding on other projects. However, I am still really interested in this topic. I attached to a private email a version of the code that compiled for me. But I did not still solved the forces issue. Please, could you me keep updated about your work ? Sincerely, Valerio