Search NASA⌕ Search

SEARCH · Search NASA

Results for “Complex Stencil”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

Snowflake: A Lightweight Portable Stencil DSL

Stencil computations are not well optimized by general-purpose production compilers and the increased use of multicore, manycore, and accelerator-based systems makes the optimization problem even more challenging. In this paper we present Snowflake, a Domain Specific Language (DSL) for stencils that uses a 'micro-compiler' approach, i.e., small, focused, domain-specific code generators. The approach is similar to that used in image processing stencils, but Snowflake handles the much more complex stencils that arise in scientific computing, including complex boundary conditions, higher-order operators (larger stencils), higher dimensions, variable coefficients, non-unit-stride iteration spaces, and multiple input or output meshes. Snowflake is embedded in the Python language, allowing it to interoperate with popular scientific tools like SciPy and iPython; it also takes advantage of built-in Python libraries for powerful dependence analysis as part of a just-in-time compiler. We demonstrate the power of the Snowflake language and the micro-compiler approach with a complex scientific benchmark, HPGMG, that exercises the generality of stencil support in Snowflake. By generating OpenMP comparable to, and OpenCL within a factor of 2x of hand-optimized HPGMG, Snowflake demonstrates that a micro-compiler can support diverse processor architectures and is performance-competitive whilst preserving a high-level Python implementation.

97 MATHEMATICS AND COMPUTING↗

An Integrated Approach to Scaling Task-Based Runtime Systems for Next Generation Engineering problems

The need to scale next-generation industrial engineering problems to the largest computational platforms presents unique challenges. Such problems may have complex coupled multi-physics models, as well as computationally and communication intensive algorithms not often seen in standard academic problems, while also needing high-demand I/O for analysis purposes. In such cases even codes with good existing scaling properties may need significant changes, addressed in a cross-cutting way to solve such problems at extreme scales. These challenges relate to system components that were not previously problematic on less complex problems and/or at smaller computational scales. This paper illustrates these challenges for Uintah, a highly scalable asynchronous many-task runtime system being applied to the modeling of a 1000 MWe ultra-supercritical coal boiler. In order to model this formidable, production engineering problem, not only was an integrated approach needed that built upon existing scalable components in areas such as complex stencil calculations and linear algebra, but the significant challenges of high demand I/O, complex task graphs, and infrastructure inefficiencies also had to be addressed. This integrated approach allowed this problem to run on 256K CPU cores on Mira, with good weak scaling to 512K CPU cores and similar strong scaling, except for radiation. The need for strong scaling of a new ray tracing-based radiation model required substantial Uintah infrastructure improvements before 119K CPU cores and 7.5K GPUs on Titan could be used, with scaling out to 256K CPU cores and 16K GPUs. The resulting code demonstrates not only excellent overall scalability but a significant improvement in overall performance for the full-scale, production boiler problem.

97 MATHEMATICS AND COMPUTING↗

Distributed Halide

Many image processing tasks are naturally expressed as a pipeline of small computational kernels known as stencils. Halide is a popular domain-specific language and compiler designed to implement image processing algorithms. Halide uses simple language constructs to express what to compute and a separate scheduling co-language for expressing when and where to perform the computation. This approach has demonstrated performance comparable to or better than hand-optimized code. Until now, however, Halide has been restricted to parallel shared memory execution, limiting its performance for memory-bandwidth-bound pipelines or large-scale image processing tasks. We present an extension to Halide to support distributed-memory parallel execution of complex stencil pipelines. These extensions compose with the existing scheduling constructs in Halide, allowing expression of complex computation and communication strategies. Existing Halide applications can be distributed with minimal changes, allowing programmers to explore the tradeoff between recomputation and communication with little effort. Approximately 10 new of lines code are needed even for a 200 line, 99 stage application. On nine image processing benchmarks, our extensions give up to a 1.4× speedup on a single node over regular multithreaded execution with the same number of cores, by mitigating the effects of non-uniform memory access. The distributed benchmarks achieve up to 18× speedup on a 16 node testing machine and up to 57× speedup on 64 nodes of the NERSC Cori supercomputer.

97 MATHEMATICS AND COMPUTING↗

Helium: lifting high-performance stencil kernels from stripped x86 binaries to halide DSL code

Highly optimized programs are prone to bit rot, where performance quickly becomes suboptimal in the face of new hardware and compiler techniques. In this paper we show how to automatically lift performance-critical stencil kernels from a stripped x86 binary and generate the corresponding code in the high-level domain-specific language Halide. Using Halide's state-of-the-art optimizations targeting current hardware, we show that new optimized versions of these kernels can replace the originals to rejuvenate the application for newer hardware. The original optimized code for kernels in stripped binaries is nearly impossible to analyze statically. Instead, we rely on dynamic traces to regenerate the kernels. We perform buffer structure reconstruction to identify input, intermediate and output buffer shapes. Here, we abstract from a forest of concrete dependency trees which contain absolute memory addresses to symbolic trees suitable for high-level code generation. This is done by canonicalizing trees, clustering them based on structure, inferring higher-dimensional buffer accesses and finally by solving a set of linear equations based on buffer accesses to lift them up to simple, high-level expressions. Helium can handle highly optimized, complex stencil kernels with input-dependent conditionals. We lift seven kernels from Adobe Photoshop giving a 75 % performance improvement, four kernels from Irfan View, leading to 4.97 x performance, and one stencil from the mini GMG multigrid benchmark netting a 4.25 x improvement in performance. We manually rejuvenated Photoshop by replacing eleven of Photoshop's filters with our lifted implementations, giving 1.12 x speedup without affecting the user experience.

97 MATHEMATICS AND COMPUTING↗

Evaluating Multi-core Architectures through Accelerating the Three-Dimensional Lax–Wendroff Correction

Wave propagation forward modeling is a widely used computational method in oil and gas exploration. The iterative stencil loops in such problems have broad applications in scientific computing. However, executing such loops can be highly time time-consuming, which greatly limits application’s performance and power efficiency. In this paper, we accelerate the forward modeling technique on the latest multi-core and many-core architectures such as Intel Sandy Bridge CPUs, NVIDIA Fermi C2070 GPU, NVIDIA Kepler K20x GPU, and the Intel Xeon Phi Co-processor. For the GPU platforms, we propose two parallel strategies to explore the performance optimization opportunities for our stencil kernels. For Sandy Bridge CPUs and MIC, we also employ various optimization techniques in order to achieve the best.

3D Wave Forward Modeling↗

Stencil computations for PDE-based applications with examples from DUNE and hypre

Here, stencils are commonly used to implement efficient on–the–fly computations of linear operators arising from partial differential equations. At the same time the term “stencil” is not fully defined and can be interpreted differently depending on the application domain and the background of the software developers. Common features in stencil codes are the preservation of the structure given by the discretization of the partial differential equation and the benefit of minimal data storage. We discuss stencil concepts of different complexity, show how they are used in modern software packages like hypre and DUNE, and discuss recent efforts to extend the software to enable stencil computations of more complex problems and methods such as inf–sup–stable Stokes discretizations and mixed finite element discretizations.

97 MATHEMATICS AND COMPUTING↗

Non-Galerkin Coarse Grids for Algebraic Multigrid

Algebraic multigrid (AMG) is a popular and effective solver for systems of linear equations that arise from discretized partial differential equations. And while AMG has been effectively implemented on large scale parallel machines, challenges remain, especially when moving to exascale. Particularly, stencil sizes (the number of nonzeros in a row) tend to increase further down in the coarse grid hierarchy, and this growth leads to more communication. Therefore, as problem size increases and the number of levels in the hierarchy grows, the overall efficiency of the parallel AMG method decreases, sometimes dramatically. This growth in stencil size is due to the standard Galerkin coarse grid operator, $P^T A P$, where $P$ is the prolongation (i.e., interpolation) operator. For example, the coarse grid stencil size for a simple three-dimensional (3D) seven-point finite differencing approximation to diffusion can increase into the thousands on present day machines, causing an associated increase in communication costs. We therefore consider algebraically truncating coarse grid stencils to obtain a non-Galerkin coarse grid. First, the sparsity pattern of the non-Galerkin coarse grid is determined by employing a heuristic minimal “safe” pattern together with strength-of-connection ideas. Second, the nonzero entries are determined by collapsing the stencils in the Galerkin operator using traditional AMG techniques. The result is a reduction in coarse grid stencil size, overall operator complexity, and parallel AMG solve phase times.

97 MATHEMATICS AND COMPUTING↗

Patchy nanoparticles by atomic stencilling

Stencilling, in which patterns are created by painting over masks, has ubiquitous applications in art, architecture and manufacturing. Modern, top-down microfabrication methods have succeeded in reducing mask sizes to under 10 nm, enabling ever smaller microdevices as today’s fastest computer chips. Meanwhile, bottom-up masking using chemical bonds or physical interactions has remained largely unexplored, despite its advantages of low cost, solution-processability, scalability and high compatibility with complex, curved and three-dimensional (3D) surfaces. Here we report atomic stencilling to make patchy nanoparticles (NPs), using surface-adsorbed iodide submonolayers to create the mask and ligand-mediated grafted polymers onto unmasked regions as ‘paint’. We use this approach to synthesize more than 20 different types of NP coated with polymer patches in high yield. Polymer scaling theory and molecular dynamics (MD) simulation show that stencilling, along with the interplay of enthalpic and entropic effects of polymers, generates patchy particle morphologies not reported previously. These polymer-patched NPs self-assemble into extended crystals owing to highly uniform patches, including different non-closely packed superlattices. We propose that atomic stencilling opens new avenues in patterning NPs and other substrates at the nanometre length scale, leading to precise control of their chemistry, reactivity and interactions for a wide range of applications, such as targeted delivery, catalysis, microelectronics, integrated metamaterials and tissue engineering.

36 MATERIALS SCIENCE↗

Space‐Time Causal Discovery in Earth System Science: A Local Stencil Learning Approach

Causal discovery tools enable scientists to infer meaningful relationships from observational data, spurring advances in fields as diverse as biology, economics, and climate science. Despite these successes, the application of causal discovery to space-time systems remains immensely challenging due to the high-dimensional nature of the data. For example, in climate sciences, modern observational temperature records over the past few decades regularly measure thousands of locations around the globe. To address these challenges, we introduce Causal Space-Time Stencil Learning (CaStLe), a novel meta-algorithm for discovering causal structures in complex space-time systems. CaStLe leverages regularities in local space-time dependencies to learn governing global dynamics. This local perspective eliminates spurious confounding and drastically reduces sample complexity, making space-time causal discovery practical and effective. For causal discovery, CaStLe flexibly accepts any appropriately adapted time series causal discovery algorithm to recover local causal structures. These advances enable causal discovery of geophysical phenomena that were previously unapproachable, including non-periodic, transient phenomena such as volcanic eruption plumes. Regularities in local space-time dependencies are transformed into informative spatial replicates, which actually improve CaStLe's performance when applied to ever-larger spatial grids. We successfully apply CaStLe to discover the atmospheric dynamics governing the climate response to the 1991 Mount Pinatubo volcanic eruption. We provide validation experiments to demonstrate the effectiveness of CaStLe over existing causal-discovery frameworks on a range of geophysics-inspired benchmarks while identifying the method's limitations and domains where its assumptions may not hold.

Nichol, J. Jake [Univ. of New Mexico, Albuquerque,↗

A fourth-order Cartesian grid embeddedboundary method for Poisson’s equation

In this paper, we present a fourth-order algorithm to solve Poisson's equation in two and three dimensions. We use a Cartesian grid, embedded boundary method to resolve complex boundaries. We use a weighted least squares algorithm to solve for our stencils. We use convergence tests to demonstrate accuracy and we show the eigenvalues of the operator to demonstrate stability. We compare accuracy and performance with an established second-order algorithm. We also discuss in depth strategies for retaining higher-order accuracy in the presence of nonsmooth geometries.

97 MATHEMATICS AND COMPUTING↗

Truly horizontal finite difference scheme in the WRF model FY18 Q1 Update

A main goal of the Wind Forecasting Improvement Project 2 (WFIP2) is to improve performance of the Weather Research and Forecasting (WRF) model over complex terrain. Two methods for improving model performance were outlined in the LLNL WFIP 2 annual operating plan. The first is modification to WRF’s horizontal finite difference scheme to utilize an improved numerical stencil. A second proposed model improvement is use of the immersed boundary method within the WRF model to facilitate improved simulations over complex terrain. In Q1, work focused on implementing an alternative finite difference scheme, with a deliverable of a project update. The alternative finite difference method was implemented for the temperature variable and shown to improve our selected test case, and recommendations are made to continue the work in Q2. In Q2 the focus should be on extending the method to additional model variables, mainly pressure, as well as to real test cases, such as the WFIP 2 cold pool test case. Additionally, use of the immersed boundary method will be pursed in Q2 and Q3, with a second project update due at the end of Q3.

17 WIND ENERGY↗

A high order Cartesian grid, finite volume method for elliptic interface problems

We present a higher-order finite volume method for solving elliptic PDEs with jump conditions on interfaces embedded in a 2D Cartesian grid. Second, fourth, and sixth order accuracy is demonstrated on a variety of tests including problems with high-contrast and spatially varying coefficients, large discontinuities in the source term, and complex interface geometries. We include a generalized truncation error analysis based on cell-centered Taylor series expansions, which then define stencils in terms of local discrete solution data and geometric information. In the process, we develop a simple method based on Green's theorem for computing exact geometric moments directly from an implicit function definition of the embedded interface. This approach produces stencils with a simple bilinear representation, where spatially-varying coefficients and jump conditions can be easily included and finite volume conservation can be enforced.

97 MATHEMATICS AND COMPUTING↗

Optimization of High-order Wave Equations for Multicore CPUs

This is a simple benchmark to gauge the performance of a high-order isotropic wave equation grid. The code is optimized for both SSE and AVX and is parallelized using OpenMP (see Optimization section). Structurally, the benchmark begins, reads a few command-line parameters, allocates and pads the four arrays (current, last, next wave fields, and the spatially varying but isotropic velocity), initializes these arrays, then runs the benchmark proper. The code then benchmarks the naïve, SSE (if supported), and AVX (if supported implementations) by applying the wave equation stencil 100 times and taking the average performance. Boundary conditions are ignored and would nominally be implemented by the user. Thus, the benchmark measures only the performance of the wave equation stencil and not a full simulation. The naïve implementation is a quadruply (z,y,x, radius) nested loop that can handle arbitrarily order wave equations. The optimized (SSE/AVX) implentations are somewhat more complex as they operate on slabs and include a case statement to select an optimized inner loop depending on wave equation order.

Williams, Samuel↗

A second-order distributed memory parallel fast sweeping method for the Eikonal equation

The Eikonal equation is used to calculate wave propagation and distance fields, and due to its complexity requires numerical treatment for its solution. In this work, we present a second-order distributed memory parallel fast sweeping method. The second-order solution switches on a two-point stencil when two upwind points are available, and reverts to first-order otherwise. In all examples, the second-order method improves the solution over the first-order, allowing for significant savings in memory while achieving the same accuracy. Parallelization over distributed memory saw good weak scaling with optimal convergence. The computational time for second-order was approximately 2.5 times slower than first-order, where the largest amount of mesh points ran on 144 cores (512 GB) was ≈20 billion. The savings in memory from the second-order method combined with the distributed memory algorithm result in the ability to solve problems much larger than are possible with the serial first-order method.

71 CLASSICAL AND QUANTUM MECHANICS, GENERAL PHYSIC↗

9A.5 An Immersed Boundary Method for Flow Over Complex Terrain

Most mesoscale numerical models use terrain-following coordinates to accommodate complex terrain. Terrain-following or sigma coordinates conform to the bottom topography and the coordinate lines gradually become smoother and flatter with distance from the ground. With very steep terrain, the coordinate lines retain a signature of the underlying surface shape even very far away from the ground. Coordinate transformations are introduced into the discretized equations and produce numerical truncation errors in addition to those associated with the chosen discretization scheme. Several methods have been proposed to reduce the truncation error arising from terrain-following coordinates. Schar et al. [2002] proposed a modified sigma coordinate in which grid distortion due to small scale terrain features decays with height more rapidly than distortion caused by large scale features. The modified coordinate flattens quickly with height and improves the accuracy of the solution. Klemp et al. [2003] investigated the errors that arise when numerical treatment of the metric terms is inconsistent with the discretization of other terms in the governing equations. Distortion seen in topographically induced gravity waves was reduced with consistent numerical treatment. Adcroft et al. [1997] used a shaved cell approach to represent topography on a Cartesian grid. This method eliminates grid distortion, but introduces complications in the numerical solution at the ground because the computational cells must be modified (shaved) where they intersect the topography. Here we introduce an alternative griding technique for flow over complex terrain using an immersed boundary method (IBM) in the Weather Research and Forecasting (WRF) model. With this method, the terrain surface intersects the grid, and variables are adjusted near the immersed boundary so that the flow is diverted by the boundary. Grid distortion and the associated truncation errors are thus avoided. Additionally, the method does not require modification of the computational stencil in the vicinity of the topography. Boundary conditions are imposed on the immersed surface for velocities and scalar quantities through interpolation. The implementation and validation of IBM in WRF in two dimensions has been described previously by Lundquist et al. [2007, 2008]. Here we focus on the behavior of the flow far above steep topography. A description of the WRF model, its native sigma coordinate, and the alternative immersed boundary method are provided in section 2. The scalar transport test case of Schar et al. [2002] is presented in section 3. Comparisons are made between simulations using standard terrain-following coordinates and those using IBM. Large truncation errors are present in the native coordinate, and it is demonstrated that the immersed boundary method can be used within WRF to alleviate these errors. Truncation errors can be attributed to either the finite differencing scheme or the metric terms. Further analysis in section 4 apportions the error attributable to each cause.

42 ENGINEERING↗

Dynamic earthquake rupture simulations on nonplanar faults embedded in 3D geometrically complex, heterogeneous elastic solids

Dynamic propagation of shear ruptures on a frictional interface in an elastic solid is a useful idealization of natural earthquakes. The conditions relating discontinuities in particle velocities across fault zones and tractions acting on the fault are often expressed as nonlinear friction laws. The corresponding initial boundary value problems are both numerically and computationally challenging. In addition, seismic waves generated by earthquake ruptures must be propagated for many wavelengths away from the fault. Therefore, reliable and efficient numerical simulations require both provably stable and high order accurate numerical methods. We present a high order accurate finite difference method for: a) enforcing nonlinear friction laws, in a consistent and provably stable manner, suitable for efficient explicit time integration; b) dynamic propagation of earthquake ruptures along nonplanar faults; and c) accurate propagation of seismic waves in heterogeneous media with free surface topography. We solve the first order form of the 3D elastic wave equation on a boundary-conforming curvilinear mesh, in terms of particle velocities and stresses that are collocated in space and time, using summation-by-parts (SBP) finite difference operators in space. Boundary and interface conditions are imposed weakly using penalties. By deriving semi-discrete energy estimates analogous to the continuous energy estimates we prove numerical stability. The finite difference stencils used in this paper are sixth order accurate in the interior and third order accurate close to the boundaries. However, the method is applicable to any spatial operator with a diagonal norm satisfying the SBP property. Time stepping is performed with a 4th order accurate explicit low storage Runge–Kutta scheme, thus yielding a globally fourth order accurate method in both space and time. We show numerical simulations on band limited self-similar fractal faults revealing the complexity of rupture dynamics on rough faults.

58 GEOSCIENCES↗

Enabling fast-charging of lithium-ion batteries through printed electrodes

It has been well recognized that introducing secondary porous networks (SPNs) into the electrodes can effectively improve the electrochemical performance of lithium-ion batteries (LIBs), especially under fast-charging operations. However, the process complexity and high cost limit the commercial success of advanced electrodes with SPNs. To address this issue, we developed a facile screen-printing process to produce structured graphite electrodes with SPNs. The experimental results demonstrated that, by tuning the diameter and center-to-center (C2C) distance of emulsion dots on the stencil screen, the pore diameters and C2C pore distances of SPNs in screenprinted electrodes can be precisely controlled in the range of 100 mu m to 1 mm and 100 mu m to 3 mm respectively. In addition, the SPNs with hexagonal and square-shape pore alignments have also been imprinted onto the electrode coatings through adjusting the patterns of screen stencils. Used as anodes, the printed graphite electrodes demonstrated significantly reduced overpotential and voltage fluctuation under fast-charging operations from 2C to 6C. Coupled with LiNi 0.6 Mn 0.2 Co 0.2 O 2 (NMC622) cathodes, the full cells with printed graphite anodes exhibited an unprecedently stable performance with almost no capacity decay up to 170 cycles when charged to 80 % SOC at 2C. Observations from electron microscopy showed plated lithium undetectable at the surface of printed graphite electrodes after numerous cycles. The electrochemical analysis on the voltage evolution during the cell rest period indicated the significantly delayed onset of lithium plating in the presence of printed graphite electrodes. In conclusion, all these results suggest that the significantly improved cell performance is associated with the shortened Li-ion diffusion distance, reduced polarization and suppressed Li plating in the printed electrodes with patterned SPNs.

25 ENERGY STORAGE↗