Calvagone / campsis

A generic PK/PD simulation platform based on rxode2 and mrgsolve engines.
https://calvagone.github.io/
GNU General Public License v3.0
8 stars 3 forks source link

Remove call to suppressMessages when building mrgsolve model #91

Closed luyckxn closed 2 years ago

luyckxn commented 2 years ago

The initial intention of suppressMessages was to remove the message 'Building model...' when the model was built.

However, it is not a good idea. When there is an error in the compilation (for instance if an equation is not correct), there is no clear error message anymore.

kylebaron commented 2 years ago

There is an argument to mread() called quiet that will silence this:

https://mrgsolve.org/docs/reference/mread.html

luyckxn commented 2 years ago

Thanks. Actually, I was already using quite=TRUE but I still had a message '(waiting) ...' making the progress bar appear multiple times when replicates are used, since the model is rebuilt every time. I could find a temporary fix using 'withCallingHandlers' (see commit).

kylebaron commented 2 years ago

I see; I opened an issue to make that message subject to that quiet argument.

Please be aware that there is a waiting period that is built in when trying to compile the same model repeatedly. This was needed because we noticed some strange behavior associated with loading / unloading shared objects in R like that. This will certainly affect performance. Well ... it's already affecting the performance if you have to wait for recompile between every iteration. This definitely isn't intended use. Why not refactor to use as intended?

Kyle

luyckxn commented 2 years ago

Thanks very much. A small refactoring is on my todo list!