More Profiling StudiesA large number of studies were carried out to find the best optimisation and setup for KtJet. Initial studies showed that KtJet in double precision mode gave identical outputs to the Fortram ktclus. Furthermore, KtJet in single precision mode gave a large increase in efficency and speed of running with no significant change to the output (matching all the Fortran ktclus output jets to atleast 5 decimal places.) Optimised compilation of KtJet is vital. The nature of Kt clustering means that the time taken to run goes as a funtion of n**3 to the number of input particles (n). With no optimisation KtJet can appear like a slow dinosaur in comparision to the Fortran (see figure 1.0). However, as soon as the optimisation flags are switched on in the compiler the KtJet executable out performs the fortran for cpu time used to reconstruct jets. Even the Double precision version of KtJet is significantly faster than the Fortran ktclus. (see figures 1.1) It can be seen that for gcc-2.96 optimisation flags -O1 (figure 1.1), -O2 (figure 1.2) and -O3 (figure 1.3) all give results where the KtJet is faster than Fortran ktclus. Figure 1.0: Average time to cluster jets in event versus number of input particles. No optimisation flags used in compilation. (Black - Fortran, Blue - KtJet Double precision, Red - KtJet Single precision.) Figure 1.1: Average time to cluster jets in event versus number of
input particles. Figure 1.2: Average time to cluster jets in event versus number of
input particles. Figure 1.3: Average time to cluster jets in event versus number of
input particles. The question as to which optimisation is best to use is dependent on the compiler and platform used and also the clustering flags set. Studies using gcc-2.96 and clustering PP events are shown in tables 1.0, 1.1 and 1.2 for optimisation -O1, -O2 and -O3 respectively. It can be seen that for the fortran it the most efficient optimisation flag is very dependent on the clustering scheme chosen, however, for KtJet there is no obvious variance and -O1 seem to give the best performance in all cases (-O2 gives smallest executable). Studies using 100 PP events each run over 10 times to get the average call time per event, using DeltaR distance scheme and E recombination scheme, were carried out for each optimisation flag. This was done for various numbers of input particles. The results for the Fortran ktclus can be seen in figure 2.0. Although optimisation gives some improvement in performance the effects are fairly small. The Results for KtJet (figures 2.1 and 2.2) on the other hand show both the importance of optimisation on performance and also getting the right optimisation flag. gcc-2.96 achieves best results with -O1.
Table 1.0 : Average time to cluster jets in events. Inclusive mode, PP events, gcc optimization flag = -O1
Table 1.1 : Average time to cluster jets in events. Inclusive mode, PP events, gcc optimization flag = -O2
Table 1.2 : Average time to cluster jets in events. Inclusive mode, PP events, gcc optimization flag = -O3 Figure 2.0: Average time to cluster jets in event versus number of input particles for the Fortran ktclus program using various optimisation flags. (Black No optimisation, Blue -O1, Red -O2, Green -O3.) Figure 2.1: Average time to cluster jets in event versus number of input particles for double precision KtJet using various optimisation flags. (Black No optimisation, Blue -O1, Red -O2, Green -O3.) Figure 2.2: Average time to cluster jets in event versus number of input particles for single precision KtJet using various optimisation flags. (Black No optimisation, Blue -O1, Red -O2, Green -O3.) Different compiler versionsStudies were also made using different gcc compiler versions to reconstruct the jets in events using the single precision KtJet. The results are shown below. The general trend of best optimisation to use appears the same for all compilers. -O1 seems to give the fastest executable and the speeds at this optimisation are comparable for all three versions of compiler tested. Figure 3.0: Average time to cluster jets in event versus number of input particles for the Fortran ktclus program using various gcc compiler versions with optimisation flag set to -O1. (Black gcc-2.95.2, Blue gcc-2.96, Green gcc-3.1.1) Figure 3.1: Average time to cluster jets in event versus number of input particles for the Fortran ktclus program using various gcc compiler versions with optimisation flag set to -O2. (Black gcc-2.95.2, Blue gcc-2.96, Green gcc-3.1.1) Figure 3.3: Average time to cluster jets in event versus number of input particles for the Fortran ktclus program using various gcc compiler versions with optimisation flag set to -O3. (Black gcc-2.95.2, Blue gcc-2.96, Green gcc-3.1.1) |