Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S sdv-lammps
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 100
    • Issues 100
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • djurado
  • sdv-lammps
  • Wiki
  • Loop size

Loop size · Changes

Page history
Create Loop size authored Jan 17, 2023 by djurado's avatar djurado
Hide whitespace changes
Inline Side-by-side
Loop-size.md 0 → 100644
View page @ b53b223f
When vectorizing a loop, it is important to consider the number of loop iterations.
It may not be worth vectorizing a loop that features a very small iteration count, since it can lead to underusing of the vector registers and may prove slower than the serial version.
`PairLJCharmmCoulLong::compute` deals with interactions of pair of atoms `i,j`.
The outer loop that traverses through the 32000 `i` atoms in the protein input.
For each `i` atom, the inner loop traverses through atoms `j` that are neighbors of `i`.
Moreover, each `i` atom can have a different amount of neighbors (`numneigh[i]`).
Our optimization targets the vectorization of the inner loop, so its iteration count will determine if the loop is worth vectorizing.
After modifying the code to print the number of inner loop iterations, we found that on average, the inner loop contains 375 iterations.
Considering that registers in the 0.7 vector unit can hold up to 256 64-bit elements, the loop can be considered suitable for vectorizing iteration count wise.
One can increase the number of iterations in the inner loop by increasing the neighbor distance threshold.
This neighbor threshold is set automatically according to the interaction distance thresholds specified in the `pair_style lj/charmm/coul/long X Y` command.
The largest interaction distance accepted by LAMMPS produced an average of 1290 inner loop iterations.
It may be interesting to do some tests to see how higher inner loop iteration counts affect performance when comparing with the serial version.
| input line | inner loop avg. iterations |
| ---------- | -------------------------- |
| `pair_style lj/charmm/coul/long 8.0 10.0` | 375 |
| `pair_style lj/charmm/coul/long 8.0 16.1` | 1290|
\ No newline at end of file
Clone repository

Home

  1. Introduction
  2. Overview
  3. Implementation
    • Specialization
  4. Implementation

Sidebar