Unified Model Performance on the NEC SX-6 Paul Selwood Crown copyright 2004 Page 1
Introduction
The Met Office National Weather Service Global and Local Area Climate Prediction (Hadley Centre) Operational and Research activities Relocated to Exeter from Bracknell 2003/4 150 th Anniversary in 2004 Crown copyright 2004 Page 3
Supercomputers 1991-1996 : Cray Y-MP/C90 1996-2004 : Cray T3E 2003 : NEC SX-6 Operational May 2004 Currently 2 x 15 node SX-6 systems May 2005 - additional 15 node SX-8 Crown copyright 2004 Page 4
Unified Model Single code used for NWP forecast and climate prediction N216L38 Global (40km in 2005) 20km European (12 km in 2005) 12km UK model (4km in 2005) Submodels (atmosphere, ocean ) Grid-point model (regular lat-long) non-hydrostatic, semi-implicit, Semi-Lagrangian dynamics Arakawa C-grid, Charney-Philips vertical staggering Crown copyright 2004 Page 5
I/O
I/O Route to disk depends on packet size < 64KB nfs (slow) > 64KB GFS (fast) Frequency 14000 12000 10000 8000 6000 System buffering only available for Fortran I/O Unified Model uses C. 4000 2000 0 0 1 2 4 8 16 32 64 128 256 512 1024 More KBytes Crown copyright 2004 Page 7
IO rates and improvements Solution User buffering of output data. STASH version Time (s) Rate (MB/s) Removal of unnecessary opens and closes. Original 212 40 Subsequent buffering of headers increase I/O rate to > 140 MB/s. Buffered 114 80 Considering use of locally attached disk in future (> 1GB/s seen). Removed Open/Close 69 110 Crown copyright 2004 Page 8
Semi-Lagrangian Advection
Load Balancing Advection Semi-Lagrangian advection demonstrating load balance problems Routine Theta departure points Wind departure points Max (s) 29.67 57.55 Min (s) 18.46 35.84 N216L38, 2 day forecast Crown copyright 2004 Page 10
Interpolation of Departure points Need to calculate departure points for variables held at, u and v points. Currently call the departure point routine 3 times, once for each variable type. The departure point routine is expensive and poorly load balanced as extra calculations are done for latitudes >80. Can improve runtime and load balance by calculating the departure point for a point and then interpolating to the u and v points. Approximation only works for higher resolutions. Crown copyright 2004 Page 11
Interpolation of Departure Points Much simpler algorithm is generally cheaper Perfect load balance for wind calculations Load balance remains a (hard) problem for theta point calculations Routine Max (s) Min (s) Wind departure points (original) Wind departure points (new) 57.55 14.25 35.84 14.23 Crown copyright 2004 Page 12
Convection
Load Balancing - Convection Convection load balance is an old problem which we had a solution for on the T3E. Needed reworking as coded directly in SHMEM Segment based dynamic load balancing Having enough segments to give good balance would harm vector performance Data in segments could be sparse data moved that wasn t used Moved too much data approach wouldn t be appropriate with SX-6 compute/communicate ratio. Crown copyright 2004 Page 14
Convection Deep and Shallow Crown copyright 2004 Page 15
New Load Balancing Convection Load balance separately for deep/shallow Calculations per point assumed to be equal Tuneable threshold for data sizes to move Compress data to active points Communications use one-sided MPI Crown copyright 2004 Page 16
Shallow and Deep Convection Load Balance Time (s) 5 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 0 1 2 3 4 5 6 CPU Original Balanced Time (s) 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 0 1 2 3 4 5 6 CPU Original Balanced 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 Crown copyright 2004 Page 17
Short Wave Radiation
Short Wave Radiation incoming flux (January) Crown copyright 2004 Page 19
Load Balancing Short Wave Radiation 45 Similar approach to convection Time (s) 40 35 30 25 20 15 10 5 0 0 1 2 3 4 5 6 Short Wave flux calculations take 90% of time so only this is balanced Computation is relatively more expensive than for convection CPUs Crown copyright 2004 Page 20
Communications
Communications One sided MPI communications have advantages on the SX-6 No need to explicitly schedule communications (MPI_Get from the under-loaded CPU) Speed! - Example is processor pairs exchanging 1000 words Method MPI_Get (global memory) Buffered Send/Recv Individual Send/Recv Buffered MPI_Get (global memory) Time on 2 Nodes (16 CPU) 32.3 msec 6.2 msec 21.7 msec 5.8 msec Crown copyright 2004 Page 22
Communications ideas and opportunities Many unnecessary barriers in code T3E relics! Easily removed for immediate benefit. Gathering/Scattering 3D fields level-by-level Optimised by copying into temporary buffers and doing one communication per CPU pair Halves cost of these communications >6000 halo exchanges in 6 hour forecast Can we amalgamate any? Can we remove any? Crown copyright 2004 Page 23
Questions?