Small optimisations for exb routine

Merged
#551 · Created  · Last updated

Merged pull request

Merged in minor/small_optimisations_for_exb_routine (pull request #551)

f72af70·Author: ·Closed by: ·2021-11-25

Description

  • Use named variable for repeated logic

  • Cleanup treatment of optional and remove commented lines

  • Add comment on shift/jump calculation

  • Leave exb_shear early if no jumps

  • Add a comment about use of redistributes

  • Communicate both sigma at once in exb_shear (flux tube branch)

  • Communicate both sigma at once in exb_shear (ballooning space branch)

Mostly just comments and removing unused variables. Main code change is to remove the loop over sigma in the point-to-point communications. This shouldn’t be needed as the sender/receiver is independent of sign so here we double the size of messages but halve the number of messages. This is usually good for performance as it reduces the latency cost of communications. As the message sizes are typically small (originally 2*ntgrid+1 double complexes) we would expect them to be dominated by latency.

In the long run, these point-to-point communications should be converted to a redistribution. Currently we loop over the full global domain (all xyles) in order to do our communications in a synchronous, ordered way. We should be able to define the communication pattern during initialisation with loops over the local domain and then use this information during advance.

It should be noted that none of our test suite includes active exb shear and to fully test these changes, and the code in general, we would probably want to run such that we have split x .

There’s also the scope for reducing duplicated code in this routine but I’ve not (yet) pursued this as I didn’t want to make too many changes here all at once.

0 attachments

0 comments

Loading commits...