... | ... | @@ -118,12 +118,14 @@ It is important to consider carefully the implications of this when vectorizing. |
|
|
Vectorization is based on SIMD processing (single instruction, multiple data), but different code paths require different instructions.
|
|
|
With the RISC-V vector extension, this can be overcame with the help of masked instructions, which allows restricting writing the result of a vector instructions to only certain elements using a bitmask.
|
|
|
|
|
|
For instance, which proportion of the atom pairs belong to the *do nothing* group?
|
|
|
Even when using masked instructions to avoid updating *do nothing* atoms, instructions take some time to execute.
|
|
|
So, as opposed to the serial version, a *do nothing* atom has the same cost in time as any other atom in the vectorized version with masked instructions.
|
|
|
For instance, which proportion of the atom pair interactions (or inner loop iterations) belong to the *do nothing* group?
|
|
|
Even when using masked instructions to avoid updating *do nothing* itneractions, instructions take some time to execute.
|
|
|
So, as opposed to the serial version, a *do nothing* interactions has the same cost in time as any other atom in the vectorized version with masked instructions.
|
|
|
|
|
|
Before starting working on the vectorization, the code was modified to count the number of interactions that belong to each category.
|
|
|
The flowchart shows the average number number of interactions (for a single `i` atom in a timestep) that belong to each category, and the arrows show the same information in percentage form.
|
|
|
Black values show data for the default protein input, while red values correspond to the modified input described in section
|
|
|
|
|
|
Before starting working on the vectorization, the code de was modified to count the number of atoms that belong to each category.
|
|
|
The flowchart shows in black, the average number number of
|
|
|
|
|
|
|
|
|
### Managing 32 bit and 64 data types
|
... | ... | |