ner_tags: O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Model I-Model I-Model I-Model I-Model I-Model I-Model I-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O O O O O O O O O O O O O O O O O O B-Software O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O O O B-Software O O O O O O O O O O O O O O O O O O O B-Software O B-Software O O O O O O O O O O O O B-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Software O O B-Software O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Organization O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O
tokens: counting pairs of i and j objects with unitary weights; and the weighted case, accumulating the product of the weights w i * w j , selected randomly (in this case) from a Gaussian distribution with (σ, μ ) = (1.0,0.1). This is a mock-up of a common scenario for deriving 2PCFs from real surveys, where numerous bias and observational effects are accounted by means of properly chosen weights. From an implementation point of view, this means dealing with extra weight vectors and at least an extra floating-point multiplication deeply nested inside loops. For this reason, Gundam uses slightly different versions of the counting algorithm to accommodate these two cases. From the figure it can be seen that our code, which is based in a completely different algorithm, performs as well and even better than Corrfunc . In ( r p , π) space, it can be up to 1.4 × faster. In angular space Gundam can be slightly slower. However, if non-unitary weights are required, our code can run up to 30 per cent faster. The timings for very few particles, e.g. below few times 10 4 , should be ignored as the dominant component there is most likely the overhead of grid creation or array manipulation. Gundam , as well as Corrfunc , are intended primarily for processing much larger samples. Figure 5. Single-core run time to calculate DD pairs with Gundam and Corrfunc codes for samples up to 2 × 10 6 objects, using random Gaussian weights or a single constant weight equal to 1 (unweighted pair count case). Performance is evaluated in ( r p , π) space (left) and angular space (right). Bottom panels show the speed-up factor of Gundam respect to Corrfunc for the weighted and unweighted case. 3.2 Multithread We run a series of tests in the described set-up, running the same pair counts with 2, 3, and 4 threads that execute in each of the physical CPU cores. There is little benefit in using extra virtual threads (i.e. the Hyper-Threading technology of Intel CPUs) because the code is already computationally intensive, making extensive use of available CPU resources and floating-point pipelines. Also, since logical processors share the caches, they might actually compete for cache utilization, which can lead to a degradation of performance. Therefore, we only report up to four threads, noting that eight threads can potentially bump the performance by 25 per cent. In Fig. 6 , we can see that below 3–4 × 10 4 objects there is a bias towards slightly longer run times independent of the number of threads. As said before, this is due to the overhead of allocating memory and arranging data into convenient structures. In fact, a naive pair counting algorithm might probably run faster for very small samples. For larger samples, the overhead is less relevant and the advantage of using multiple threads in parallel starts to become significant. For around 10 6 particles in ( r p , π) space, we get a close to constant speed-up factor of 1.9, 2.8, and 3.6, when we duplicate, triplicate, or