On Thu, 29 Nov 2007, João Luís Silva wrote:
I've found that the parallelization of my simulations is being limited by
add-flux. I'm using a dual Xeon 5335, and for the appended example it takes

The problem is that your computation time is apparently dominated by the flux computation (at every time step, it has to accumulate the field Fourier transforms at every point in the flux region). The flux computation is parallelized, but only in the sense that each processor computes the Fourier transforms for flux points in its "own" chunk of the grid. If the division of the grid between processors (into roughly equal chunks) allocates most of the points where the flux is computed to one processor, it is not going to parallelize.

Ideally, the parallelization should take the flux computation into account, in the sense that it would try to divide the grid so that the flux region (if it is expensive enough) is divided among the processors. The best approach would be some kind of adaptive load-balancing. However, nothing like this is implemented right now.

One option is to reduce the cost of the flux calculation by reducing the number of frequency points. If you need high frequency resolution in a certain bandwidth, consider adding a second flux region just for that bandwidth, with as many points as you need there, and use a smaller number of frequency points over a broad bandwidth.

Another option might be to change your structure so that the flux region is closer to the center of the grid, which will increase the likelihood that the parallelization will divide the grid in such a way as to split the flux region between different processors.

Regards,
Steven G. Johnson
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to