Monday June 1, 2015
You task is to create a simulation of heat dissipation that runs on a GPGPU using the OpenACC programming standard.
The model in this question involves a metal inside of a 2D environment; the metal is surrounded by 4 walls, one of which has a constant temperature of 100.0. The metal is represented as a 2D grid of cells, each of which has a temperature of 0.0. As the simulation advances, the new temperature of each cell is calculated based on the old temperature of the 4 neighboring cells (up, left, right, and down), "I am the average of my neighbors." The walls do not change temperature.

The program should run on a GPGPU by utilizing the inherent vectorizability of the calculation for the average of neighbors (0.25 * (up + left + right + down)). You should use the OpenACC standard to send work to the GPGPU to be executed. Your program should have a flag that triggers whether intermediate results (the temperature at each cell in the metal) will be sent back to the CPU at each time step to be printed or whether only the last result is sent back to the CPU for printing.

A solution will consist of source code for a working program.
Show solution
Challenge Resources:
©1994-2020   |   Shodor   |   Privacy Policy   |   NSDL   |   XSEDE   |   Blue Waters   |   ACM SIGHPC   |   feedback  |   facebook   |   twitter   |   rss   |   youtube   |   XSEDE Code of Conduct   |   Not Logged In. Login