bb
 
“If you plan to make a voyage of discovery, choose a ship of small draught”
 
Captain James Cook rejecting the large ships offered by the Admiralty for the search of a new continent.
Fast and robust, from the CPU’s to the GPU’s: Parallel computing and its applications in data-parallel problems using GPU architectures PDF Print E-mail

Parallel computing has become an important subject in the field of computer science and has proven to be critical when researching high performance solutions.

There was a period in history in which the processors worked in a sequentially manner. At that time a more powerful processor basically meant an increase in the clock frequencies and a higher transistor density, which together derived in a higher computing power. The Moore’s law says that the transistor density doubles approximately every two years. Nowadays, this law is still being fulfilled; however it is no possible to increase the programs performance in an automatic manner as it was at some moment in history, since the clock frequencies reached their limit. Following this problem arises what we call parallel computing, which has become an essential tool for science and in a strong branch of research for computing science.

 

The evolution of computer architectures like CPUs and GPUs towards a higher number of cores can only confirm that parallelism is today an effective approach for speeding up an algorithm. For some computational problems, sequential CPU-based algorithms are not fast enough to give a solution in a reasonable amount of time. Sometimes these problems can become large to the point that not even a multi-core CPU-based algorithm is fast enough. Problems such as these can be found in science and technology; natural sciences (Physics, Biology, Chemistry), information technologies (IT), geospatial information systems (GIS), structural mechanics problems and even abstract mathematical/computer science (CS) problems. In the article by Cristóbal Navarro, from the Physics Laboratory of CECs, it is indicated that using the parallel computing many of the solutions to these problems can now be computed (calculated) in a reasonable period of time.

comp1

Figure 1. Difference between the CPU (left) and GPU (right) architecture.

Parallel computing is the act of solving a problem of size n by dividing its domain into k ? 2 (with k ? N) parts and solving them with p physical processors, simultaneously. Being able to identify the type of problem is essential in the formulation of a parallel algorithm. Let P D be a problem with domain D. If P D is parallelizable, then D can be decomposed into k sub-problems:

comp2

P D is a data-parallel problem if D is composed of data elements and solving the problem requires applying a kernel function f (...) to the whole domain:

comp3

P D is a task-parallel problem if D is composed of functions and solving the problem requires applying each function to a common stream of data S:

comp4

Data-parallel problems are ideal candidates for the GPU, while task-parallel problems are best suited for the CPU. Computational physics problems, such as n-body, are mostly data-parallel, therefore they are good candidates for a massive parallelization on GPU. The n-body problem is an interaction problem where n bodies, or particles, are affected by the gravity of the other n ? 1 ones, in a k-dimensional space (usually k = 2 or k = 3). What is interesting about the n-body problem is that for a system of just three particles no analytical solution exists. For this reason, the n-body is one of the emblematic data-parallel problems found in computational physics, and the goal is to simulate the system through time.

The n-body problem states that for each particle its force is given by its interactions with the other particles:

comp5

A classic simulation requires an O(n ^2 ) algorithm since it is an all-with-all type of problem. A GPU solution can process particles in parallel, resulting in a O( n^2 / p ) algorithm, where p is the amount of processors. Research on n-body simulations have found that faster methods exists when sacrificing some numerical precision. The argument is based on the fact that contributions of the summation terms decrease quadratically with the distance between two bodies. As a result, bodies very far from a certain body make an insignificant contribution to its final force, while bodies close to that same body make most of the contribution to its final force. This significance of contributions is the key for designing a faster n-body algorithm. The Barnes-Hut tree-code algorithm is a well known spatial partitioning solution that achieves O(nlog_k(n) ) average time per time step. It uses a quad-tree for k = 2 or equivalently an oct-tree for k = 3. The tree is used for storing average measures of cluster of points far from the reference point (Figure 2).

 

comp6

Figure 2. A quad-tree applied on two clusters of points.

 

When the simulation is run on GPUs, one can make many particles use the tree in parallel. This improvement in compute time allows one to study much larger systems in the order of millions of particles. Many other physical problems can be treated in parallel using GPUs. The only initial requirement for the problem is to offer enough data-parallelism. However the final performance will also depend on the memory access patterns and the communication between data-elements. Access patterns that keep locality within data-elements incur in high performance, while scattered access patterns present an additional challenge of rearranging the data in a different way, or use the manual caches of the GPU.

 

---

Reference: C. A. Navarro et al. (2014) A Survey on Parallel Computing and its Applications in Data-Parallel Problems Using GPU Architectures. Commun. Comput. Phys. doi: 10.4208/cicp.110113.010813a

 

 
 
El Centro de Estudios Científicos (CECs) es una corporación de derecho privado, sin fines de lucro, dedicada al desarrollo, fomento y difusión de la investigación científica. El CECs fue fundado en 1984 como el Centro de Estudios Científicos de Santiago donde funcionó en una casa arrendada hasta el año 2000, momento en el que se mudó a Valdivia donde evolucionó para llegar a ser lo que es hoy. Desde su fundación el CECs ha sido dirigido por el físico Claudio Bunster.

Luego de treinta y seis años de existencia, el CECs ha decidido renovar su sitio web, el cual se encuentra actualmente en construcción. En el intertanto las consultas pueden ser dirigidas a info@cecs.cl.

Lo que sigue es un extracto de un folleto que fue producido justo después de que el centro se trasladara a Valdivia. Sentimos que estas palabras aún reflejan su espíritu:
 

horse
 
Una pequeña banda de investigadores del Centro de Estudios Científicos (CECs) en Valdivia, Chile, comparte un sueño audaz, anticuado en esta era de la Gran Ciencia – la búsqueda irrestricta del conocimiento, en un pequeño instituto independiente de investigación de primera calidad. Sus miembros se han reunido durante un lapso de tiempo que abarca ya, más de un cuarto de siglo, para emprender una aventura intelectual que es riesgosa, estimulante y tremendamente productiva.
 
Ubicado entre los Andes y el Pacífico, en esta pequeña ciudad del sur, el CECs es uno de los pocos institutos en el mundo que trabajan en investigación de vanguardia en múltiples disciplinas, sin recibir recursos o estar afiliada a ninguna institución anfitriona. Sus investigadores son libres para desarrollar su mejor ciencia con independencia de las modas y sin restricciones burocráticas, en una atmósfera de colaboración y apoyo mutuo. El fruto de este esfuerzo se traduce en un flujo permanente de ideas innovadoras, con estudiantes altamente capacitados y resultados que son publicados en revistas especializadas. El Centro ha demostrado lo errado de los prejuicios y escepticismo relacionados con su pequeño tamaño, al ubicar a Chile, con la capacidad de sus integrantes y audaz estrategia, en el mapa mundial de la ciencia, revolucionando de paso el modelo tradicional de estructurar la ciencia en Chile y mostrando – con su ejemplo – cómo “lograr más con menos”. Sus investigadores hablan en tono de curiosidad, maravilla y ocasionalmente orgullo al describir su emocionante viaje por aguas inexploradas.
 
La estrategia del CECs es sustentar un entorno científicamente rico donde la ciencia y los científicos son lo primordial – atrayendo a las mejores personas, apoyándolos adecuadamente y ofreciéndoles libertad para perseguir sus sueños.
La actual tripulación del centro es la siguiente: