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

Parallelization with an mrgsolve model on Windows #36

Open
Vincent-AC opened this issue Jun 20, 2019 · 2 comments
Open

Parallelization with an mrgsolve model on Windows #36

Vincent-AC opened this issue Jun 20, 2019 · 2 comments

Comments

@Vincent-AC
Copy link
Contributor

Hello,

Thank you for this great tool ! I was trying to optimize some dosing regimens using an mrgsolve model as input for PopED. My OS is Windows 10. It worked fine while mono-threading but when paralellizing i did get this annoying error message :

There was a problem accessing the model shared object.
Either the model object is corrupted or  
  the model was not properly compiled and/or loaded.
Check mrgsolve:::funset(mod) for more information.

After some research I stumbled upon this issue in the mrgsolve github (metrumresearchgroup/mrgsolve#471) where the authors suggested to use the loadso() command to load the model. After trying multiple different places to put this commnad (in the ff.model function for example, makes R crash on my computer), I finally found that by editing the start_parallel script adding these few lines made the parallelization work like a charm :

      # load mrgsolve models in workers using loadso
      if (!is.null(mrgsolve_model)) {
        parallel::clusterCall(cl, loadso, x=mrgsolve_model)
      }

I forked the repository (https://github.com/Vincent-AC/PopED) and added this to the package, would you be interested in a pull request ?

@andrewhooker
Copy link
Owner

andrewhooker commented Jul 2, 2019 via email

@Vincent-AC
Copy link
Contributor Author

You are welcome, the pull request is up !

Vincent

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