mpcd.tune

Overview

ParticleSorter

MPCD particle sorter.

Details

MPCD tuning operations.

These operations will affect the performance of MPCD simulations but not their correctness.

class hoomd.mpcd.tune.ParticleSorter(trigger)

Bases: TriggeredOperation

MPCD particle sorter.

Parameters:

trigger (hoomd.trigger.trigger_like) – Select the time steps on which to sort.

This tuner sorts the MPCD particles into cell order. To perform the sort, the cell list is first computed with the current particle order. Particles are then reordered in memory as they are stored in the cell list, which can significantly improve performance of all subsequent cell-based steps of the MPCD algorithm due to improved cache coherency.

The optimal frequency for sorting depends on the number of particles, so the trigger itself should be tuned to give the maximum performance. The trigger’s period should be a multiple of hoomd.mpcd.collide.CollisionMethod.period to avoid unnecessary cell list builds. Typically, using a small multiple (tens) of the collision period works best.

To achieve the best performance, the ParticleSorter is not added to hoomd.Operations.tuners. Instead, set it in hoomd.mpcd.Integrator.mpcd_particle_sorter.

Essentially all MPCD systems benefit from sorting, so it is recommended to use one for all simulations!

Example:

sorter = hoomd.mpcd.tune.ParticleSorter(trigger=20)
simulation.operations.integrator.mpcd_particle_sorter = sorter
trigger

Number of integration steps between sorting.

Example:

sorter.trigger = 20
Type:

hoomd.trigger.Trigger