Skip to content
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

Can't call ROSS multiple times #114

Open
mdorier opened this issue Mar 20, 2017 · 2 comments
Open

Can't call ROSS multiple times #114

mdorier opened this issue Mar 20, 2017 · 2 comments

Comments

@mdorier
Copy link
Contributor

mdorier commented Mar 20, 2017

I'm trying to integrate ROSS simulations into a workflow, so a set of processes should be able to call a ROSS-based simulation (CODES model-net-mpi-replay) multiple time. This means calling tw_init/tw_end multiple times in a row. I ran into problems and realized ROSS uses many global/static variables (most globals in ross-global.c, but there are also static variables in other files that have a default value at the beginning of a run). While the first run of ROSS works fine, the following don't because some of the variables need to be reinitialized.

Would it be possible to add some kind of tw_reset() function that puts ROSS in the same state it was before the first tw_init call?

@caitlinross
Copy link
Member

Sure, I'll take a look at adding in that functionality.

@caitlinross
Copy link
Member

caitlinross commented Apr 13, 2017

I've added in a tw_reset() function. Everything seems to be working with phold, but I still want to do some more testing before I merge it into master because I may have missed some things. In the meantime, do you mind checking out the tw-reset branch and trying it out with what you're working on? Let me know if there's any issues.

I've made the assumption any model using this functionality will be initializing MPI itself and calling the tw_comm_set() fuction. Then the only thing you need to do is call tw_reset() after tw_end() of the previous simulation and before tw_init() of the next. tw_reset() will (hopefully) take care of everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants