boutproject / BOUT-dev

BOUT++: Plasma fluid finite-difference simulation code in curvilinear coordinate systems
http://boutproject.github.io/
GNU Lesser General Public License v3.0
179 stars 94 forks source link

Communication of corner guard cells #1787

Open johnomotani opened 4 years ago

johnomotani commented 4 years ago

In BoutMesh::send() we are sending buffers with length LocalNx. I think we are communicating the corner guard cells when we send data in the y-direction (but not when we send in the x-direction). We could get a small optimization by not communicating them, since they do not contain valid data.

d7919 commented 4 years ago

For small messages the communication cost is usually fairly insensitive to the actual amount of data being sent so I'm not sure if this would gain us much in practice. But if it doesn't increase code complexity then there's also not much reason to avoid changing this.

dschwoerer commented 4 years ago

If the communication would be ordered, i.e. first the y communication, then the x with valid guard cells, we would ensure that corner guard cells would be valid. In addition with boundaries for the corners, we could allow mixed derivatives without additional communication in between. Even without corner cells boundary conditions, we would only require applying bc, but no communication.

bendudson commented 4 years ago

This works for simply connected domains, but around the X-point the corner cells are more difficult, and in some coordinate systems multi-valued.