Parallel scientific applications are often written in low-level languages for optimal performance. However, such applications often sacrifice straightforward debugging and usability in the interest of performance. Mercury is a C++ based parallel Monte Carlo particle transport code. This study seeks to improve the Mercury user experience and to simplify debugging and validation without compromising performance. Toward this goal, mixed-language programming paradigms allow for high-performance, low-level computational code and simple, high-level code for control, debugging, and user interfaces. Numerous tools exist for connecting low-level C++ code with high-level Python code. With the Python/C Application Programming Interface (API), we implemented an interactive Python interface called PyMercury. PyMercury allows users to access geometry and physics calculations and to control debugging tools during runtime. PyMercury also serves as a framework for developers to create tests for Mercury software validation. We illustrate the effectiveness of PyMercury in debugging, validation, and usage with two case studies. The first case study illustrates the effectiveness of PyMercury in debugging and validation. PyMercury successfully validates adaptive mesh refinement (AMR) volume calculations for Mercury geometric setups. The second case study demonstrates the effectiveness of PyMercury in providing a straightforward runtime user interface. Physicians and other users can use PyMercury to rapidly develop simulations of radiation cancer therapy strategies. PyMercury demonstrates the value of interactive Python for rapid debugging and verification of scientific computing applications.

Issue Date:

2011-05

Publisher:

ANS/LAS International Conference on Mathematics and Computational Methods Applied to Nuclear Science and Engineering (M&C 2011)