From: Rainer M. <ra...@tb...> - 2007-05-15 19:04:16
|
Hi, now also the forward sensitivity function can be compiled. In CVS now. Performance for forward sensitivity calculation is roughly 8-fold! However, there is a problem with using multiple code instances in TCC - they can be used but cause a segmentation fault when the second instance is freed. We need two code instances because sensitivity function can change between subsequent solver runs, but the ODE and Jacobi stay the same. So until I get a response by the TCC people, whether this will be solved soon or whether anyone has a patch, I will leave it like this to avoid unnecessary TCC allocations/compilations. If TCC can't be patched soon, we can either a) have an additional sensitivity compilation option, so the leak can be avoided but still compilation for ODE/Jacobi functions used or b) also re-compile the ODE/Jacobi function for each new sensitivity run So please watch out: there are memory leaks because currently, the sensitivity code is not freed after usage! Rainer Rainer Machne wrote: > Hi Everyone, > > Great news: > > as recently several people started to use SOSlib on supercomputing > clusters, we were motivated to go into the code again and optimize. > > Christoph and me went through Andrew Finney's old code for online > compilation of the right-hand side functions passed to CVODES (including > command-line calls etc.). > > So I just managed to get the same code running under Linux using the > Tiny C Compiler as a library and the very cool TCC online compilation: > > tcc_compile_string(TCCState *s, char *sourceCode); > > > So far it works only for the one bottle-neck function that evaluates > ODEs (and not e.g. for jacobi evaluation or sensitivity stuff). > > But that already brings significant performance gains! E.g. for the > example model MAPK.xml, integrating to time 100000 in 1000 steps: > > without compilation: 2.13 seconds > with tcc compilation: 0.53 seconds > > A strange effect is that at higher error tolerances and long integration > times the results start to differ. We need to check where the different > round-offs etc. are made. At lower tolerances the results are exactly > the same. > > > The new code is in CVS now. Linking to TCC is optional, so everything > else should still work as before. > > Caveat: TCC so far only works on 32-bit architecture, and thus all > libraries (sundials, xerces/expat, libsbml and soslib) must also be > compiled and run on 32-bit machines. > > So we can only hope that TCC will soon be available for x86_64, > otherwise we could still implement command-line calls, like for the > Windows version (where back then tcc didn't work as a library). > (TCC can be run on 64-bit but only with -m32 options and asfaik it's not > possible to have a mixed architecture code in on tool). > > > TCC is available from http://fabrice.bellard.free.fr/tcc/ > > However, I used Robert Landley's fork because I couldn't compile the > original, and he seems to be the only one still working on it: > > http://landley.net/code/tinycc > > It should work with both ... in principle. > > > So if that all works (with all rhs functions), I think there are not > much more possibilities to get faster, i.e. to make better use of > SUNDIALS from arbitrary ODE models. > > We can only include the usual reaction network analysis, i.e. mass > conservation analysis, to get rid of unnecessary ODEs etc. However, I > guess, that won't bring very much gain, because the lost equation is > similar to a still existing one which still needs to be solved by > CVODES. Maybe "fast reaction analysis" would have some potential? > > So, I think we are close to becoming as fast as possible. > > Well, there'd probably still be possibilities with model-specific > "preconditioning" and such stuff about which I don't know much. Feel > free to propose your ideas :) > > Rainer > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > sbmlsolver-discuss mailing list > sbm...@li... > https://lists.sourceforge.net/lists/listinfo/sbmlsolver-discuss |