LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

fix gpu command

Syntax:

fix ID group-ID gpu mode first last split 

Examples:

fix 0 all gpu force 0 0 1.0
fix 0 all gpu force 0 0 0.75
fix 0 all gpu force/neigh 0 0 1.0
fix 0 all gpu force/neigh 0 1 -1.0 

Description:

Select and initialize GPUs to be used for acceleration and configure GPU acceleration in LAMMPS. This fix is required in order to use any style with GPU acceleration. The fix must be the first fix specified for a run or an error will be generated. The fix will not have an effect on any LAMMPS computations that do not use GPU acceleration, so there should not be any problems with specifying this fix first in input scripts.

The mode setting specifies where neighbor list calculations will be performed. If mode is force, neighbor list calculation is performed on the CPU. If mode is force/neigh, neighbor list calculation is performed on the GPU. GPU neighbor list calculation currently cannot be used with a triclinic box. GPU neighbor list calculation currently cannot be used with hybrid pair styles. GPU neighbor lists are not compatible with styles that are not GPU-enabled. When a non-GPU enabled style requires a neighbor list, it will also be built using CPU routines. In these cases, it will typically be more efficient to only use CPU neighbor list builds.

The first and last settings specify the GPUs that will be used for simulation. On each node, the GPU IDs in the inclusive range from first to last will be used.

The split setting can be used for load balancing force calculation work between CPU and GPU cores in GPU-enabled pair styles. If 0<split<1.0, a fixed fraction of particles is offloaded to the GPU while force calculation for the other particles occurs simulataneously on the CPU. If split<0, the optimal fraction (based on CPU and GPU timings) is calculated every 25 timesteps. If split=1.0, all force calculations for GPU accelerated pair styles are performed on the GPU. In this case, hybrid, bond, angle, dihedral, improper, and long-range calculations can be performed on the CPU while the GPU is performing force calculations for the GPU-enabled pair style.

In order to use GPU acceleration, a GPU enabled style must be selected in the input script in addition to this fix. Currently, this is limited to a few pair styles and the PPPM kspace style.

See this section of the manual for more details about using the GPU package.

Restart, fix_modify, output, run start/stop, minimize info:

This fix is part of the "gpu" package. It is only enabled if LAMMPS was built with that package. See the Making LAMMPS section for more info.

No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix.

No parameter of this fix can be used with the start/stop keywords of the run command.

Restrictions:

The fix must be the first fix specified for a given run. The force/neigh mode should not be used with a triclinic box or hybrid pair styles.

The split setting must be positive when using hybrid pair styles.

Currently, group-ID must be all.

Related commands: none

Default: none