CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   discussions about the gatherList, scatterList, and combine (https://www.cfd-online.com/Forums/openfoam-programming-development/129451-discussions-about-gatherlist-scatterlist-combine.html)

openfoammaofnepo February 5, 2014 11:15

discussions about the gatherList, scatterList, and combine
 
Hi All,

I met some problems about the the gatherList, scatterList and combine in openfoam for panellization.

The example is as follows. I am still not very clear about the role of ListListOps::combine. I checked the source files but found that it is put the list into a larger list for the variables. However, after using gatherList, I think only the master processor (or root processor in the terminlogy of MPI) has the complete data (including all other processors' data). So here if combined is executed by all the processors or only the master? If the former, I think the non-master only has its own data. So the combined is meaningless. I am a little confused about this. Does anybody know something about this issue?

Code:

Pstream::gatherList(l)
List<scalar> L  = ListListOps::combine<List<scalar> >(l, accessOp<List<scalar> >());

if (Pstream::master())
{
    ......do something interesting here......
    the scalar b is calcualted here.
}

Pstream::scatterList(b);
List<scalar> B = ListListOps::combine<List<scalar> >(b, accessOp<List<scalar> >());



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