High Performance Optimizations For Nuclear Physics Code Mfdn On Knl
Brandon Cook,Pieter Maris,Meiyue Shao,Nathan Wichmann,Marcus Wagner,John O'Neill,Thanh Phung,Gaurav Bansal
DOI: https://doi.org/10.1007/978-3-319-46079-6_26
2016-01-01
Abstract:Initial optimization strategies and results on MFDn, a large-scale nuclear physics application code, running on a single KNL node are presented. This code consists of the construction of a very large sparse real symmetric matrix and computing a few lowest eigen-values and eigen-vectors of this matrix through iterative methods. Challenges addressed include effectively utilizing MCDRAM with representative input data for production runs on 5,000 KNL nodes that require over 80GB of memory per node, using OpenMP 4 to parallelize functions in the construction phase of the sparse matrices, and vectorizing those functions in spite of while-loops, conditionals, and lookup tables with indirect indexing. Moreover, hybrid MPI/OpenMP is employed not only to maximize the total problem size that can be solved per node, but also to eventually minimize parallel scaling overhead through the best scaling combination of MPI ranks per node with OpenMP threads. We describe a vectorized version of a popcount operation to avoid serialization on intrinsic popcnt which only operates on scalar registers. Additionally we leverage SSE 4.2 string comparison instructions to determine nonzero matrix elements. By utilizing MCDRAM, we achieve excellent Sparse Matrix-Matrix multiplication performance; in particular, using blocks of 8 vectors lead to a speedup of 6.4x on KNL and 2.9x on Haswell compared to the performance of repeated SpMV's. This optimization was essential in achieving a 1.6x improvement on KNL over Haswell.