|
[Sponsors] |
Writing all continuity errors to a file using custom solver in parallel mode |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 14, 2022, 04:28 |
Writing all continuity errors to a file using custom solver in parallel mode
|
#1 |
New Member
Saurabh
Join Date: Nov 2017
Posts: 6
Rep Power: 9 |
Hi,
This is my first time on making custom openfoam solver. I made a custom solver using chtMultiRegionFoam as template. I am trying to print out all continuity errors to a file. Then I added a code inside solver code to plot all continuity, residuals and average fields values at boundaries using gnuplot. However, this seems to work fine when run in the serial mode. But parallel mode is plotting graph 4 times and writing files 4 times (I am using 4 cores for parallelization). Is there any way to make openfoam solver to run in serial mode for few lines and run in parallel mode for the rest of the code? I tried to assign integer value to each thread using MPI then use If loops to call them to run specific commands. but MPI_Init command fails everytime when I run the solver. The error says that MPI_Init can't be initialized multiple times. It seems that multiple threads are initializing MPI. Is there any workaround this error? |
|
September 14, 2022, 21:44 |
|
#2 |
New Member
Saurabh
Join Date: Nov 2017
Posts: 6
Rep Power: 9 |
hi,
I found this post that solves my problem. In this post, instead of using MPI_Int in the main solver code, I can call each processor by using Foam::UPstream::myProcNo() and plot gnuplot only one time. How to extract MPI rank? However, using this method, I found that running same code in parallel is slowing down the simulation compared to the case where I run same simulation in serial mode. I think that since only one processor is plotting the graph, all other processor are waiting for it to finish plotting and it is causing the simulation slowdown. is there any way to divide the work of gnuplot plotting process among all processors without plotting same graph 4 times? |
|
Tags |
custom solver, gnuplot, openfoam, openmpi, parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 02:41 |