In addition to being used as the behavioral model in the verification testbench, the flexible SystemC RSCE model can also be used for precision analysis. This section describes how the precision of the BSpline calculation and the 3DFFT calculation affects the errors of the reciprocal energy and force calculations. Furthermore, this section also states the required BSpline and 3DFFT calculation precision to achieve the relative energy and force error goal of less than 10^{5}. The errors in the energy and forces calculations are derived by Equation 29, Equation 30, and Equation 31.
Equation 29 – Absolute Error
Equation 30 – Energy Relative Error
Equation 31 – Force RMS Relative Error
The “GOLDEN” subscript indicates that the reciprocal energy or forces are calculated with the SPME software package [8]; while the “FXPT_SC” subscript_{ }indicates that the reciprocal energy or forces are calculated with the fixedpointed SystemC RSCE model. Equation 30 is used for calculating the relative error in energy computation. On the other hand, Equation 31 is used for calculating the RMS relative error in forces computation.
To derive the relationship between the calculation precision and the magnitude of the relative force and energy errors, 10 singletimestep MD simulations are carried out for each precision setting and each simulation setting (K, P, and the Ewald Coefficient). A script is written to automate this precision analysis simulation process. The pseudo code of the script is shown in Figure 60. The forces and energy error in these simulations are recorded, averaged, and plotted to show the effect of calculation precision on the energy and forces errors. The system being simulated is chargeneutral and it contains 100 randomly located particles with randomized charge within the range of [5.0, 5.0]. The simulation box is orthogonal with dimensions 16.0A^{o} x 16.0A^{o} x 16.0A^{o}.
Ewald Coefficient E = 0.30
Interpolation order P = 4
Grid size K = 16
NumSet = 3
NumRunInSet = 10
for each FFT precision {14.18, 14.22, 14.26, 14.30}:
for each FFT precision {1.21, 1.24, 1.27, 1.30}:
Recompile the RSCE SystemC model with the corresponding precision.
for 1 to NumSet
Set E, P and K
for 1 to NumRunInSet
Randomize coordinates within 16.0A^{o}x16.0A^{o}x 16.0A^{o} box
Randomize charges with range [5.0, 5.0]
Regenerate PDB file
Run singletimestep MD simulation
Record the errors
end for
increment E by 0.05
increment P by 2
increment K to the next power of 2
end for
end for
end for
Figure 60  Pseudo Code for the FC Block
In addition to deriving the relationship between the calculation precision and the magnitude of the relative errors, these simulations runs are also used to find out the preliminary minimum precision requirement to achieve the 10^{5} relative error goal which is stated in Section 3.6. Since the simulation time will be very lengthy if hundreds of precision simulations are done for each possible precision setting, the effort to find the minimum precision requirement is done in two passes. In the first pass, 10 singletimestep simulations are performed for different simulation settings on each calculation precision to screen out those precision settings that are not likely to achieve the 10^{5} relative error goal. Then, in the second pass, for those leftover precision settings that are likely to achieve the relative error goal, another 200 singletimestep simulations for each simulation setting are performed on them to iron out the minimum precision requirement that should be able to achieve the relative error goal reliably.
The results for the 10 singletimestep simulation runs are shown in Tables 25 and 26. As shown in Table 26, with P=8 and K=64, a FFT precision of {14.26} and a BSpline precision of {1.21} is found to be the preliminary minimum precision requirement to achieve the 10^{5} relative error goal. Those precision settings which are not as precise as this preliminary minimum precision requirement are not likely to achieve the 10^{5} relative error goal reliably. To iron out the minimum precision requirement, another 200 simulation runs are performed on those precision settings that are more precise than the preliminary minimum precision requirement. After the 200 simulation runs are carried out, it is found that a FFT calculation precision of {14.30} and a BSpline calculation precision of {1.27} can achieve the relative error goal in all 200 simulation runs. The result for these 200 simulation runs for P=8 and K=64 is summarized in Table 27. In this table, only the average and the maximum relative force and energy error are shown.
One thing worthwhile to notice is that the input coordinate precision of {8.21} and the input charge precision of {5.21} are not varying in these simulations. To investigate the effect of these input precisions on the relative error, the script can be modified to perform such precision analysis. However, due to the time constraint to finish this thesis on time, the input precision analysis is not done for this thesis and is left for future work. In the following sections, the individual effect of the BSpline precision and the FFT precision on the output relative error is investigated.
Table 25  Average Error Result of Ten SingleTimestep Simulation Runs (P=4 , K=32)
FFT
(SFXP)

BSP
(SFXP)

Energy
ABS Err

Energy
Rel. Err

Force
ABS Err

Force
RMS Rel Err

Rel. Error
< 1e5

{14.18}

{1.21}

3.47E05

3.46E07

5.40E04

2.92E05

FALSE

{14.18}

{1.24}

5.86E05

5.83E07

5.23E04

2.90E05

FALSE

{14.18}

{1.27}

8.11E05

8.07E07

5.24E04

2.90E05

FALSE

{14.18}

{1.30}

7.80E05

7.76E07

5.24E04

2.90E05

FALSE








{14.22}

{1.21}

5.02E05

4.99E07

3.51E05

2.78E06

TRUE

{14.22}

{1.24}

1.81E05

1.80E07

3.13E05

2.55E06

TRUE

{14.22}

{1.27}

1.84E05

1.83E07

2.87E05

2.47E06

TRUE

{14.22}

{1.30}

1.97E05

1.96E07

2.81E05

2.48E06

TRUE








{14.26}

{1.21}

6.92E05

6.88E07

2.71E05

1.00E06

TRUE

{14.26}

{1.24}

4.09E05

4.07E07

2.38E06

1.56E07

TRUE

{14.26}

{1.27}

3.96E05

3.93E07

2.32E06

1.67E07

TRUE

{14.26}

{1.30}

3.95E05

3.93E07

2.30E06

1.65E07

TRUE








{14.30}

{1.21}

6.96E05

6.92E07

2.67E05

9.77E07

TRUE

{14.30}

{1.24}

4.24E05

4.22E07

1.23E06

9.98E08

TRUE

{14.30}

{1.27}

3.98E05

3.95E07

1.04E06

9.60E08

TRUE

{14.30}

{1.30}

4.04E05

4.01E07

1.05E06

9.72E08

TRUE

Table 26  Average Error Result of Ten SingleTimestep Simulation Runs (P=8, K=64)
FFT
(SFXP)

BSP
(SFXP)

Energy
ABS Err

Energy
Rel. Err

Force
ABS Err

Force
RMS Rel. Err

Rel. Error
< 1e5

{14.18}

{1.21}

1.22E03

1.63E05

3.75E04

6.74E05

FALSE

{14.18}

{1.24}

1.30E03

1.73E05

3.81E04

6.79E05

FALSE

{14.18}

{1.27}

1.33E03

1.77E05

3.81E04

6.75E05

FALSE

{14.18}

{1.30}

1.34E03

1.78E05

3.81E04

6.75E05

FALSE








{14.22}

{1.21}

1.21E04

1.61E06

7.57E05

2.05E05

FALSE

{14.22}

{1.24}

1.14E04

1.51E06

4.03E05

1.70E05

FALSE

{14.22}

{1.27}

1.13E04

1.51E06

4.10E05

1.69E05

FALSE

{14.22}

{1.30}

1.15E04

1.54E06

4.10E05

1.69E05

FALSE








{14.26}

{1.21}

6.75E05

8.99E07

5.47E05

6.99E06

TRUE

{14.26}

{1.24}

4.15E05

5.53E07

9.13E06

1.49E06

TRUE

{14.26}

{1.27}

4.45E05

5.93E07

3.15E06

9.30E07

TRUE

{14.26}

{1.30}

4.54E05

6.05E07

2.57E06

8.65E07

TRUE








{14.30}

{1.21}

6.54E05

8.71E07

5.49E05

6.64E06

TRUE

{14.30}

{1.24}

3.68E05

4.90E07

9.97E06

1.21E06

TRUE

{14.30}

{1.27}

3.85E05

5.12E07

1.60E06

6.69E07

TRUE

{14.30}

{1.30}

3.89E05

5.19E07

1.55E06

6.14E07

TRUE

Table 27  Error Result of 200 SingleTimestep Simulation Runs (P=8, K=64)
FFT
(SFXP)

BSP
(SFXP)

Avg. Energy
Rel. Err

Max. Energy
Rel. Err

Avg. Force
RMS Rel. Err

Max. Force
RMS Rel. Err

Rel. Error
< 1e5

{14.26}

{1.21}

7.55E07

2.12E06

3.67E05

4.76E04

FALSE

{14.26}

{1.24}

6.87E07

1.45E06

4.01E06

3.92E05

FALSE

{14.26}

{1.27}

6.11E07

1.17E06

3.35E06

2.08E05

FALSE

{14.26}

{1.30}

6.01E07

1.03E06

2.06E06

1.12E05

FALSE








{14.30}

{1.21}

7.16E07

1.78E06

5.29E06

8.27E04

FALSE

{14.30}

{1.24}

5.81E07

1.00E06

3.98E06

3.89E05

FALSE

{14.30}

{1.27}

5.99E07

1.28E06

1.98E06

9.80E06

TRUE

{14.30}

{1.30}

5.70E07

1.01E06

1.70E06

7.80E06

TRUE

7.2.1.Effect of the BSpline Calculation Precision
This section shows the effect of the BSpline coefficient and derivative calculation precision on the magnitude of the reciprocal energy and forces error. Three precision analysis plots with a constant FFT calculation precision of {14.30} are shown in Figure 61 to Figure 63. These graphs are plotted with the simulation data shown in Tables 25 and 26 and the BSP_FRAC in these plots represents the number of fractional bits used in the BSpline calculation. In these plots, the effect of increasing BSpline calculation precision on the magnitude of the relative error is shown. Figure 61 shows the effect on the relative error of the energy, Figure 62 shows the effect on the maximum absolute error of the forces, and Figure 63 shows the effect on the RMS relative error of the forces.
As seen from the plots, an increase in the BSpline calculation precision leads to an increase in the relative accuracy of the energy and forces calculation. However, the increase is saturated at a minimum relative error of ~1x10^{6}. This accuracy limitation can be caused by the input variables precision and also by the FFT calculation precision. Also observed from the plots is that a higher interpolation order and a larger grid size can lead to a higher relative error in both energy and forces. This is because the higher interpolation order and the larger grid size would mean more calculations are carried out and thus, the accumulated error will increase.
Figure 61  Effect of the BSpline Precision on Energy Relative Error
Figure 62  Effect of the BSpline Precision on Force ABS Error
Figure 63  Effect of the BSpline Precision on Force RMS Relative Error
7.2.2.Effect of the FFT Calculation Precision
Similar to Section 5.2.1, this section shows the effect of the FFT calculation precision on the magnitude of the reciprocal energy and forces error. Three precision analysis plots with a constant BSpline calculation precision of {1.27} are shown in Figure 64 to Figure 66. These graphs are plotted with the simulation data shown in Tables 25 and 26 and the FFT_FRAC in these plots represents the number of fractional bits used in the FFT calculation. In these plots, the effect of increasing FFT calculation precision on the magnitude of the relative error is shown. Figure 64 shows the effect on the relative error of the energy, Figure 65 shows the effect on the maximum absolute error of the forces, and Figure 66 shows the effect on the RMS relative error of the forces.
As seen from the plots, increasing the FFT calculation precision decreases the relative error of the energy and forces calculation down to a minimum relative error of ~1x10^{6}. This accuracy limitation can be caused by the input variable precision.
Figure 64  Effect of the FFT Precision on Energy Relative Error
Figure 65  Effect of the FFT Precision on Force Max ABS Error
Figure 66  Effect of the FFT Precision on Force RMS Relative Error
Share with your friends: 