|
[Sponsors] |
How to transfer the modified data in serial process to other processes? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 26, 2022, 05:21 |
How to transfer the modified data in serial process to other processes?
|
#1 |
New Member
yunyu_wang
Join Date: Oct 2020
Posts: 1
Rep Power: 0 |
Hello, everyone!
I recently encountered a problem. I need to insert a serial operation into parallel computing. And I used some functions in MPI to do it as the following codes. But I found that the modified data in serial process is not passed to other processes. So how can I make the modified data in the serial pass to other processes? Thank you! Code:
int main(int argc, char *argv[]) { int i(0); int numprocs; int myid; MPI_Status stat; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); // there is N data altogether in testNumber volScalarField testNumber ( IOobject ( "testNumber", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh ); if(myid==0) { for(i=0;i<N;i++) { testNumber[i]=i; } } testNumber.write(); // It is found that only the testNumber in the 0 process has been modified, //and the testNumber of other processes remains unchanged. } |
|
Tags |
mpi, openfoam, serial in parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
modified version of timeVaryingMappedFixedValue BC for looping through data | syavash | OpenFOAM Programming & Development | 13 | November 3, 2023 19:38 |
Initializing transient analysis using static analysis in two-way FSI simulation | Daniel_Khazaei | ANSYS | 50 | September 12, 2017 11:56 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
post process to get an arbitrary face data | oniboy | Siemens | 2 | February 28, 2008 23:12 |
Data transfer | H. P. LIU | Main CFD Forum | 5 | May 19, 2003 11:47 |