Friday, May 16, 2014

TARDIS Optimization - Preliminary Plans

The goal of this GSoC project it to optimize TARDIS in terms of computation time. TARDIS is a Monte Carlo radiative-transfer spectral synthesis algorithm for 1D models of supernova ejecta. The motivation behind this is to be able to run TARDIS simulations with different parameters in supercomputing clusters. So if we can improve TARDIS so that a single simulation takes half as much time as it does now it can mean weeks of saved time.
Through the use of profiling and common sense it was decided that the major bottleneck are the Monte Carlo routines that do the actual simulation. The first task I will be concentrating on is the rewrite of TARDIS Monte Carlo routines that are currently written in Cython in C. This serves a two-fold purpose - while Cython is great for adding static declarations to bottle-neck loops and the like it is not that readable when the whole 1000+ line module is written in it plus it will allow us to use profiling tools like Valgrind in a more straightforward fashion. We also hope that simply rewriting the module in C might provide a slight performance boost by itself.
We will be using asv for benchmarking the project as we go along to see what speed gains we got. Also valgrind for profiling. The process of porting to C will be done in a way that will not interfere with the use of TARDIS in any way. Functions will be ported to C one by one and then imported to be used in the existing Cython base. I have already started that by porting one of the utility functions and there seem to be no obstacles to progressing from there.