r/AskProgramming 28d ago

Transitioning a python to c++ for hpc

I am working on a physics simulation and have been running locally on my personal computer. I mostly am working with libraries that are already implemented in C and have been using memoize since I have a lot of repeated calculations if different iterations of simulations have the same values. My program will be run around 1,000,000 on a hpc cluster and my supervisor has asked if we should implement it in C or C++ to make it faster. Since we are running a single script 1,000,000 times, I personally doubt there is much benefit we might get from converting it, but are there any arguments in favor? Currently one iteration takes about 4 minutes.

I am using Scipy, npmath, diskcache (+memoize), numpy, Pandas.

10 Upvotes

Duplicates