I guess I have part of my answer from an older question I asked last year: http://permalink.gmane.org/gmane.comp.python.fipy/2353
In there Jonathan mentioned: > The issue is that flux is a FaceVariable and although we define a > globalValue for FaceVariables, it > doesn't look like it has a clear meaning. The issue is that there are > cells and faces that overlap multiple > processors. The globalValue for a CellVariable properly accounts for the > ghost cells, but > FaceVariables do not. There hasn't been any internal need to and we > suspect that clearing it up will be a > mess (there is an ambiguity with faces that doesn't exist with cells; some > faces are shared between > processors even for non-overlapping cells). We do need to examine whether > globalValue should even be > defined for anything besides CellVariables. Since what I'm trying to do is just get face centers so I can make a convex hull around what is essentially an internal "hole" in the mesh. If I just want to merge the face centers from each process should I use MPI comm primitives to pull them together or is there a cleaner way to get this within the existing framework? Thanks! Also, congrats on getting 3.1 out, especially in terms of timing :-) On Tue, Oct 15, 2013 at 3:42 PM, James Snyder <[email protected]>wrote: > Hi - > > I've been trying to adjust some code to work in parallel, but I've run > into a bit of a snag for one situation where I need to get faceCenters for > a computation (want to draw a convex hull around a shape on my plots). > When I try to get global face centers on a mesh > (mesh.faceCenters.globalValue) and check the shape, I get different values > for the shape of what should be a global value depending on the number of > mpi jobs started. > > For example, I modified parallel.py: > from fipy import parallelComm, Grid2D > > mesh = Grid2D(nx=10,ny=10) > > fipy_info = "FiPy: %d on %d of %d. face shape %d x %d, cell shape: %d x > %d" % (mesh.numberOfCells, > > parallelComm.procID, > > parallelComm.Nproc, > > mesh.faceCenters.globalValue.shape[0], > > mesh.faceCenters.globalValue.shape[1], > > mesh.cellCenters.globalValue.shape[0], > > mesh.cellCenters.globalValue.shape[1]) > > print " :: ".join((fipy_info,)) > > I get: > m@ediacaran:~> mpirun -np 1 python parallel.py --trilinos > FiPy: 100 on 0 of 1. face shape 2 x 220, cell shape: 2 x 100 > m@ediacaran:~> mpirun -np 2 python parallel.py --trilinos > FiPy: 70 on 0 of 2. face shape 2 x 157, cell shape: 2 x 100 > FiPy: 70 on 1 of 2. face shape 2 x 157, cell shape: 2 x 100 > m@ediacaran:~> mpirun -np 4 python parallel.py --trilinos > FiPy: 40 on 0 of 4. face shape 2 x 136, cell shape: 2 x 100 > FiPy: 60 on 1 of 4. face shape 2 x 136, cell shape: 2 x 100 > FiPy: 60 on 2 of 4. face shape 2 x 136, cell shape: 2 x 100 > FiPy: 60 on 3 of 4. face shape 2 x 136, cell shape: 2 x 100 > > Is there something I should be doing differently? It seems like the > global cellCenters are consistent, but not the faceCenters. > > I'm running what should be current out of trunk, fipy.__version__ is 3.1. > It was build from 6e897df400126ff8b935dd7344469f7c762c8553. > > -- > James Snyder > Biomedical Engineering > Northwestern University > ph: (847) 448-0386 > -- James Snyder Biomedical Engineering Northwestern University ph: (847) 448-0386
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
