-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiprocessing parallelization and deep copy gives unexpected results #563
Comments
A deep copy of the roadrunner object gives incorrect results even with serial calculations. An example using deep copy w/ serial calculations.
output:
|
Sorry for not getting to this sooner! I'm not sure how deepcopy deals with Python objects that are wrappers for C objects from a shared library, but it looks like it's not working correctly here, at least. At any rate, I would recommend creating rr instances separately, and either just loading in the SBML file directly, or, to do this slightly faster, use the 'saveState' and 'loadState' (or saveStateS and loadStateS) functions to load in the state from the old roadrunner object to the new one. We actually just published an article about libroadrunner, that includes bit about parallelization, including a new 'RoadRunnerMap' object that might be useful to you: https://academic.oup.com/bioinformatics/article/39/1/btac770/6883908 You can see the Python scripts we used to create the figures (which use a couple different parallelization tricks) at https://github.com/saurolab-papers/rr2.0_paper So that will hopefully get you something that works for now. However, I'm keeping this issue open because we should figure out how to make 'deepcopy' work, and I think your 'roadrunner without wrapper' should probably work, too. We'll investigate; thanks for posting! And apologies again for not following up sooner. |
Hello,
I am trying to run tellurium / roadrunner simulations in parallel to do parameter sweeps/estimation but get unexpected results. I can sort of get around this by creating a wrapper function that loads a new roadrunner model before simulation, but this is slow if done for a large number of iterations. I noticed similar problems when doing
copy.deepcopy(rr_model)
. Is there a best practice or other work-around for this issue?Below is a simple example - the parallel pool gives incorrect results.
output:
The text was updated successfully, but these errors were encountered: