원시데이터 수집 시스템
선정목록으로

A generalized massively parallel ultra-high order FFT-based Maxwell solver

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Haithem Kallala — Maison de la Simulation, CEA, CNRS, Université Paris-Saclay, CEA Saclay, 91 191 Gif-sur-Yvette, France
  2. Jean-Luc Vay — Lawrence Berkeley National Laboratory, Berkeley, CA, USA
  3. Henri Vincenti — LIDYL, CEA, CNRS, Université Paris-Saclay, CEA Saclay, 91 191 Gif-sur-Yvette, France
DOI
10.1016/j.cpc.2019.07.009
저널
Computer Physics Communications
발행년도
2019
발행기관
Elsevier BV
피인용수
11
라이선스
publisher-specific-oa
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.cpc.2019.07.009
토픽
High voltage insulation and dielectric phenomena
OpenAlex ID
W2964095093

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

초록이 없습니다.

본문 49,857자

본문 펼치기
## A generalized massively parallel ultra-high order FFT-based Maxwell solver Haithem Kallala <sup>1a</sup>, Jean-Luc Vay <sup>2b</sup>, Henri Vincenti <sup>3c,∗</sup> aMaison de la Simulation, CEA, CNRS, Universit´e Paris-Saclay, CEA Saclay, 91 191 Gif-sur-Yvette, France bLawrence Berkeley National Laboratory, Berkeley, CA, USA cLIDYL, CEA, CNRS, Universit´e Paris-Saclay, CEA Saclay, 91 191 Gif-sur-Yvette, France Abstract Dispersion-free ultra-high order FFT-based Maxwell solvers have recently proven to be paramount to a large range of applications, including the high-fidelity modeling of high-intensity laser-matter interactions with Particle-In-Cell (PIC) codes. To enable a massively parallel scaling of these solvers, a novel parallelization technique was recently proposed, which consists in splitting the simulation domain into several processor sub-domains, with guard regions appended at each sub-domain boundaries. Maxwell’s equations are advanced independently on each sub-domain using local shared-memory FFTs (instead of a single distributed global FFT). This implies small truncation errors at sub-domain boundaries, the amplitude of which depends on guard regions sizes and order of the Maxwell solver. For moderate guard region sizes, this ’local’ technique proved to be highly scalable on up to a million cores and notably enabled the 3D modelling of so-called plasma mirrors, for which 8 guard cells only were enough to prevent truncation error growth. Yet, for other applications, the required number of guard cells might be much higher, which would severely limit the parallel efficiency of this technique due to the large volume of guard cells to be exchanged between sub-domains. In this context, we propose a novel parallelization technique that ensures very good scaling of FFT-based solvers with an arbitrarily high number of guard cells. Our ’hybrid’ technique consists in performing distributed FFTs on local groups of processors with guard regions now appended to boundaries of each group of processors. It uses a dual domain decomposition method for the Maxwell solver and other parts of the PIC cycle to keep the simulation load-balanced. This ’hybrid’ technique was implemented in the open source exascale library PICSAR. Benchmarks show that for a large number of guard cells (> 16), the ’hybrid’ technique offers a ×3 speed-up and ×8 memory savings compared to the ’local’ one. 1. Introduction 1.1. Context The ElectroMagnetic (EM) Particle-In-Cell (PIC) method [1, 2] has been the method of choice to model kinetic effects at play in the physics of high intensity laser plasma interactions also known as ’Ultra-High Intensity’ (UHI) physics. To describe the plasma and electromagnetic field dynamics, the EMPIC algorithm self-consistently advances Maxwell’s equations on a grid (Maxwell solver) and equations of motion of plasma pseudo-particles. As there is no diagnostic of the plasma and fields evolution at the extremely small time and length scales involved in UHI physics, the EM-PIC method has been crucial to interpret experiments, develop theoretical models as well as propose and guide novel experiments. In the last decades, the Maxwell solver used in most EM-PIC codes has been the so-called Finite Difference Time Domain (FDTD) Yee solver [3] that operates a second order finite difference in time and space to discretize Maxwell’s equations. This method has been very popular since the advent of distributedmemory parallel computers because it can be efficiently parallelized using a standard Cartesian domain decomposition. This ∗Corresponding author. E-mail address: henri.vincenti@cea.fr parallelization method splits the simulation domain into subdomains, with guard cells appended at the edges of each subdomain that stores electromagnetic fields values from immediate neighboring sub-domains. At each time step, Maxwell’s equations are then advanced on each processor sub-domain independently and guard cells exchanged between sub-domains. FDTD solvers are very local and demonstrated scaling on up to a million cores [4, 5] as required by the most demanding 3D EM-PIC simulations. Nevertheless, they induce spurious numerical dispersion of electromagnetic waves that reveals highly detrimental in the accurate modeling of laser-plasma-based applications. Mitigation of numerical dispersion errors usually requires very high spatio-temporal resolution that has prevented doing realistic 3D modeling on a large class of problems (including laser-plasma mirror interactions [6, 7]) for a long time. In contrast, ultra-high order p (stencil of width p/2), and in the infinite order p →∞ limit, FFT-based pseudo-spectral solvers, which advance electromagnetic fields in Fourier space (rather than configuration space), can bring much more accuracy than FDTD solvers for a given resolution. In particular, Haber et al showed [8] that under weak assumptions, Fourier transforming Maxwell’s equations in space yields an analytical solution for electromagnetic fields in time, called the PseudoSpectral Analytical Time Domain (PSATD) solver, which is accurate to machine precision for the electromagnetic modes resolved by the mesh. As a consequence this solver enables Preprint submitted to Computer Physics Communications December 19, 2018 (a) "Local" solver (b) "Hybrid" solver FFT FFT FFT FFT P1 P4 FFT guard region P2 P5 P3 P1 P2 P3 guard region guard region guard region guard region guard region guard region MPI group 1 MPI group 2 FFT FFT guard region P6 FFT guard region P4 P5 P6 Figure 1: Parallelization strategies for pseudo-spectral Maxwell solvers. (a) is a sketch of the ’Local’ approach where the simulation domain is split into multiple subdomains with guard cells appended at each sub-domain boundary. Guard cells hold copies of electromagnetic fields from adjacent sub-domains. Each sub-domain is handled independently by an MPI process. At each time step: (i) Maxwell’s equations are advanced independently on each MPI sub-domain using shared-memory ’local’ FFTs and (ii) guard cells are exchanged between adjacent MPI sub-domains. Panel (b) shows a sketch of the new ’hybrid’ approach presented in this paper. It consists in grouping several MPI sub-domains into a larger MPI group and perform a distributed FFT on the MPI ranks of this group. Guard cells are solely appended at the boundary of the MPI group leading to less memory redundancy and thus significant memory savings. At each time step: (i) Maxwell’s equations are advanced independently on a MPI group using a distributed FFT. (ii) Guard cells are exchanged between MPI groups. infinite order, imposes no Courant time step limit in vacuum and has no numerical dispersion. By lowering the resolution needed to reach a required accuracy compared to FDTD solvers [6, 7, 9], PSATD-type solvers have the potential to strongly reduce the time-to-solution of a large class of problems. 1.2. Scalability limits of global FFT-solvers Nevertheless, pseudo-spectral solvers employing distributed FFTs (later called ’global’ FTT solvers in the remainder of this article) have not been popular so far due to the difficulty to scale the distributed FFTs beyond 10, 000 cores [10], which is not enough to take advantage of the largest supercomputers (with up to millions of cores) required for 3D modeling. The main barrier to scale FFT computations emerges from the overhead induced by the global communications (’All’ to ’All’-type communication) required to transpose the data among all computing units. As a consequence, developing massively parallel distributed FFTs algorithms is extremely challenging and is still an active research area for computer scientists. 1.3. Recent advances in the scaling of FFT-based Maxwell solvers To break this scalability barrier, a pioneering grid decomposition technique was recently proposed for pseudo-spectral FFT-based electromagnetic solvers [11]. This technique consists in using a standard Cartesian domain decomposition strategy to parallelize pseudo-spectral solvers (cf. Fig. 1- (a)). Maxwell’s equations are solved independently on each MPI processor sub-domain using local FFTs (instead of a single global distributed FFT). Guard cells are exchanged between adjacent sub-domains at each time step. This technique is much more local and can be efficiently scaled providing that the number of guard cells is not too high. It comes however with small stencil truncation errors at sub-domain boundaries when the stencil width p/2 is higher than the number of guard cells ng. An important theoretical study [12] recently derived the analytical expression for the amplitude and phase of these truncation errors. It showed that choosing a very high but finite order p stencil can already strongly reduce truncation errors compared to infinite order while still ensuring extreme accuracy. The model also pointed out that very high order solvers p - 100 can be used with a moderate number of guard cells (ng ≪ p/2) while still guaranteeing low levels of truncation errors (potentially below machine precision). By providing the number of guard cells required to obtain a given level of truncation error as a function of solver order, time step and mesh size, this model is crucial to enable the parallelization technique in production simulations. This new type of FFT-based solvers (later called ’local’ FFTbased solvers) has been implemented and optimized in the high performance library PICSAR [5, 7]. They led to very good scaling on up to a million cores even for a moderate (ng < 10) number of guard cells and high solver orders p = 100. They notably enabled the very first accurate 3D simulations of laserplasma mirror interactions [7, 13, 14] that were used to interpret the latest experimental results at CEA Saclay obtained with the 100TW UHI100 laser. 2 2 <sup>11</sup> 2 <sup>10</sup> 2 <sup>9</sup> 2 <sup>8</sup> 2 <sup>7</sup> 2 <sup>6</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # cores 2 <sup>18</sup> (a) (b) (c) 2 <sup>9</sup> 2 <sup>17</sup> 2 <sup>8</sup> 2 <sup>7</sup> 2 <sup>6</sup> 2 <sup>5</sup> ng=32 ng=16 ng=8 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # cores 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # cores 2 <sup>16</sup> 2 <sup>15</sup> 2 <sup>14</sup> 2 <sup>13</sup> Figure 2: Evolution of strong scaling and memory consumption (grid quantities) of the pseudo-spectral PIC algorithm with the number of guard cells ng used (8 guard cells: red, 16 guard cells: blue, 32 guard cells: green) on Cray XC40 THETA cluster at ALCF (using 32768-262144 KNL cores) with one OpenMP thread per MPI. The FFTs are computed using the Intel MKL library. The simulation box consists in a homogeneous plasma with one particle per cell for both electrons and ions. Grid size: 240 x 6144 x 12288 grid cells. Panel (a) represents the scaling of the full PIC loop. Panel (b) represents the scaling of the pseudo-spectral solver only, including MPI-exchanges for grid quantities. Panel (c) represents the total memory consumption of grid quantities (ie field quantities). 1.4. Need for a more general massively parallel FFT-based Maxwell solver Yet, local FFT-based solvers may not be adapted to the modeling of certain classes of problems where the level of truncation errors need to be lower than machine precision for instance. In that case, the number of guard cells required ng might be higher and can strongly affect the strong or weak scaling of the local solver. This is illustrated on Fig. 2 where we compared the strong scaling of the local solver for different numbers of guard cells. As we can see on panels (a) and (b), although cases with a moderate number of guard cells succeed in keeping a good strong scaling, cases with a high number of guard cells quickly loose efficiency as the number of processors is increased. We can also note on panel (c) that due to an increased data redundancy, the total volume of memory required grows considerably as the number of guard cells/processors is increased. Both limitations in terms of memory consumption and strong scaling of the local solver call for new parallelization strategies allowing for the use of an arbitrarily high number of guard cells. In this article, we present a novel massively parallel pseudospectral solver that ensures excellent strong/weak scaling at large scale (up to 800k cores) while allowing for the use of high number of guard cells to significantly reduce truncation errors. The remainder of the paper is divided into three additional sections: 1. In section 2, we present the principle of the new parallelization method and its implementation in the high performance PIC library PICSAR, 2. In section 3, we present the benchmarks of the novel method on two large clusters (MIRA and THETA) available at the Argonne Leadership Computing Facility (ALCF), 3. In section 4, we conclude by presenting the perspectives brought by this novel method for the field of laser-plasma interaction. 2. Generalized massively parallel FFT-based Maxwell solver In this section, we propose a new parallelization technique for the FFT-based Maxwell solver. This new type of FFT-based solver (later called ’hybrid’ FFT-based solver) is a more general approach than the local solver as it permits the use of an arbitrary high number of guard cells while still ensuring extremely good scalability. 2.1. Principle of the new solver The principle of the hybrid solver is illustrated on Fig. 1- (b). Adjacent MPI sub-domains are grouped into MPI groups (two groups on Fig. 1- (b)). Guard cells are now solely appended to the MPI group boundaries (and not to each MPI sub-domain boundaries). At each time step: (i) Maxwell’s equations are advanced independently on a MPI group using a distributed FFT and (ii) guard cells are exchanged between adjacent MPI groups. 3 As we now detail, this solver allows for significant memory savings as well as a reduction of the total volume of data exchanged. 2.2. Advantages in terms of memory Let us assume a cubic mesh of size nx × ny × nz = n <sup>3</sup> splitted into np MPI sub-domains along each direction x, y and z. If ng guard cells are used for each MPI sub-domain, the total memory occupied by electromagnetic field arrays varies as: ��� ��� <u>�</u> 0 10 20 30 40 5 0 60 n mpi 30 2 20 1 10 0 (1) memory�3 <sup></sup>  strongly in Mtot <sup>loc</sup> <sup>= O</sup> Mtot <sup>loc</sup> p n3 p <sup>×</sup> - nnp + 2ng As expected, one can notice that this memory strongly increases with the number of guard cells ng. In addition, the maximum number of processors that can be used along each axis for this problem is given by nnp <sup>=</sup> <sup>ng,</sup> <sup>for which</sup> <sup>the</sup> <sup>total</sup> <sup>memory</sup> used culminates to: Mtot <sup>loc</sup> <sup>= 27Mn</sup> (2) where Mn would be the total memory occupied by field arrays without any extra memory coming from guard cells. This maximum limit Mtot <sup>loc</sup> <sup>does</sup> <sup>not</sup> <sup>depend</sup> <sup>on</sup> <sup>the</sup> <sup>number</sup> <sup>of</sup> guard cells ng. However, this maximum limit is attained for a much lower number of processors when ng ≫ 1, potentially limiting the maximum number of processors that can be used due to memory limitations. Let us now assume that MPI domains are grouped and that we use nmpi MPI processes per group along each axis. In this case, the total memory occupied by electromagnetic field arrays varies as: nmpi + 2ng Figure 3: Gain G <sup>d</sup> in terms of memory of the hybrid approach compared to the local approach (corresponding to nmpi = 1). The curves represents G <sup>d</sup> as a function of the number of MPI sub-domains per group nmpi for d=1 (purple curve), d=2 (blue curve) and d=3 (red curve). Dashed lines represent the asymptotic limit of G <sup>d</sup> when nmpi >> 1. FFT along z only (in Fortran) and thus group MPI sub-domains solely along z (i.e d = 1). For the P3DFFT library [16] (2D pencil decomposition), the distributed FFT can be parallelized along y and z and MPI subdomains can therefore be grouped along two directions (i.e. d = 2). The gain G <sup>d</sup> as a function of nmpi is plotted on Fig. 3 for different values of d = 1, 2, 3. One can notice that for a few nmpi - 10 per groups, the total gain can already approach its maximum asymptotic value (G = 27 for d = 3, G = 9 for d = 2 and G = 3 for d = 1). 2.3. Gains in terms of volumes of guard cells data exchanged Similarly, one can estimate the gain in terms of volume of guard cells data exchanged between the hybrid and local approaches in the limit n <sup>n</sup> p <sup>= ng:</sup> n <sup>3</sup> p Mtot <sup>hyb</sup> <sup>= O</sup>  p n <sup>3</sup> (3) �3 <sup></sup>  mpi × - nnp For n <sup>n</sup> n <sup>n</sup> p <sup>= ng, we now obtain:</sup> G <sup>d</sup> tot <sup>d</sup> guard <sup>=</sup> <sup>Mloc</sup> Mn (4) �3 Mtot <sup>hyb</sup> <sup>=</sup> Mtot <sup>hyb</sup> - 2 +nmpi nmpi <sup>M</sup> tot <sup>loc</sup> <sup>−</sup> <sup>Mn</sup> Mtot <sup>hyb</sup> <sup>−</sup> <sup>Mn</sup> tot <sup>hyb</sup> <sup>−</sup> <sup>Mn</sup> The memory gain of the hybrid solver compared to local solver for the maximum limit of n <sup>n</sup> p <sup>= ng is thus:</sup> 3 <sup>d</sup> - 1 = (7) 1 + 2/nmpi - �d − 1 For instance, the maximum gain on the total volume of guard cell exchanged for d = 2 (with P3DFFT) and nmpi = 5 can be as large as 8. 2.4. Advantages in terms of execution time of the FFT Another important time gain expected from our hybrid parallelization technique emerges from the execution time of the FFT. In the following, we first estimate the time complexity of the distributed FFT algorithm. In the light of this estimate, we then present the advantages of the hybrid solver compared to the local and global solvers. tot G <sup>3</sup> = <sup>Mloc</sup> = 3 <sup>3</sup> (5) �3 tot <sup>Mloc</sup> Mtot <sup>hyb</sup> - 2 +nmpi nmpi tot If we only make MPI groups along d axes (d ⩽ 3), this formula becomes: nmpi G <sup>d</sup> = 3 <sup>d</sup> - 2 + nmpi (6) �d The number of axis d along which MPI sub-domains can be grouped directly depends on the number of axis along which the distributed FFT can be parallelized. For the FFTW library [15] (1D slab decomposition) we can parallelize the distributed 4 2.4.1. Estimate of distributed FFTs computation time Assessing the complexity of distributed memory FFT is important to understand and take advantage of the scalability of the hybrid solver. Distributed-memory FFTs performance strongly depends on both communication network and computer architecture. For multi-dimensional FFTs, most distributed-memory FFT libraries follow the same computation scheme detailed below. For each axis A of a 3D array: 1. If processors have all data in their local memory along A, directly compute FFT along A. 2. If data along A is distributed on different processors, first transpose the 3D array so that each processor have all data along A and then compute FFT along A. Following this computation scheme, we define the total time to perform a 3D FFT as the sum of the time required to transpose data Ttr and the time to compute the FFTs Tc: TFFT = Tc + Ttr (8) The time complexity of a 3D FFT is known to be: Tc = αn <sup>3</sup> log n <sup>3</sup> (9) where n is the global array size along each axis and α a machine-dependent parameter. For a distributed-memory FFT with pencil decomposition, the data is distributed over nproc = n <sup>2</sup> p <sup>processors.</sup> <sup>In this</sup> <sup>case</sup> assuming perfect scaling, the computation time Tc per processor is: nodes are allocated contiguously, compute nodes on THETA can be allocated at remote locations on the network, depending on the cluster occupancy at a given time. This might explain the lower-than-expected bisection bandwidth on THETA. Based on the bisection bandwidth estimates, we therefore used the following expression of TFFT for both machines: n <sup>3</sup> + β (12) nproc <sup>4/5</sup> 25 ng = 64 ng = 32 ng = 16 ng = 8 15 5 <u>2</u> <sup>~~4~~</sup> <u>2</u> <sup>~~7~~</sup> <u>2</u> <sup>~~10~~</sup> <u>2</u> <sup>~~13~~</sup> <u>2</u> <sup>~~16~~</sup> # MPIs per group (MIRA) 40 30 20 10 TFFT = α <sup>n3 log n</sup> nproc ng =32 ng =16 ng =8 <u>2</u> <sup>~~2~~</sup> <u>2</u> <sup>~~6~~</sup> <u>2</u> <sup>~~10~~</sup> <u>2</u> <sup>~~14~~</sup> # of MPIs per group (Theta) Figure 4: FFT total execution time as a function of the total number of MPI processes per group and the number of guard cells. The left panel represents the data from Theta and the right pane represents the data from Mira. Dots represent measured FFT execution time while dashed lines represent the fitting curve following eq 12 Tc = α - n3n logproc n3 nproc (10) On the other hand, the transpose time Ttr is very network depend. Following the same reasoning as in [16] to estimate the communication time of the transpose operation, we get: - nprocn.σ <sup>3</sup> mem (11) From formula (12), one can understand why distributedmemory FFTs do not scale well at large scale on massively parallel computer architectures: for a large number of processors and a relatively small array size, the transpose operation will dominate the FFT computation α n <sup>log</sup> proc <sup>n</sup> <sup>≪</sup> procβ <sup>hence resulting in</sup> n <sup>log</sup> proc <sup>n</sup> <sup>≪</sup> n <sup>4</sup> procβ <sup>/5</sup> Ttr = β - σbi[nn <sup>3</sup> proc] + γ β <sup>4</sup> proc <sup>/5</sup> <sup>hence resulting in</sup> where σbi(nproc) is the bisection bandwidth of the network, β and γ two machine and network dependent parameters and σmem is the memory bandwidth per MPI task. For a large number of MPI tasks, we can neglect the term n <sup>3</sup> n <sup>3</sup> γ nproc.σmem <sup>compared</sup> <sup>to</sup> <sup>β</sup> σbi[nproc] <sup>in</sup> <sup>eq</sup> <sup>(11)</sup> <sup>as</sup> <sup>the</sup> <sup>inter-node</sup> data transposition is more costly than the intra-node datatransposition (which only requires memory copies). The bisection bandwidth is a function of the number of processors and depends on the nature of the supercomputer interconnection network. For a 5D torus network such as the one equipping the IBM BG-Q MIRA cluster at the ALCF, σbi[nproc] should scale as nproc <sup>4/5</sup> . For the case of the THETA cluster (equipped with a Dragon fly network), σbi[nproc] should scale as nproc. In practice, we estimated the bisection bandwidth by fitting the global transposition time as a power of nproc. For both MIRA and THETA, the best fit found for σbi[nproc] scales as nproc <sup>4/5</sup> . For THETA, this is lower than the expected theoretical value of nproc. As opposed to MIRA where compute a poor scaling proportional to 1/n <sup>4</sup> proc <sup>/5</sup> a poor scaling proportional to 1/n <sup>4</sup> proc <sup>/5</sup> <sup>.</sup> <sup>On</sup> <sup>the</sup> <sup>other</sup> <sup>hand,</sup> <sup>for</sup> large scale data set and relatively small number of processors, the computation term of the FFT will dominate the total time and α n <sup>log</sup> proc <sup>n</sup> <sup>≫</sup> procβ <sup>thus resulting in a good scaling proportional</sup> n <sup>log</sup> proc <sup>n</sup> <sup>≫</sup> n <sup>4</sup> procβ <sup>/5</sup> to 1/nproc. β <sup>4</sup> proc <sup>/5</sup> <sup>thus resulting in a good scaling proportional</sup> 2.4.2. Advantages of the hybrid solver over local and global solvers In the light of eq (12), one can note that our hybrid solver makes it possible to reduce the relative weight of the transpose operation time Ttr in the total FFT time TFFT by properly tuning the number of MPI processes per group nmpi on which the distributed FFT is performed. This should lead to a better performance than purely global solvers in most cases. In addition, the hybrid solver should also outperform the local solver at large scale. Indeed, one can show that the execution time for the FFT (neglecting guard cell exchanges) for the local solver scales as: 5 - nnp TFFT <sup>loc</sup> <sup>∝</sup> <sup>n</sup> - nnp + 2ng log n �2 + 2ng (13) �2 where we assumed a 2D domain decomposition. For a large number of processors np such as n/np → ng, the execution time TFFT <sup>loc</sup> <sup>becomes constant and</sup> <sup>the parallel</sup> <sup>efficiency of the</sup> <sup>local</sup> solver drops considerably. In contrast, for the Hybrid solver this execution time should write: n FFT <sup>hyb</sup> <sup>∝</sup> n <sup>2</sup> TFFT <sup>hyb</sup> nmpi + 2ng n log �2 n <sup>2</sup> mpi - nnp nmpi + 2ng (14) �2 mpi - nnp where we assumed a 2D pencil decomposition and a negligible transpose time compared to the FFT computation time. Choosing large enough MPI groups such that n/npnmpi ≫ ng therefore leads to: FFT <sup>hyb</sup> <sup>∝</sup> <sup>n2</sup> T <sup>hyb</sup> n <sup>2</sup> p Fig. 4. From these execution times, we could estimate the values of the parameters α and β in the theoretical expression of TFFT (cf. eq (12)) using a least square algorithm. On MIRA, we obtained α = 1. and β = 1.5414. On THETA, we obtained α = 1. and β = 67.1 We checked that using different box sizes and other simulation parameters led to similar results on both Theta and MIRA. One can see on Fig. 4 (cf. dashed lines) that the least square fit obtained leads to an acceptable matching between expected and measured timings. Fig. 4 shows the optimal number of MPI processes per group that minimizes the total execution time increases with the number of guard cells. For a low number of guard cells ng = 8, a few MPI processes per group (around 8) seems the best approach whereas for a higher number of guard cells ng = 16, 20 MPI processes per group are required. As a consequence, having a good guess about the values of α and β on a given network/computer architecture can help tune the hybrid solver to take advantage of the performance boost of our hybrid solver. The procedure to find the optimal number of groups for given domain decomposition/cluster architecture will be automated and added to the PICSAR library. Although the model of eq. (12) is quite simple and omits various operations involved in the FFT computation (data transfer among one compute node / data transposition among one MPI task ...), the error between the fit and the measured timing does not exceed 22%. This can also be explained by the the fluctuation coming from the 1D FFT computation since the n log n scaling is not perfect. Further tuning can be done on different machines to predict the optimal number of MPI processes per group. This optimum lies between 1 (global solver) and nproc (local solver), depending on the machine and the problem size. We have noted that MIRA can support rather large MPI groups while keeping a good scaling, whereas on THETA, our method gives better results with smaller groups. For critical cases where nnp <sup>=</sup> <sup>ng</sup> where ng is the number of guard cells, we have noticed that it is always better to use the hybrid solver since it gives a substantial gain in terms of performance and memory saving. 2.5. Coupling of the hybrid Maxwell solver with the PIC algorithm 2.5.1. Brief reminder of the PIC algorithm particle push time log <sup>n2</sup> n <sup>2</sup> p (15) which would ensure very good scaling of the hybrid solver at large scale. 2.4.3. Benchmarks of the hybrid solver vs local and global solvers To demonstrate the superiority of the hybrid solver over local and global solvers, many 3D simulations were run on both THETA and MIRA where the number of guard cells ng and MPI processes per groups nmpi were varied (cf. Fig. 4). In all these simulations, we used the P3DFFT library (pencil decomposition) to perform the distributed FFTs allowing to group nmpi,y and nmpi,z MPI processes along the y and z directions. Below are given details of the 3D cases run on MIRA and THETA: - On MIRA: the array size per direction was chosen to n = 2048 and the number of guard cells ng = 8, 16 and 64. 8192 BG/Q nodes were used with 8 MPI processes per node (total of 2 <sup>16</sup> MPI tasks). For each case, the total number of MPI processes per group nmpi,y ×nmpi,z was varied as follows: 2 <sup>4</sup>, 2 <sup>7</sup>, 2 <sup>10</sup>, 2 <sup>13</sup> and 2 <sup>16</sup>, with nmpi,y × nmpi,z = 2 <sup>16</sup> corresponding to the global solver and nmpi,y × nmpi,z = 1 to the local solver. - On THETA: the array size was chosen to 512 × 4096 × 4096 cells and the number of guard cells ng = 8, ng = 16, ng = 32. 512 KNL nodes were used with 64 MPI per node for a total of 32768 MPI tasks. Two MPI tasks were used along the x direction. The rest of the 16384 MPI tasks were split equally along y and z. The number of MPI processes per group along y and z direction was varied from nmpi,y × nmpi,z = 2 <sup>14</sup> (global solver), to nmpi,y × nmpi,z = 1 (local solver). For each simulation, we collected the averaged execution time of FFTs among all MPI ranks. We chose to use the averaged time between these ranks since the problem was very well load-balanced between MPI processes (standard deviation of execution time did not exceed 10% among all MPI ranks). These execution times are displayed using colored markers on field gathering PIC cycle Maxwell solver current/charge deposition Figure 5: Sketch of the PIC cycle. 6 ~~P1~~ <u>P2</u> ~~P3~~ ~~P4~~ <u>P5</u> ~~P6~~ P1 P2 P3 guard region P4 P5 P6 guard region The PIC algorithm self-consistently resolves Maxwell’s equations on a grid and motion equations of plasma pseudoparticles . The successive steps of the PIC cycle are sketched on Fig. 5. At each time step: - particles are advanced using equations of motion (particle push) knowing the values of the electromagnetic fields at their position, - once particles are advanced, current/charge contribution of each particle on the grid is deposited using linear or higher order interpolation, - once electromagnetic sources are known on the grid, Maxwell’s equations are solved to advance electromagnetic fields in time and space (Maxwell solver), - once electromagnetic fields are known at next time step, field values are gathered from the mesh to particle’s position using interpolation, usually at the same order as the deposition. 2.5.2. Dual grid decomposition for efficient load balancing All the difficulty in coupling the hybrid solver with the PIC algorithm lies in the efficient load balancing of (i) the particle and particle-mesh operations (particle push, field gathering, current/charge deposition) on the one hand and (ii) the Maxwell solver on the other hand. This has been illustrated on panels (a) and (b) of Fig. 6. Panel (a) shows the domain decomposition D1 used to efficiently load balance particle and particle/mesh operations (plasma is assumed to be homogeneous). Limits of MPI subdomains are highlighted using black solid lines. Guard cells required for particle-mesh operations (deposition/gathering) and of width equal to the order of deposition/gathering have not been represented for more clarity. Panel (b) shows the domain decomposition D2 that would be required to efficiently load balance the FFTs in the Maxwell solver step. One can see that in that case, the limits of MPI sub-domains in D1 do not coincide with the limits of MPI subdomains in D2 due to the presence of guard cells appended at the MPI group boundaries and needed in the computation of FFTs. Load balancing all steps of the PIC loop thus requires keeping two different grids: (i) one grid G1 for the particle and particle-mesh operations (ii) one grid G2 for the FFTs. Note that the additional grid G1 is also usually employed for smoothing [17] or mesh refinement [18] in the PIC algorithm. This comes with a slight additional memory cost (≈ 30%) that yet still allows for large total memory gain thanks to the decrease of guard cells data redundancy with the hybrid solver. We now detail how the coupling between the two grids is managed in the PIC cycle. At each time step: 1. Fields from G1 are copied to G2 (including copies of data to the guard cells of MPI groups in G2). Overlapping grid regions pertaining to same MPI domains on G1 and G2 are (a) (b) MPI group 1 MPI group 2 Figure 6: Dual domain decompositions used to load balance (a) particlemesh/particle operations of the PIC loop (b) FFT computations of the Maxwell solver step. simply copied from G1 to G2. Other regions of G2 are updated using MPI exchanges of grid data from G1 to G2, 2. Maxwell’s equations are solved using the hybrid solver on G2, 3. After the Maxwell solve step, field data (without guard cells) are copied from G2 to G1. Overlapping grid regions pertaining to same MPI domains on G2 and G1 are simply copied from G2 to G1. Other regions of G1 are updated using MPI exchanges of grid data from G2 to G1. Note that this implementation does not actually require direct exchanges of guard cell data between MPI groups as mentioned in the previous section. Guard cells of G2 are instead directly filled from G1 during the first step of the coupling. 2.6. Implementation in the PICSAR library The Particle-In-Cell Scalable Application Resource (PICSAR) [19, 5] is an open-source high performance library intended to help scientists porting their code to the next generation of exascale computers. PICSAR contains highly optimized PIC routines exploiting the three levels of parallelism that modern architectures offer (Internode parallelism, Intranode parallelism, Vectorization) as well as optimized parallel I/O routines. The hybrid Maxwell solver has been fully implemented in PICSAR and can currently be used by the WARP [20, 21] and 7 <u>ng = 16</u> ~~2~~ <sup><u>15</u></sup> ~~2~~ <sup><u>16</u></sup> ~~2~~ <sup><u>17</u></sup> ~~2~~ <sup><u>18</u></sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores <u>ng = 32</u> ~~2~~ <sup><u>15</u></sup> ~~2~~ <sup><u>16</u></sup> ~~2~~ <sup><u>17</u></sup> ~~2~~ <sup><u>18</u></sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores 2 <sup>1</sup> 2 <sup>0</sup> 2 <sup>10</sup> 2 <sup>9</sup> 2 <sup>8</sup> 2 <sup>7</sup> 2 <sup>6</sup> <u>ng = 8</u> ~~<u>2</u>~~ <sup><u>15</u></sup> ~~Hybrid 2~~ <sup><u>16</u></sup> ~~2~~ <sup><u>17</u></sup> ~~2~~ <sup><u>18</u></sup> Local 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores Figure 7: Local vs Hybrid + slab decomposition on THETA. Each panel represents a different number of guard cells.The blue curves stand for the hybrid solver data, while the red curves stand for the local solver data. The green line represents the total memory gain brought by the hybrid solver compared to the local solver. WARPX [18] codes. Note that the WARPX code also implements a slightly different version of the dual domain decomposition presented in this paper, which won’t be presented here. PICSAR is written in Fortran 90 and can be compiled in three different modes: - As a Python module that can be directly coupled with other codes also using python as the outermost software layer. Right now, PICSAR is coupled to the WARP PIC code through this layer, - As a static/dynamic library to be used by other Fortran/C/C++ codes. For instance, the WARPX and SMILEI [22] PIC codes are presently coupled to PICSAR by this means, - As a self-consistent Fortran 90 PIC code. All tests performed in this paper have been done through this mode. To perform the distributed FFTs, PICSAR can use either the FFTW or P3DFFT libraries: - FFTW is a well-established GPL FFT library that can perform shared-memory/distributed FFTs . The distributed FFT only supports parallelization along one axis (slab decomposition), which is the last axis or z-axis in Fortran. - P3DFFT is an open source library that can perform distributed FFTs using a pencil domain decomposition. By offering parallelization over two axis, P3DFFT therefore offers more flexibility than the distributed version of FFTW. To compute the FFTs locally, P3DFFT makes use of existing shared-memory versions of other FFT libraries (currently it only supports FFTW, ESSL). Note that on Intel architectures, such as THETA, the MKL library can be used instead of FFTW through the FFTW-MKL wrapper, which allows performing DFT computations with the MKL library without modifying FFTW directions. All performance tests performed on THETA whether using FFTW or P3DFFT have been done with MKL-FFTW support for sharedmemory FFTs, as this proved to bring better performance for both local and hybrid solver. On MIRA, P3DFFT (with FFTW support for shared-memory FFTs) and FFTW were used. To use the hybrid solver, the user needs to specify some additional simulation parameters related to the hybrid solver. These parameters are : - the FFT library used for distributed FFTs (FFTW or P3DFFT), - the number of groups along y and z direction (in the zdirection only when using FFTW), - the number of group guard cells along y and z direction (in the -direction only when using FFTW), - an additional flag to enable/disable the use of ”optimized communication strategy” to compute FFTs (Only available in 3D). The ”optimized communication strategy” skips the last data transposition after each FFT in order to save computational time. Indeed the last transposition is only required to have the same data layout for the output array and the input array. This saves computational time but results in a different layout of field arrays in the Fourier space that needs to be taken into account when solving Maxwell’s equations. This has been included in PICSAR that benefits from this optimization for both P3DFFT and FFTW modes in 3D simulations. 8 <u>ng = 16</u> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores <u>ng = 32</u> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores 2 <sup>3</sup> 2 <sup>2</sup> 2 <sup>1</sup> 2 <sup>10</sup> 2 <sup>9</sup> 2 <sup>8</sup> 2 <sup>7</sup> <u>ng = 8</u> <u>2</u> <sup><u>15</u></sup> Hybrid 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> <u>Local</u> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> # of cores Figure 8: Local vs Hybrid + pencil decomposition on THETA. Each panel represents a different number of guard cells. The blue curves stand for the hybrid solver data, while the red curves stand for the local solver data. The green line represents the total memory gain brought by the hybrid solver compared to the local solver. Besides, note that when using the hybrid solver, PICSAR calculates the MPI groups topology and creates ngroup MPI subcommunicators, each sub-communicator being appended to a unique group. The data sizes on each MPI task is set by the FFT library, which results in a new domain decomposition related to the Maxwell’s equations solve as illustrated on Fig. 6 (b). Finally, FFT plans are initialized by the FFT library on each group. The intersection between the two domain decompositions is computed before the PIC loop starts, and a data exchange protocol is determined according to the grid overlaps. If dynamic load-balancing is enabled for the simulation, then this pre-processing step needs to be recomputed accordingly. In practice, the data exchange step is rather computationally cheap and does not add an important overhead to the PIC loop since the majority of data exchanges are simple data copies within the same MPI process. In PICSAR, the data exchange protocol is done in a way that allows both blocking and non-blocking MPI exchanges. Finally, note that the PICSAR FFT-based Maxwell solver now also supports absorbing boundary conditions implemented using the two-step Perfectly Matched Layers algorithm recently developed in [23]. 3. Benchmark of the new solver at very large scale The new solver has been benchmarked on both THETA and MIRA at very large scale. All benchmarks considered the simulation of a 3D homogeneous plasma with 1 pseudo-particle per cell for both electrons and ions. These benchmarks are presented below. 3.1. Benchmark on THETA The hybrid solver on THETA has been benchmarked using both P3DFFT and FFTW MPI libraries. On THETA, the FFTW-MKL wrapper has been used with FFTW MPI and P3DFFT. 3.1.1. Benchmark with the slab decomposition The box size is nx × ny × nz = 160 × 160 × 393216 cells, where larger array sizes were used along z to investigate strong scaling for a large number of processors. Multiple simulations were run with different numbers of guard cells ng = 8, 16, 32. The number of KNL nodes used was Nnodes = 512, 1024, 2048, 3072, 4096 with 64 MPI tasks per node and one OpenMP thread per MPI task. For each simulation we used nmpi = 32 MPI processes per group. As shown on Fig. 7, the slab decomposition allows a memory and performance gain of order ×2.5 against the local solver, for a high number of guard cells. The strong scaling efficiency of the hybrid solver for 32 guard cells is 87% between 512 and 3072 KNL nodes, while the local solver efficiency is only about 47%. Besides, note that the hybrid solver allows to run simulations on more nodes than the local solver which is limited by nnp <sup>= ng (note that the last point of the 32 guard cells simulations</sup> with the local solver is missing. 3.1.2. Benchmark with the pencil decomposition In this benchmark the grid size was nx×ny×nz = 240×6144× 12288, where a larger size was chosen along y compared to the slab decomposition. We kept the same number of guard cells as for the slab benchmark (ng = 8, 16, 32). The number of MPI processes per group was fixed to 64. We used 64 MPI processes per node and one OpenMP thread/MPI task for all the tests. 9 <u>ng = 32</u> 2 <sup>13</sup> 2 <sup>14</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> 2 <sup>13</sup> 2 <sup>14</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> # of cores 2 <sup>3</sup> 2 <sup>2</sup> 2 <sup>1</sup> 2 <sup>9</sup> 2 <sup>8</sup> 2 <sup>7</sup> 2 <sup>6</sup> 2 <sup>5</sup> 2 <sup>4</sup> <u>ng = 8</u> ~~2~~ <sup><u>13</u></sup> ~~2~~ <sup>14</sup> Hybrid 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> <sup>14</sup> Hybrid 2 <sup>15</sup> ~~Local~~ 2 <sup>13</sup> 2 <sup>14</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> # of cores <u>ng = 16</u> 2 <sup>13</sup> 2 <sup>14</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> 2 <sup>13</sup> 2 <sup>14</sup> 2 <sup>15</sup> 2 <sup>16</sup> 2 <sup>17</sup> 2 <sup>18</sup> 2 <sup>19</sup> # of cores Figure 9: Local vs Hybrid + pencil decomposition on MIRA. Each panel represents a different number of guard cells. The blue curves stand for the hybrid solver data, while the red curves stand for the local solver data. The green line represents the total memory gain brought by the hybrid solver compared to the local solver. Results of this benchmark are displayed on Fig. 8. Here again, the hybrid solver performs much more efficiently than the local solver at large scale (especially for a large number of guard cells) both in terms of time-to-solution (up to ×4 speedup) and memory used (up to ×8 less memory). 3.2. Benchmark on MIRA On MIRA,the hybrid solver was benchmarked using the pencil decomposition only. The grid size was nx × ny × nz = 256 × 2048 × 2048 cells. All the simulations were ran with 4 OpenMP threads per MPI process. Each MPI group was composed of 256 MPI tasks. The number of nodes was varied between 512 to 16384. This benchmark (cf. Fig 9) shows again a very good strong scaling of the hybrid solver and a very good parallel efficiency at large scale. Moreover, we show that MPI exchanges involved in the PIC loop (apart from the global exchanges involved in the FFT transpose) are less costly when using the hybrid solver (due to a decrease of the total volume of MPI exchanges). 4. Conclusion We presented a novel massively parallel technique for ultrahigh order FFT-based Maxwell solvers. As opposed to the previously developed ’local’ technique, this ’hybrid’ technique (which performs distributed FFTs on groups of neighbouring MPI processes) is very general and allows a very good strong scaling for an arbitrarily high number of guard cells. For large numbers of guard cells, it notably increases the maximum number of MPI processes that can be used to parallelize computations. Besides, by reducing data redundancy, it also has huge benefits in terms of memory savings compared to the ’local’ technique for a given problem size. Both the improvements in strong scaling and memory savings will enable larger 3D PIC simulations than previously accessible with the ’local’ technique. Acknowledgements The authors would like to thank R´emi Lehe and Julien Derouillat for fruitfull discussions. This research was supported by the Exascale Computing Project (ECP), Project Number: 17-SC-20-SC, a collaborative effort of two DOE organizations the Office of Science and the National Nuclear Security Administration responsible for the planning and preparation of a capable exascale ecosystem including software, applications, hardware, advanced system engineering, and early testbed platforms to support the nations exascale computing imperative. This work was supported in part by the Director, Office of Science, Office of High Energy Physics, U.S. Dept. of Energy under Contract No. DE-AC02-05CH11231. An award of computer time (PICSSAR INCITE) was provided by the Innovative and Novel Computational Impact on Theory and Experiment (INCITE) program. This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357. References [1] R W Hockney and J W Eastwood. 1988. [2] C K Birdsall and A B Langdon. Adam-Hilger, 1991. [3] Ks Yee. Ieee Trans. Ant. and Prop., 14:302–307, 1966. 10 [4] Ricardo A Fonseca, Jorge Vieira, Frederico Fi´uza, Asher Davidson, Frank S Tsung, Warren B Mori, and Luıs O Silva. Exploiting multi-scale parallelism for large scale numerical modelling of laser wakefield accelerators. Plasma Physics and Controlled Fusion, 55(12):124011, 2013. [5] Henri Vincenti, Mathieu Lobet, Remi Lehe, Jean-Luc Vay, and Jack Deslippe. 17 pic codes on the road to exascale architectures. Exascale Scientific Applications: Scalability and Performance Portability, page 375, 2017. [6] G Blaclard, H Vincenti, R Lehe, and JL Vay. Pseudospectral maxwell solvers for an accurate modeling of doppler harmonic generation on plasma mirrors with particle-in-cell codes. Physical Review E, 96(3):033305, 2017. [7] Henri Vincenti and Jean-Luc Vay. Ultrahigh-order maxwell solver with extreme scalability for electromagnetic pic simulations of plasmas. Computer Physics Communications, 228:22–29, 2018. [8] I Haber, et al.,. Proc. Sixth Conf. Num. Sim. Plasmas, pages 46–48, 1973. [9] S¨oren Jalas, Irene Dornmair, R´emi Lehe, Henri Vincenti, J-L Vay, Manuel Kirchen, and Andreas R Maier. Accurate modeling of plasma acceleration with arbitrary order pseudo-spectral particle-in-cell methods. Physics of Plasmas, 24(3):033115, 2017. [10] S. Habib, et al.,. arXiv.org, page 1211.4864. [11] J.-L. Vay, I. Haber, and B. B. Godfrey. J. Comput. Phys., 243:260–268, 2013. [12] H. Vincenti and J.-L. Vay. Comput. Phys. Comm., 200:147–167, 2016. [13] H Vincenti. Achieving extreme light intensities using relativistic plasma mirrors. arXiv preprint arXiv:1812.05357, 2018. [14] L Chopineau, A Leblanc, G Blaclard, A Denoeud, M Th´evenet, JL Vay, G Bonnaud, Ph Martin, H Vincenti, and F Qu´er´e. Identification of coupling mechanisms between ultraintense laser light and dense plasmas. arXiv preprint arXiv:1809.03903, 2018. [15] [http://www.fftw.org/.](http://www.fftw.org/) [16] Dmitry Pekurovsky. P3dfft: A framework for parallel computations of fourier transforms in three dimensions. SIAM Journal on Scientific Computing, 34(4):C192–C209, 2012. [17] Brendan B. Godfrey and Jean-Luc Vay. Suppressing the numerical cherenkov instability in fdtd pic codes. Journal of Computational Physics, 267:1 – 6, 2014. [18] J-L Vay, A Almgren, J Bell, L Ge, DP Grote, M Hogan, O Kononenko, R Lehe, A Myers, C Ng, et al. Warp-x: A new exascale computing platform for beam–plasma simulations. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 2018. [19] H. Vincenti, M. Lobet, R. Lehe, R. Sasanka, and J.-L. Vay. Comput. Phys. Comm., 210:145–154, 2017. [20] J.-L. Vay, D P Grote, R H Cohen, and A Friedman. Computational Sci ence and Discovery, 5(1):014019 (20 pp.), 2012. [21] [http://blast.lbl.gov/blast-codes-warp.](http://blast.lbl.gov/blast-codes-warp) [22] Julien Derouillat, Arnaud Beck, F P´erez, T Vinci, M Chiaramello, A Grassi, M Fl´e, G Bouchard, I Plotnikov, N Aunai, et al. Smilei: a collaborative, open-source, multi-purpose particle-in-cell code for plasma simulation. Computer Physics Communications, 222:351–373, 2018. [23] Olga Shapoval, Jean-Luc Vay, and Henri Vincenti. Two-step perfectly matched layer for arbitrary-order pseudo-spectral analytical time-domain methods. Computer Physics Communications, 235:102–110, 2019. 11

섹션 본문 80문단 · 33,469자

(제목 없음)

1Dispersion-free ultra-high order FFT-based Maxwell solvers have recently proven to be paramount to a large range of applications, including the high-fidelity modeling of high-intensity laser-matter interactions with Particle-In-Cell (PIC) codes. To enable a massively parallel scaling of these solvers, a novel parallelization technique was recently proposed, which consists in splitting the simulation domain into several processor sub-domains, with guard regions appended at each sub-domain boundaries. Maxwell's equations are advanced independently on each sub-domain using local shared-memory FFTs (instead of a single distributed global FFT). This implies small truncation errors at sub-domain boundaries, the amplitude of which depends on guard regions sizes and order of the Maxwell solver. For moderate guard region sizes, this 'local' technique proved to be highly scalable on up to a million cores and notably enabled the 3D modelling of so-called plasma mirrors, for which 8 guard cells only were enough to prevent truncation error growth. Yet, for other applications, the required number of guard cells might be much higher, which would severely limit the parallel efficiency of this technique due to the large volume of guard cells to be exchanged between sub-domains. In this context, we propose a novel parallelization technique that ensures very good scaling of FFT-based solvers with an arbitrarily high number of guard cells. Our 'hybrid' technique consists in performing distributed FFTs on local groups of processors with guard regions now appended to boundaries of each group of processors. It uses a dual domain decomposition method for the Maxwell solver and other parts of the PIC cycle to keep the simulation load-balanced. This 'hybrid' technique was implemented in the open source exascale library PICSAR. Benchmarks show that for a large number of guard cells (> 16), the 'hybrid' technique offers a ×3 speed-up and ×8 memory savings compared to the 'local' one.

Context

2The ElectroMagnetic (EM) Particle-In-Cell (PIC) method [1,2] has been the method of choice to model kinetic effects at play in the physics of high intensity laser plasma interactions also known as 'Ultra-High Intensity' (UHI) physics. To describe the plasma and electromagnetic field dynamics, the EM-PIC algorithm self-consistently advances Maxwell's equations on a grid (Maxwell solver) and equations of motion of plasma pseudo-particles. As there is no diagnostic of the plasma and fields evolution at the extremely small time and length scales involved in UHI physics, the EM-PIC method has been crucial to interpret experiments, develop theoretical models as well as propose and guide novel experiments.

3In the last decades, the Maxwell solver used in most EM-PIC codes has been the so-called Finite Difference Time Domain (FDTD) Yee solver [3] that operates a second order finite difference in time and space to discretize Maxwell's equations. This method has been very popular since the advent of distributedmemory parallel computers because it can be efficiently parallelized using a standard Cartesian domain decomposition. This parallelization method splits the simulation domain into subdomains, with guard cells appended at the edges of each subdomain that stores electromagnetic fields values from immediate neighboring sub-domains. At each time step, Maxwell's equations are then advanced on each processor sub-domain independently and guard cells exchanged between sub-domains.

4FDTD solvers are very local and demonstrated scaling on up to a million cores [4,5] as required by the most demanding 3D EM-PIC simulations. Nevertheless, they induce spurious numerical dispersion of electromagnetic waves that reveals highly detrimental in the accurate modeling of laser-plasma-based applications. Mitigation of numerical dispersion errors usually requires very high spatio-temporal resolution that has prevented doing realistic 3D modeling on a large class of problems (including laser-plasma mirror interactions [6,7]) for a long time.

5In contrast, ultra-high order p (stencil of width p/2), and in the infinite order p → ∞ limit, FFT-based pseudo-spectral solvers, which advance electromagnetic fields in Fourier space (rather than configuration space), can bring much more accuracy than FDTD solvers for a given resolution. In particular, Haber et al showed [8] that under weak assumptions, Fourier transforming Maxwell's equations in space yields an analytical solution for electromagnetic fields in time, called the Pseudo-Spectral Analytical Time Domain (PSATD) solver, which is accurate to machine precision for the electromagnetic modes resolved by the mesh. As a consequence this solver enables infinite order, imposes no Courant time step limit in vacuum and has no numerical dispersion. By lowering the resolution needed to reach a required accuracy compared to FDTD solvers [6,7,9], PSATD-type solvers have the potential to strongly reduce the time-to-solution of a large class of problems.

Scalability limits of global FFT-solvers

6Nevertheless, pseudo-spectral solvers employing distributed FFTs (later called 'global' FTT solvers in the remainder of this article) have not been popular so far due to the difficulty to scale the distributed FFTs beyond 10, 000 cores [10], which is not enough to take advantage of the largest supercomputers (with up to millions of cores) required for 3D modeling.

7The main barrier to scale FFT computations emerges from the overhead induced by the global communications ('All' to 'All'-type communication) required to transpose the data among all computing units. As a consequence, developing massively parallel distributed FFTs algorithms is extremely challenging and is still an active research area for computer scientists.

Recent advances in the scaling of FFT-based Maxwell solvers

8To break this scalability barrier, a pioneering grid decomposition technique was recently proposed for pseudo-spectral FFT-based electromagnetic solvers [11]. This technique consists in using a standard Cartesian domain decomposition strategy to parallelize pseudo-spectral solvers (cf. Fig. 1-(a)). Maxwell's equations are solved independently on each MPI processor sub-domain using local FFTs (instead of a single global distributed FFT). Guard cells are exchanged between adjacent sub-domains at each time step. This technique is much more local and can be efficiently scaled providing that the number of guard cells is not too high. It comes however with small stencil truncation errors at sub-domain boundaries when the stencil width p/2 is higher than the number of guard cells n g . An important theoretical study [12] recently derived the analytical expression for the amplitude and phase of these truncation errors. It showed that choosing a very high but finite order p stencil can already strongly reduce truncation errors compared to infinite order while still ensuring extreme accuracy. The model also pointed out that very high order solvers p > 100 can be used with a moderate number of guard cells (n g ≪ p/2) while still guaranteeing low levels of truncation errors (potentially below machine precision). By providing the number of guard cells required to obtain a given level of truncation error as a function of solver order, time step and mesh size, this model is crucial to enable the parallelization technique in production simulations.

9This new type of FFT-based solvers (later called 'local' FFTbased solvers) has been implemented and optimized in the high performance library PICSAR [5,7]. They led to very good scaling on up to a million cores even for a moderate (n g < 10) number of guard cells and high solver orders p = 100. They notably enabled the very first accurate 3D simulations of laserplasma mirror interactions [7,13,14] that were used to interpret the latest experimental results at CEA Saclay obtained with the 100TW UHI100 laser.

Need for a more general massively parallel FFT-based

10Maxwell solver Yet, local FFT-based solvers may not be adapted to the modeling of certain classes of problems where the level of truncation errors need to be lower than machine precision for instance. In that case, the number of guard cells required n g might be higher and can strongly affect the strong or weak scaling of the local solver. This is illustrated on Fig. 2 where we compared the strong scaling of the local solver for different numbers of guard cells. As we can see on panels (a) and (b), although cases with a moderate number of guard cells succeed in keeping a good strong scaling, cases with a high number of guard cells quickly loose efficiency as the number of processors is increased. We can also note on panel (c) that due to an increased data redundancy, the total volume of memory required grows considerably as the number of guard cells/processors is increased.

11Both limitations in terms of memory consumption and strong scaling of the local solver call for new parallelization strategies allowing for the use of an arbitrarily high number of guard cells. In this article, we present a novel massively parallel pseudospectral solver that ensures excellent strong/weak scaling at large scale (up to 800k cores) while allowing for the use of high number of guard cells to significantly reduce truncation errors. The remainder of the paper is divided into three additional sections:

121. In section 2, we present the principle of the new parallelization method and its implementation in the high performance PIC library PICSAR, 2. In section 3, we present the benchmarks of the novel method on two large clusters (MIRA and THETA) available at the Argonne Leadership Computing Facility (ALCF), 3. In section 4, we conclude by presenting the perspectives brought by this novel method for the field of laser-plasma interaction.

Generalized massively parallel FFT-based Maxwell solver

13In this section, we propose a new parallelization technique for the FFT-based Maxwell solver. This new type of FFT-based solver (later called 'hybrid' FFT-based solver) is a more general approach than the local solver as it permits the use of an arbitrary high number of guard cells while still ensuring extremely good scalability.

Principle of the new solver

14The principle of the hybrid solver is illustrated on Fig. 1-(b). Adjacent MPI sub-domains are grouped into MPI groups (two groups on Fig. 1-(b)). Guard cells are now solely appended to the MPI group boundaries (and not to each MPI sub-domain boundaries). At each time step: (i) Maxwell's equations are advanced independently on a MPI group using a distributed FFT and (ii) guard cells are exchanged between adjacent MPI groups.

15As we now detail, this solver allows for significant memory savings as well as a reduction of the total volume of data exchanged.

Advantages in terms of memory

16Let us assume a cubic mesh of size n x × n y × n z = n 3 splitted into n p MPI sub-domains along each direction x, y and z. If n g guard cells are used for each MPI sub-domain, the total memory occupied by electromagnetic field arrays varies as:

17As expected, one can notice that this memory strongly increases with the number of guard cells n g . In addition, the maximum number of processors that can be used along each axis for this problem is given by n n p = n g , for which the total memory used culminates to:

18where M n would be the total memory occupied by field arrays without any extra memory coming from guard cells. This maximum limit M loc tot does not depend on the number of guard cells n g . However, this maximum limit is attained for a much lower number of processors when n g ≫ 1, potentially limiting the maximum number of processors that can be used due to memory limitations.

19Let us now assume that MPI domains are grouped and that we use n mpi MPI processes per group along each axis. In this case, the total memory occupied by electromagnetic field arrays varies as:

20For n n p = n g , we now obtain:

21The memory gain of the hybrid solver compared to local solver for the maximum limit of n n p = n g is thus:

22If we only make MPI groups along d axes (d 3), this formula becomes:

23The number of axis d along which MPI sub-domains can be grouped directly depends on the number of axis along which the distributed FFT can be parallelized. For the FFTW library FFT along z only (in Fortran) and thus group MPI sub-domains solely along z (i.e d = 1). For the P3DFFT library [16] (2D pencil decomposition), the distributed FFT can be parallelized along y and z and MPI subdomains can therefore be grouped along two directions (i.e. d = 2). The gain G d as a function of n mpi is plotted on Fig. 3 for different values of d = 1, 2, 3. One can notice that for a few n mpi > 10 per groups, the total gain can already approach its maximum asymptotic value (G = 27 for d = 3, G = 9 for d = 2 and G = 3 for d = 1).

Gains in terms of volumes of guard cells data exchanged

24Similarly, one can estimate the gain in terms of volume of guard cells data exchanged between the hybrid and local approaches in the limit n n p = n g :

25For instance, the maximum gain on the total volume of guard cell exchanged for d = 2 (with P3DFFT) and n mpi = 5 can be as large as 8.

Advantages in terms of execution time of the FFT

26Another important time gain expected from our hybrid parallelization technique emerges from the execution time of the FFT. In the following, we first estimate the time complexity of the distributed FFT algorithm. In the light of this estimate, we then present the advantages of the hybrid solver compared to the local and global solvers.

Estimate of distributed FFTs computation time

27Assessing the complexity of distributed memory FFT is important to understand and take advantage of the scalability of the hybrid solver. Distributed-memory FFTs performance strongly depends on both communication network and computer architecture. For multi-dimensional FFTs, most distributed-memory FFT libraries follow the same computation scheme detailed below. For each axis A of a 3D array:

281. If processors have all data in their local memory along A, directly compute FFT along A. 2. If data along A is distributed on different processors, first transpose the 3D array so that each processor have all data along A and then compute FFT along A.

29Following this computation scheme, we define the total time to perform a 3D FFT as the sum of the time required to transpose data T tr and the time to compute the FFTs T c :

30The time complexity of a 3D FFT is known to be:

31where n is the global array size along each axis and α a machine-dependent parameter. For a distributed-memory FFT with pencil decomposition, the data is distributed over n proc = n 2 p processors. In this case assuming perfect scaling, the computation time T c per processor is:

32On the other hand, the transpose time T tr is very network depend. Following the same reasoning as in [16] to estimate the communication time of the transpose operation, we get:

33where σ bi (n proc ) is the bisection bandwidth of the network, β and γ two machine and network dependent parameters and σ mem is the memory bandwidth per MPI task.

34For a large number of MPI tasks, we can neglect the term γ n 3 n proc .σ mem compared to β n 3 σ bi [n proc ] in eq (11) as the inter-node data transposition is more costly than the intra-node datatransposition (which only requires memory copies).

35The bisection bandwidth is a function of the number of processors and depends on the nature of the supercomputer interconnection network. For a 5D torus network such as the one equipping the IBM BG-Q MIRA cluster at the ALCF, σ bi [n proc ] should scale as n proc 4/5 . For the case of the THETA cluster (equipped with a Dragon fly network), σ bi [n proc ] should scale as n proc . In practice, we estimated the bisection bandwidth by fitting the global transposition time as a power of n proc . For both MIRA and THETA, the best fit found for σ bi [n proc ] scales as n proc 4/5 . For THETA, this is lower than the expected theoretical value of n proc . As opposed to MIRA where compute nodes are allocated contiguously, compute nodes on THETA can be allocated at remote locations on the network, depending on the cluster occupancy at a given time. This might explain the lower-than-expected bisection bandwidth on THETA. Based on the bisection bandwidth estimates, we therefore used the following expression of T FFT for both machines:

36T FFT = α n 3 log n n proc + β n 3 n proc 4/5 From formula (12), one can understand why distributedmemory FFTs do not scale well at large scale on massively parallel computer architectures: for a large number of processors and a relatively small array size, the transpose operation will dominate the FFT computation α log n n proc ≪ β n 4/5 proc hence resulting in a poor scaling proportional to 1/n 4/5 proc . On the other hand, for large scale data set and relatively small number of processors, the computation term of the FFT will dominate the total time and α log n n proc ≫ β n 4/5 proc thus resulting in a good scaling proportional to 1/n proc .

Advantages of the hybrid solver over local and global solvers

37In the light of eq (12), one can note that our hybrid solver makes it possible to reduce the relative weight of the transpose operation time T tr in the total FFT time T FFT by properly tuning the number of MPI processes per group n mpi on which the distributed FFT is performed. This should lead to a better performance than purely global solvers in most cases.

38In addition, the hybrid solver should also outperform the local solver at large scale. Indeed, one can show that the execution time for the FFT (neglecting guard cell exchanges) for the local solver scales as: where we assumed a 2D domain decomposition. For a large number of processors n p such as n/n p → n g , the execution time T loc FFT becomes constant and the parallel efficiency of the local solver drops considerably. In contrast, for the Hybrid solver this execution time should write:

39where we assumed a 2D pencil decomposition and a negligible transpose time compared to the FFT computation time. Choosing large enough MPI groups such that n/n p n mpi ≫ n g therefore leads to:

40which would ensure very good scaling of the hybrid solver at large scale.

Benchmarks of the hybrid solver vs local and global solvers

41To demonstrate the superiority of the hybrid solver over local and global solvers, many 3D simulations were run on both THETA and MIRA where the number of guard cells n g and MPI processes per groups n mpi were varied (cf. Fig. 4). In all these simulations, we used the P3DFFT library (pencil decomposition) to perform the distributed FFTs allowing to group n mpi,y and n mpi,z MPI processes along the y and z directions. Below are given details of the 3D cases run on MIRA and THETA:

42• On MIRA: the array size per direction was chosen to n = 2048 and the number of guard cells n g = 8, 16 and 64. 8192 BG/Q nodes were used with 8 MPI processes per node (total of 2 16 MPI tasks). For each case, the total number of MPI processes per group n mpi,y ×n mpi,z was varied as follows: 2 4 , 2 7 , 2 10 , 2 13 and 2 16 , with n mpi,y × n mpi,z = 2 16 corresponding to the global solver and n mpi,y × n mpi,z = 1 to the local solver.

43• On THETA: the array size was chosen to 512 × 4096 × 4096 cells and the number of guard cells n g = 8, n g = 16, n g = 32. 512 KNL nodes were used with 64 MPI per node for a total of 32768 MPI tasks. Two MPI tasks were used along the x direction. The rest of the 16384 MPI tasks were split equally along y and z. The number of MPI processes per group along y and z direction was varied from n mpi,y × n mpi,z = 2 14 (global solver), to n mpi,y × n mpi,z = 1 (local solver).

44For each simulation, we collected the averaged execution time of FFTs among all MPI ranks. We chose to use the averaged time between these ranks since the problem was very well load-balanced between MPI processes (standard deviation of execution time did not exceed 10% among all MPI ranks). These execution times are displayed using colored markers on Fig. 4. From these execution times, we could estimate the values of the parameters α and β in the theoretical expression of T FFT (cf. eq (12)) using a least square algorithm. On MIRA, we obtained α = 1. and β = 1.5414. On THETA, we obtained α = 1. and β = 67. 1 We checked that using different box sizes and other simulation parameters led to similar results on both Theta and MIRA. One can see on Fig. 4 (cf. dashed lines) that the least square fit obtained leads to an acceptable matching between expected and measured timings. Fig. 4 shows the optimal number of MPI processes per group that minimizes the total execution time increases with the number of guard cells. For a low number of guard cells n g = 8, a few MPI processes per group (around 8) seems the best approach whereas for a higher number of guard cells n g = 16, 20 MPI processes per group are required. As a consequence, having a good guess about the values of α and β on a given network/computer architecture can help tune the hybrid solver to take advantage of the performance boost of our hybrid solver. The procedure to find the optimal number of groups for given domain decomposition/cluster architecture will be automated and added to the PICSAR library.

45Although the model of eq. (12) is quite simple and omits various operations involved in the FFT computation (data transfer among one compute node / data transposition among one MPI task ...), the error between the fit and the measured timing does not exceed 22%. This can also be explained by the the fluctuation coming from the 1D FFT computation since the n log n scaling is not perfect.

46Further tuning can be done on different machines to predict the optimal number of MPI processes per group. This optimum lies between 1 (global solver) and n proc (local solver), depending on the machine and the problem size. We have noted that MIRA can support rather large MPI groups while keeping a good scaling, whereas on THETA, our method gives better results with smaller groups. For critical cases where n n p = n g where n g is the number of guard cells, we have noticed that it is always better to use the hybrid solver since it gives a substantial gain in terms of performance and memory saving. • particles are advanced using equations of motion (particle push) knowing the values of the electromagnetic fields at their position,

47• once particles are advanced, current/charge contribution of each particle on the grid is deposited using linear or higher order interpolation,

48• once electromagnetic sources are known on the grid, Maxwell's equations are solved to advance electromagnetic fields in time and space (Maxwell solver),

49• once electromagnetic fields are known at next time step, field values are gathered from the mesh to particle's position using interpolation, usually at the same order as the deposition.

Dual grid decomposition for efficient load balancing

50All the difficulty in coupling the hybrid solver with the PIC algorithm lies in the efficient load balancing of (i) the particle and particle-mesh operations (particle push, field gathering, current/charge deposition) on the one hand and (ii) the Maxwell solver on the other hand. This has been illustrated on panels (a) and (b) of Fig. 6.

51Panel (a) shows the domain decomposition D 1 used to efficiently load balance particle and particle/mesh operations (plasma is assumed to be homogeneous). Limits of MPI subdomains are highlighted using black solid lines. Guard cells required for particle-mesh operations (deposition/gathering) and of width equal to the order of deposition/gathering have not been represented for more clarity.

52Panel (b) shows the domain decomposition D 2 that would be required to efficiently load balance the FFTs in the Maxwell solver step. One can see that in that case, the limits of MPI sub-domains in D 1 do not coincide with the limits of MPI subdomains in D 2 due to the presence of guard cells appended at the MPI group boundaries and needed in the computation of FFTs.

53Load balancing all steps of the PIC loop thus requires keeping two different grids: (i) one grid G 1 for the particle and particle-mesh operations (ii) one grid G 2 for the FFTs. Note that the additional grid G 1 is also usually employed for smoothing [17] or mesh refinement [18] in the PIC algorithm. This comes with a slight additional memory cost (≈ 30%) that yet still allows for large total memory gain thanks to the decrease of guard cells data redundancy with the hybrid solver.

54We now detail how the coupling between the two grids is managed in the PIC cycle. At each time step:

551. Fields from G 1 are copied to G 2 (including copies of data to the guard cells of MPI groups in G 2 ). Overlapping grid regions pertaining to same MPI domains on G 1 and G 2 are simply copied from G 1 to G 2 . Other regions of G 2 are updated using MPI exchanges of grid data from G 1 to G 2 , 2. Maxwell's equations are solved using the hybrid solver on G 2 , 3. After the Maxwell solve step, field data (without guard cells) are copied from G 2 to G 1 . Overlapping grid regions pertaining to same MPI domains on G 2 and G 1 are simply copied from G 2 to G 1 . Other regions of G 1 are updated using MPI exchanges of grid data from G 2 to G 1 .

56Note that this implementation does not actually require direct exchanges of guard cell data between MPI groups as mentioned in the previous section. Guard cells of G 2 are instead directly filled from G 1 during the first step of the coupling.

Implementation in the PICSAR library

57The Particle-In-Cell Scalable Application Resource (PIC-SAR) [19,5] is an open-source high performance library intended to help scientists porting their code to the next generation of exascale computers. PICSAR contains highly optimized PIC routines exploiting the three levels of parallelism that modern architectures offer (Internode parallelism, Intranode parallelism, Vectorization) as well as optimized parallel I/O routines.

58The hybrid Maxwell solver has been fully implemented in PICSAR and can currently be used by the WARP [20, WARPX [18] codes. Note that the WARPX code also implements a slightly different version of the dual domain decomposition presented in this paper, which won't be presented here. PICSAR is written in Fortran 90 and can be compiled in three different modes:

59• As a Python module that can be directly coupled with other codes also using python as the outermost software layer. Right now, PICSAR is coupled to the WARP PIC code through this layer,

60• As a static/dynamic library to be used by other Fortran/C/C++ codes. For instance, the WARPX and SMILEI [22] PIC codes are presently coupled to PICSAR by this means,

61• As a self-consistent Fortran 90 PIC code. All tests performed in this paper have been done through this mode.

62To perform the distributed FFTs, PICSAR can use either the FFTW or P3DFFT libraries:

63• FFTW is a well-established GPL FFT library that can perform shared-memory/distributed FFTs . The distributed FFT only supports parallelization along one axis (slab decomposition), which is the last axis or z-axis in Fortran.

64• P3DFFT is an open source library that can perform distributed FFTs using a pencil domain decomposition. By offering parallelization over two axis, P3DFFT therefore offers more flexibility than the distributed version of FFTW. To compute the FFTs locally, P3DFFT makes use of existing shared-memory versions of other FFT libraries (currently it only supports FFTW, ESSL).

65Note that on Intel architectures, such as THETA, the MKL library can be used instead of FFTW through the FFTW-MKL wrapper, which allows performing DFT computations with the MKL library without modifying FFTW directions. All performance tests performed on THETA whether using FFTW or P3DFFT have been done with MKL-FFTW support for sharedmemory FFTs, as this proved to bring better performance for both local and hybrid solver. On MIRA, P3DFFT (with FFTW support for shared-memory FFTs) and FFTW were used. To use the hybrid solver, the user needs to specify some additional simulation parameters related to the hybrid solver. These parameters are :

66• the FFT library used for distributed FFTs (FFTW or P3DFFT),

67• the number of groups along y and z direction (in the zdirection only when using FFTW),

68• the number of group guard cells along y and z direction (in the -direction only when using FFTW),

69• an additional flag to enable/disable the use of "optimized communication strategy" to compute FFTs (Only available in 3D). The "optimized communication strategy" skips the last data transposition after each FFT in order to save computational time. Indeed the last transposition is only required to have the same data layout for the output array and the input array. This saves computational time but results in a different layout of field arrays in the Fourier space that needs to be taken into account when solving Maxwell's equations. This has been included in PICSAR that benefits from this optimization for both P3DFFT and FFTW modes in 3D simulations. Besides, note that when using the hybrid solver, PICSAR calculates the MPI groups topology and creates n group MPI subcommunicators, each sub-communicator being appended to a unique group. The data sizes on each MPI task is set by the FFT library, which results in a new domain decomposition related to the Maxwell's equations solve as illustrated on Fig. 6 (b). Finally, FFT plans are initialized by the FFT library on each group.

70The intersection between the two domain decompositions is computed before the PIC loop starts, and a data exchange protocol is determined according to the grid overlaps. If dynamic load-balancing is enabled for the simulation, then this pre-processing step needs to be recomputed accordingly. In practice, the data exchange step is rather computationally cheap and does not add an important overhead to the PIC loop since the majority of data exchanges are simple data copies within the same MPI process. In PICSAR, the data exchange protocol is done in a way that allows both blocking and non-blocking MPI exchanges.

71Finally, note that the PICSAR FFT-based Maxwell solver now also supports absorbing boundary conditions implemented using the two-step Perfectly Matched Layers algorithm recently developed in [23].

Benchmark of the new solver at very large scale

72The new solver has been benchmarked on both THETA and MIRA at very large scale. All benchmarks considered the simulation of a 3D homogeneous plasma with 1 pseudo-particle per cell for both electrons and ions. These benchmarks are presented below.

Benchmark on THETA

73The hybrid solver on THETA has been benchmarked using both P3DFFT and FFTW MPI libraries. On THETA, the FFTW-MKL wrapper has been used with FFTW MPI and P3DFFT.

Benchmark with the slab decomposition

74The box size is n x × n y × n z = 160 × 160 × 393216 cells, where larger array sizes were used along z to investigate strong scaling for a large number of processors. Multiple simulations were run with different numbers of guard cells n g = 8, 16, 32. The number of KNL nodes used was N nodes = 512, 1024, 2048, 3072, 4096 with 64 MPI tasks per node and one OpenMP thread per MPI task. For each simulation we used n mpi = 32 MPI processes per group.

75As shown on Fig. 7, the slab decomposition allows a memory and performance gain of order ×2.5 against the local solver, for a high number of guard cells. The strong scaling efficiency of the hybrid solver for 32 guard cells is 87% between 512 and 3072 KNL nodes, while the local solver efficiency is only about 47%. Besides, note that the hybrid solver allows to run simulations on more nodes than the local solver which is limited by n n p = n g (note that the last point of the 32 guard cells simulations with the local solver is missing.

Benchmark with the pencil decomposition

76In this benchmark the grid size was n x ×n y ×n z = 240×6144× 12288, where a larger size was chosen along y compared to the slab decomposition. We kept the same number of guard cells as for the slab benchmark (n g = 8, 16, 32). The number of MPI processes per group was fixed to 64. We used 64 MPI processes per node and one OpenMP thread/MPI task for all the tests. Figure 9: Local vs Hybrid + pencil decomposition on MIRA. Each panel represents a different number of guard cells. The blue curves stand for the hybrid solver data, while the red curves stand for the local solver data. The green line represents the total memory gain brought by the hybrid solver compared to the local solver.

77Results of this benchmark are displayed on Fig. 8. Here again, the hybrid solver performs much more efficiently than the local solver at large scale (especially for a large number of guard cells) both in terms of time-to-solution (up to ×4 speedup) and memory used (up to ×8 less memory).

Benchmark on MIRA

78On MIRA,the hybrid solver was benchmarked using the pencil decomposition only. The grid size was n x × n y × n z = 256 × 2048 × 2048 cells. All the simulations were ran with 4 OpenMP threads per MPI process. Each MPI group was composed of 256 MPI tasks. The number of nodes was varied between 512 to 16384.

79This benchmark (cf. Fig 9) shows again a very good strong scaling of the hybrid solver and a very good parallel efficiency at large scale. Moreover, we show that MPI exchanges involved in the PIC loop (apart from the global exchanges involved in the FFT transpose) are less costly when using the hybrid solver (due to a decrease of the total volume of MPI exchanges).

Conclusion

80We presented a novel massively parallel technique for ultrahigh order FFT-based Maxwell solvers. As opposed to the previously developed 'local' technique, this 'hybrid' technique (which performs distributed FFTs on groups of neighbouring MPI processes) is very general and allows a very good strong scaling for an arbitrarily high number of guard cells. For large numbers of guard cells, it notably increases the maximum number of MPI processes that can be used to parallelize computations. Besides, by reducing data redundancy, it also has huge benefits in terms of memory savings compared to the 'local' technique for a given problem size. Both the improvements in strong scaling and memory savings will enable larger 3D PIC simulations than previously accessible with the 'local' technique.

참고문헌 19건

  1. Detailed analysis of the effects of stencil spatial variations with arbitrary high-order finite-difference Maxwell solver Computer Physics Communications · Elsevier BV · 2015 10.1016/j.cpc.2015.11.009
  2. P3DFFT: A Framework for Parallel Computations of Fourier Transforms in Three Dimensions SIAM Journal on Scientific Computing · Society for Industrial and Applied Mathematics · 2012 10.1137/11082748x
  3. A domain decomposition method for pseudo-spectral electromagnetic simulations of plasmas Journal of Computational Physics · Elsevier BV · 2013 10.1016/j.jcp.2013.03.010
  4. Suppressing the numerical Cherenkov instability in FDTD PIC codes Journal of Computational Physics · Elsevier BV · 2014 10.1016/j.jcp.2014.02.022
  5. Exploiting multi-scale parallelism for large scale numerical modelling of laser wakefield accelerators Plasma Physics and Controlled Fusion · IOP Publishing · 2013 10.1088/0741-3335/55/12/124011
  6. Numerical solution of initial boundary value problems involving maxwell's equations in isotropic media IEEE Transactions on Antennas and Propagation · IEEE Antennas & Propagation Society · 1966 10.1109/tap.1966.1138693
  7. Novel methods in the Particle-In-Cell accelerator Code-Framework Warp Computational Science & Discovery · IOP Publishing · 2012 10.1088/1749-4699/5/1/014019
  8. An efficient and portable SIMD algorithm for charge/current deposition in Particle-In-Cell codes Computer Physics Communications · Elsevier BV · 2016 10.1016/j.cpc.2016.08.023
  9. Pseudospectral Maxwell solvers for an accurate modeling of Doppler harmonic generation on plasma mirrors with particle-in-cell codes Physical review. E · American Physical Society · 2017 10.1103/physreve.96.033305
  10. Warp-X: A new exascale computing platform for beam–plasma simulations Nuclear Instruments and Methods in Physics Research Section A Accelerators Spectrometers Detectors and Associated Equipment · Elsevier BV · 2018 10.1016/j.nima.2018.01.035
  11. Accurate modeling of plasma acceleration with arbitrary order pseudo-spectral particle-in-cell methods Physics of Plasmas · American Institute of Physics · 2017 10.1063/1.4978569
  12. Ultrahigh-order Maxwell solver with extreme scalability for electromagnetic PIC simulations of plasmas Computer Physics Communications · Elsevier BV · 2018 10.1016/j.cpc.2018.03.018
  13. Smilei : A collaborative, open-source, multi-purpose particle-in-cell code for plasma simulation Computer Physics Communications · Elsevier BV · 2017 10.1016/j.cpc.2017.09.024
  14. Two-step perfectly matched layer for arbitrary-order pseudo-spectral analytical time-domain methods Computer Physics Communications · Elsevier BV · 2018 10.1016/j.cpc.2018.09.015
  15. Achieving Extreme Light Intensities using Optically Curved Relativistic Plasma Mirrors Physical Review Letters · American Physical Society · 2019 10.1103/physrevlett.123.105001
  16. PIC Codes on the Road to Exascale Architectures Chapman and Hall/CRC eBooks · Informa · 2017 10.1201/b21930-17
  17. Identification of Coupling Mechanisms between Ultraintense Laser Light and Dense Plasmas Physical Review X · American Physical Society · 2019 10.1103/physrevx.9.011050
  18. P3DFFT: A Framework for Parallel Computations of Fourier Transforms in Three Dimensions SIAM Journal on Scientific Computing · Society for Industrial and Applied Mathematics · 2012 10.1137/11082748x
  19. Achieving extreme light intensities using relativistic plasma mirrors HAL (Le Centre pour la Communication Scientifique Directe) · Le Centre pour la Communication Scientifique Directe · 2019