30.07.2015 Views

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

Actas JP2011 - Universidad de La Laguna

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Runtime (h)Memory (Gb)<strong>Actas</strong> XXII Jornadas <strong>de</strong> Paralelismo (<strong>JP2011</strong>) , <strong>La</strong> <strong>La</strong>guna, Tenerife, 7-9 septiembre 2011VersiónCPUSingle-coreCPU8 ThreadsTABLA IIRESULTADOS DE SIMULACIONES EN CPU Y GPU.Partículas Tiempo Pasos/seg. Pasos503,492 14.6 h 0.38 19,8551,011,354 40.7 h 0.18 26,493503,492 3.4 h 1.64 19,8221,011,354 9.5 h 0.78 26,492GPU 503,492 0.3 h 21.18 19,8301,011,354 0.7 h 10.12 26,480Como ya se explicó anteriormente la implementaciónmás eficiente en GPU tiene un consumo muy elevado <strong>de</strong>memoria, por lo que el máximo <strong>de</strong> partículas que sepue<strong>de</strong> alcanzar es <strong>de</strong> 1.8 millones en una GTX 480. Paraevitar esta limitación en el código DualSPHysics seimplementaron tres versiones; una con todas las mejoras(FastCells(h)), sin la optimización D (SlowCells(h)) ysin las optimizaciones D y G (SlowCells(h)). Estopermite simular hasta 9 millones <strong>de</strong> partículas comopue<strong>de</strong> verse en la figura 9.1.51.00.50.00 2,500,000 5,000,000 7,500,000 10,000,000NSlowCells(2h)SlowCells(h)FastCells(h)Fig. 9. Consumo <strong>de</strong> memoria (en GBytes) para distintas versiones <strong>de</strong>GPU.En la figura 10 se muestran los tiempos <strong>de</strong> ejecución<strong>de</strong> las tres versiones GPU y <strong>de</strong> las versiones Single-corey Multi-core <strong>de</strong> CPU. Pue<strong>de</strong> verse como las versionesGPU con menor consumo <strong>de</strong> memoria presentan unmenor rendimiento, aunque siguen siendo mucho máseficientes que las CPU.10864200 2,500,000 5,000,000NCPU Single-coreCPU 8 threadsSlowCells(2h)SlowCells(h)FastCells(h)Fig. 10. Tiempos <strong>de</strong> ejecución (en horas) para distintas versiones enCPU y GPU.GPU. Cabe <strong>de</strong>stacar que estas optimizaciones sellevaron a cabo para la aplicación <strong>de</strong> un mo<strong>de</strong>lo SPH,pero la mayoría pue<strong>de</strong>n ser aplicadas a muchos otrosproblemas.Finalmente se presentó una comparativa <strong>de</strong>rendimiento real entre GPU y CPU, don<strong>de</strong> se utilizó elcódigo más optimizado para cada arquitectura sobre unhardware actual (CPU i7 940 a 2.93 GHz y GPU GTX-480). Se obtuvo un speedup cercano al 60 comparandoGPU con CPU Single-core, y <strong>de</strong> 13.3 con CPU Multicore<strong>de</strong> 8 threads.Es necesario seguir investigando cómo mejorar elrendimiento, fundamentalmente en GPU don<strong>de</strong> todavíahay varios inconvenientes que se pue<strong>de</strong>n intentarmejorar. De todas formas, para reducir tiempos <strong>de</strong>ejecución y aumentar el tamaño <strong>de</strong> las simulaciones esimprescindible implementar una versión con MPI que sepueda ejecutar en clústeres <strong>de</strong> CPUs y GPUs.AGRADECIMIENTOSEl presente trabajo ha sido financiado por la Xunta <strong>de</strong>Galicia, Programa <strong>de</strong> Consolidación e Estructuración <strong>de</strong>Unida<strong>de</strong>s <strong>de</strong> Investigación (Grupos <strong>de</strong> ReferenciaCompetitiva) cofinanciado por European RegionalDevelopment Fund (FEDER).REFERENCIAS[1] R. A. Gingold y J. J. Monagham, “Smoothed particlehydrodynamics: theory and application to non- spherical stars”,Mon Not R Astr Soc 181: 375-389, 1977.[2] A. J. C. Crespo, J. M. Dominguez, A. Barreiro, M. Gómez-Gesteira y B. D. Rogers, “GPUs, a new tool of acceleration inCFD: Efficiency and reliability on Smoothed ParticleHydrodynamics methods”, PLoS ONE, doi:10.1371/journal.pone.0020685, 2011.[3] M. Gómez-Gesteira, B. D. Rogers, R. A. Dalrymple y A. J. C.Crespo, “State-of-the-art of classical SPH for free-surfaceflows”, Journal of Hydraulic Research, 48 Extra Issue, 6–27,2010.[4] M. B. Liu y G. R. Liu, “Smoothed Particle Hydrodynamics(SPH): an Overview and Recent Developments”, Arch ComputMethods Eng 17: 25-76, 2010.[5] J. M. Dominguez, A. J. C. Crespo, M. Gómez-Gesteira and J. C.Marongiu, “Neighbour lists in Smoothed ParticleHydrodynamics”, International Journal for Numerical Methodsin Fluids, doi: 10.1002/fld.2481, 2010.[6] M. Gómez-Gesteira y R. Dalrymple, “Using a 3D SPH methodfor wave impact on a tall structure”, Journal of Waterway, Port,Coastal, and Ocean Engineering, 130(2), 63-69, 2004.[7] NVIDIA Corporation, NVIDIA CUDA Programming Gui<strong>de</strong> Ver.3.2, 2010.[8] N. Satish, M. Harris, y M. Garland, “Designing Efficient SortingAlgorithms for Manycore GPUs”, In Proceedings of IEEEInternational Parallel & Distributed Processing Symposium2009, 2009.VI.CONCLUSIONES Y TRABAJO FUTUROSe presentó un código basado en el método SPH parala simulación dinámica <strong>de</strong> fluidos con unaimplementación CPU y otra GPU. Sobre cadaimplementación se mostró que el cómputo <strong>de</strong> fuerzas erala parte más costosa en tiempo. Una vez analizadoscuales eran los problemas que presentaba cadaimplementación, se aplicaron una serie <strong>de</strong>optimizaciones para minimizarlos y mejorar elrendimiento. Con estas optimizaciones se logrómultiplicar la velocidad por 10 en CPU y por 2.6 en<strong>JP2011</strong>-704

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!