Manish Agrawal


Week 1

02 Jun 2019 »

GSoC 2019 :: gprMax Weekly Documentation

Week 1

First week of my GSoC-2019 started on 27th May. Since this is the first week, the community bonding period has been an effective period of exploration and understanding the problem statement itself. This week was quite effective since I kick started the project to implement the PyOpenCl module basic functionalities.

If you have not been through my proposal, its here. I will be working on to provide an OpenCl based solver for gprMax to support heterogeneous computing devices. OpenCl is different from CUDA in many ways. I will be soon posting a deep explanation on how OpenCl programs work.

CUDA kernels for GPU solver in gprMax are responsible for primary operations on devices supporting Nvidia CUDA provides information on how the threads and blocks are distributed currently. Essentially, a rather simple technique of 1D indexing is used in which all the operations are carried out along a single dimension of blocks / grids. This was my goal for the upcoming couple of weeks; to rather make use of this simple technique and make running opencl based on the same.

PyOpenCl is the Python package which makes calls to OpenCl C++ APIs internally. It will be used to support OpenCl implementation for gprMax. PyOpenCl provides its own featurization over just providing a wrapper. Arrays can be simply created and accessed with numpy arrays, automatic error checking and Elementwise Kernel which takes number of arguments and performs operations specified as C snippets.

With the help of PyOpenCl I have written a basic code base for PyOpenSolver, a Python Class for opencl based solver which will be integrated with the main code base. PyOpenSolver as of now supports basic platforms and devices querying and selection, initialization of contexts and Command Queues, setting host and device side arrays. In the following week, kernels for field update, output storage and source update shall be written to work with PyOpenSolver and gprMax in all.