Does dsolve benefit from multiple cores?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Ítalo Almeida
il 7 Mar 2023
Modificato: John D'Errico
il 7 Mar 2023
I want to solve a first order linear system of 50 equations and variables and I have access to a server. Would the dsolve function run fast with multiple cores? I dont even know how much time it takes to run in my personal PC because after one day running I had to stop the process.
0 Commenti
Risposta accettata
John D'Errico
il 7 Mar 2023
Modificato: John D'Errico
il 7 Mar 2023
In general, no. No tools in the symbolic toolbox that I know of are currently set up to employ multiple cores. I might have missed something, but I've been a moderately heavy syms user over the years.
That may change with time of course, in fact I could argue there are a couple of problems which could easily benefit from multiple cores. The examples I would see most prominently are the factoring of large integers (which might employ perhaps a quadratic sieve or elliptic curve methods), or testing large integers for primality (which might employ the MIller-Rabin algorithm.) All of those algorithms would seem to have good potential as multi-threaded code.
As far as the solution of a first order linear ODE system with 50 variables, DON'T DO IT SYMBOLICALLY. Even if you had multiple cores, this is the kind of problem where you will not see sufficient benefit, even if you had hundreds of cores, AND the code really was multithreaded. That is the sort of problem you will need to solve numerically. Sorry. And that means of course, that ALL constants need to be provided in advance as numbers. Sorry again. Odds are, even with a thousand cores available, your computer will turn to dust before it finishes that computation in symbolic form.
0 Commenti
Più risposte (1)
Jan
il 7 Mar 2023
Modificato: Jan
il 7 Mar 2023
Open the TaskManager and look at the CPU usage. Does dsolve use one or all cores? This is a strong hint to decide, if it is multithreaded.
You can use the profiler to find the bottleneck of the code. Maybe it is a repated call of an expensive function like exp() with the same input or a forgotton pre-allocation.
profile on
... start your dsolve command
... after 5 minutes press Ctrl-C
profile report
0 Commenti
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!