A Hybrid Parallelization of Air Quality Model with MPI and OpenMP Gian Franco Marras 1 , Camillo Silibello 2 , and Giuseppe Calori 2 1 CINECA - SuperComputing Applications and Innovation Department - SCAI, Via Magnanelli 6/3, 40033 Casalecchio di Reno, Bologna (Bo) g.marras@cineca.it 2 Arianet S.r.l., Via Gilino 9, 20128 Milano (Mi) {c.silibello,g.calori}@aria-net.it Abstract. This paper presents the parallelization of FARM, a 3D Eulerian chemical-transport model on structured and nested grids. The parallelization has been developed using the MPI library and OpenMP directives implementing a Master-Worker strategy. Benchmarking in dif- ferent architectures is also discussed. Keywords: Hybrid Parallelization, Derived Datatypes, Multigrid, Scalability. 1 Introduction European Directives [1] for air quality impose increasingly strict control of the air pollutant concentrations. To develop efficient plans to control the emissions and achieve meaningful abatements of air concentrations, the use of Air Quality Mo- dels (AQMs) is highly recommended. While AQMs allow to model and forecast the behaviour of chemical constituents that have an impact on the air pollutant concentrations, they are computationally intensive applications. Incorporation of detailed chemistry and physics significantly increase the computing time, as do the need to describe the phenomena with sufficient resolution over a given domain or the need to perform long-term and/or multiple runs for scenario analyses. With this work we show that the computing time of an AQM can be considerably reduced with an efficiently parallelization of the code. The paper is organized as follows: in Section 2 we describe the AQM that we have used; in Sections 3 and 3.2 we describe parallelizations within MPI and OpenMP; in Section 3.3 we describe a parallelization mode implemented with both schemes, the hybrid parallelization. In Section 4 we give our main results and conclusions. 2 Flexible AiR Quality Model Flexible AiR quality Model (FARM) is a 3D Eulerian chemical-transport model (CTM) written in Fortran 77/90 used to study the transport, chemical conversion J.L. Tr¨aff, S. Benkner,and J. Dongarra (Eds.): EuroMPI2012, LNCS 7490, pp. 235–245, 2012. c � Springer-Verlag Berlin Heidelberg 2012