Mind the Gap! Bridging the Dichotomy of Design and Implementation Donna Kaminskyj Long University of Victoria dkj@cs.uvic.ca Liam Kiemele University of Victoria liamk@cs.uvic.ca Celina Gibbs University of Victoria celina@cs.uvic.ca Andrew Brownsword brownsword@ea.com Yvonne Coady University of Victoria ycoady@cs.uvic.ca ABSTRACT This paper presents a revamping of a sparse linear algebra design pattern, targeting parallelization within scientific and engineering applications. A proof of concept implementation is developed to compare actual software practices and opti- mizations with those described in the original design pat- tern. The case study reveals that the design pattern did not tightly coincide with the design decisions in the implemen- tation. The proposed revised pattern takes these decisions into account more explicitly, refining the structural represen- tation of the pattern to make it more accessible to scientific developers attempting to achieve the benefits of paralleliza- tion now available in commodity systems. Categories and Subject Descriptors D.2.3 [Software Engineering]: Coding Tools and Tech- niques General Terms Design, Performance Keywords Design Patterns, Sparse Linear Algebra, Multicore Comput- ing 1. INTRODUCTION Core principles of software engineering have provided a foundation for the development of accepted practices and methodologies for creating quality software that is both un- derstandable and maintainable. While these practices are part of the core education of today’s software engineers they are not mainstream to scientists in the biological, engineer- ing and physical sciences. These scientists are faced with Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SECSE’11 28-MAY-2011, Waikiki, Honolulu, USA Copyright 2011 ACM 978-1-4503-0598-3/11/05 ...$10.00. both large scale computation problems and copious amounts of data. While the scale continues to grow, the underlying hardware resources are no longer growing in terms of proces- sor speeds but instead are growing in terms of the number of processing units. The complexity surrounding programming for multiple processing units has become one of the key chal- lenges of computer science, amplifying the need for support and structure imposed by software engineering practices and methodologies. In general, big science projects have unique requirements to be addressed by computer science, for example: vast amounts of data to be processed and computationally in- tensive algorithms with strict time constraints. These re- quirements usually include a desire to make use of commod- ity hardware for economical purposes. Large scale calcu- lations such as linear algebra computation is common in areas of research such as adaptive optics technology used to correct wavefront errors on astronomical data collected from telescopes, distortion in communication systems and retinal imaging [17]. Algorithms associated with this prob- lem domain lend themselves to parallel implementations but the size of the problem combined with real-time constraints make it challenging for developers to experiment with and consider a software solution. This paper investigates ways in which to make software engineering practices useful and accessible to the scientific programmer looking to optimize an application. Specifi- cally, we begin by looking at the use of design patterns as a template to guide developers through design and implemen- tation decisions. With the recent development of parallel specific patterns, we use an existing version of the Sparse Linear Algebra (SLA) pattern to investigate the ability to map the abstraction provided in the current form of design patterns through to implementation. Through an in depth analysis of the pattern and SLA implementation we evalu- ate the applicability of the pattern, how its design choices can be explicitly represented and propose ways in which to refine the pattern to enhance its accessability by scientific programmers. This paper begins with an overview of related work in the implementation of SLA computations and work with design patterns (Section 2). This is followed by an overview of the SLA Pattern and subsequent case study (Section 3). We analyze the shortcomings of the pattern with regards to the needs of developers (Section 4), and use these to refine the structural representation of the pattern, without making