I run monte carlo simulation that takes 30 hours for 1000 sims using my desktop. Has anyone used azure, databricks, or any other cloud tools to significantly improve speed/runtime? I'm thinking parrallelization but am struggling to find a library or packages that can help with that. Does anyone have any ideas or experience in this area??
Asked
Active
Viewed 106 times
1 Answers
0
I am assuming from the tags that your code is written in Python. This gives you several options:
- At a high level, you can use the multiprocessing module to run your Monte Carlo code concurrently (or even in parallel).
- If you know
C
orFortran
, you can port the expensive part of your code to C or Fortran and then use Cython to call it from your Python main function. This also allows you to use OpenMP for shared memory parallelism. - As a personal comment: 30 hours for only 1000 Monte Carlo samples seems quite excessive, even in Python. Perhaps there is a bug in your code that leads to this.
This list is probably not exhaustive.
In general cloud computing performance depends on what the vendor is offering and more importantly, on what you are willing to pay for. AWS for example does offer APIs for parallel programming but you also have to know how to use them.

SarahJuliet1510
- 120
- 6