NPAR: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


Description: {{TAG|NPAR}} determines the number of bands that are treated in parallel. This is a legacy tag; use {{TAG|NCORE}} instead.
Description: {{TAG|NPAR}} determines the number of bands that are treated in parallel. This is a legacy tag; use {{TAG|NCORE}} instead.
----
----
{{NB|warning|{{TAG|NCORE}} is the recommended tag for controlling band-level parallelization and has been available since VASP.5.2.13. It is more intuitive and directly expresses the size of each band group. Only use {{TAG|NPAR}} if you have a specific reason to prefer it. If both {{TAG|NPAR}} and {{TAG|NCORE}} are specified in the {{FILE|INCAR}} file, {{TAG|NPAR}} takes precedence.}}
{{NB|warning|{{TAG|NCORE}} is the recommended tag for controlling band-level parallelization and has been available since VASP.5.2.13. It is more intuitive and directly expresses the size of each band group. Only use {{TAG|NPAR}} if you have a specific reason to prefer it. If both {{TAG|NPAR}} and {{TAG|NCORE}} are specified in the {{FILE|INCAR}} file, {{TAG|NPAR}} takes precedence.}}


Line 18: Line 16:


The default ({{TAG|NPAR}} = available ranks) is equivalent to {{TAG|NCORE|1}}: each band is handled by a single rank.
The default ({{TAG|NPAR}} = available ranks) is equivalent to {{TAG|NCORE|1}}: each band is handled by a single rank.
{{NB|warning|Setting {{TAG|NPAR|1}} means all available ranks collaborate on a single band (plane-wave coefficient distribution only). No band parallelization occurs. This is almost always very slow and should be avoided.}}
{{NB|warning|Setting {{TAG|NPAR|1}} means all available ranks collaborate on a single band (plane-wave coefficient distribution only). No band parallelization occurs. This is almost always very slow and should be avoided.}}
{{NB|tip|See the [[optimizing the parallelization]] page for a step-by-step guide to finding the best parallelization setup for your system, and {{TAG|NCORE}} for information on how to parallelize over [[Energy_cutoff_and_FFT_meshes#FFT_mesh|FFTs]] in particular.}}
{{NB|tip|See the [[optimizing the parallelization]] page for a step-by-step guide to finding the best parallelization setup for your system, and {{TAG|NCORE}} for information on how to parallelize over [[Energy_cutoff_and_FFT_meshes#FFT_mesh|FFTs]] in particular.}}
Line 29: Line 26:
{{TAG|NSIM}},
{{TAG|NSIM}},
{{TAG|LSCALAPACK}},
{{TAG|LSCALAPACK}},
{{TAG|LSCAAWARE}},
{{TAG|LSCAAWARE}}
 
[[GPU ports of VASP]],
[[GPU ports of VASP]],
[[Combining MPI and OpenMP]],
[[Combining MPI and OpenMP]],
[[Optimizing the parallelization]],
[[Optimizing the parallelization]],
[[:Category:Parallelization]],
[[Parallelization]],
[[Energy cutoff and FFT meshes]]
[[Energy cutoff and FFT meshes]]


{{sc|NPAR|HowTo|Workflows that use this tag}}
{{sc|NPAR|HowTo|Workflows that use this tag}}
----


[[Category:INCAR tag]][[Category:Performance]][[Category:Parallelization]]
[[Category:INCAR tag]][[Category:Performance]][[Category:Parallelization]]
== Related tags and articles ==
{{TAG|NCORE}},
{{TAG|KPAR}},
{{TAG|LPLANE}},
{{TAG|LSCALU}},
{{TAG|NSIM}},
[[Optimizing the parallelization]],
[[:Category:Parallelization]]
{{sc|NPAR|Examples|Examples that use this tag}}
----
[[Category:INCAR tag]][[Category:Parallelization]]

Latest revision as of 09:35, 18 March 2026

NPAR = [integer]
Default: NPAR = available ranks 

Description: NPAR determines the number of bands that are treated in parallel. This is a legacy tag; use NCORE instead.


Warning: NCORE is the recommended tag for controlling band-level parallelization and has been available since VASP.5.2.13. It is more intuitive and directly expresses the size of each band group. Only use NPAR if you have a specific reason to prefer it. If both NPAR and NCORE are specified in the INCAR file, NPAR takes precedence.

Relationship to NCORE

VASP distributes the available MPI ranks into band groups that each work on one band, parallelizing the FFTs for that band. For the common case that IMAGES = 1 and no other algorithm-dependent parallelization (e.g., NOMEGAPAR) is active::

[math]\displaystyle{ \text{available ranks} = \frac{\text{total MPI ranks}}{\text{KPAR}} }[/math]

NPAR sets the number of band groups; NCORE sets the size of each band group. They are strict inverses:

[math]\displaystyle{ \text{NPAR} \times \text{NCORE} = \text{available ranks} }[/math]

The default (NPAR = available ranks) is equivalent to NCORE = 1: each band is handled by a single rank.

Warning: Setting NPAR = 1 means all available ranks collaborate on a single band (plane-wave coefficient distribution only). No band parallelization occurs. This is almost always very slow and should be avoided.
Tip: See the optimizing the parallelization page for a step-by-step guide to finding the best parallelization setup for your system, and NCORE for information on how to parallelize over FFTs in particular.

Related tags and articles

NCORE, KPAR, LPLANE, LSCALU, NSIM, LSCALAPACK, LSCAAWARE

GPU ports of VASP, Combining MPI and OpenMP,

Optimizing the parallelization, Parallelization, Energy cutoff and FFT meshes

Workflows that use this tag