I always used mathematica for more "theoretical" computations: maybe I had to handle intricated manipulations, but things that you could almost do on paper.
Now I just joined a new project where we will have to handle HUGE (for my standard) computations: maybe simplifications of 400MB output! This time the difficulty is not "coding intricated manipulations", most of the time the thing we really have to do is a "//Together", but the expressions are so long...
I understand that these kind of things cannot be done simply on a notebook, as I always worked: the next simplification make Mathematica crash and I waste a night worth of computations.
So come my question: what are good "coding habits" to have when working in this kind of projects? Are there Mathematica functions I should be aware of (Monitor, Timing, those kind of things)? Also, good references/tutorials on this kind of topic?
I hope the question is not too vague...
DumpSave
might be your friend. $\endgroup$Compile
) is not seldomly much faster than doing the same with expressions that first have been simplified with enormous effort. But of course, this depends on the nature of the actual problem. $\endgroup$free -m
is useful for predicting when I am likely to bring my machine to a grinding halt. Less clear is what will let one know when a kernel might be about to crash. Might want to usememoryConstrained
to see if that helps at least to prevent the crashes. Also might want to try simplifying and replacing subexpressions first, if possible. $\endgroup$Collect
together withSimplify
, as described here, sometimes is helpful. $\endgroup$