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

could not find function "init_status.icm" #5

Open
jbbinder8 opened this issue Mar 22, 2020 · 3 comments
Open

could not find function "init_status.icm" #5

jbbinder8 opened this issue Mar 22, 2020 · 3 comments

Comments

@jbbinder8
Copy link

jbbinder8 commented Mar 22, 2020

In the project modelling-the-effects-of-public-health-interventions-on-covid-19-transmission-part-2

When I run the command

baseline_sim <- simulate(ncores=4)

I get the error

Error in { : task 1 failed - "could not find function "init_status.icm""

I'm using Windows. Please, what could I do to fix?

Changing ncores to 1 prevents the error to happen.

@AngelZweig86
Copy link

I believe that the issue here is the way the code handles the parallelization process in "_icm.icm.seiqhrf". While I'm no expert, I think this comes from the fact that Tim has a Mac computer which allows to use some packages that we cannot use in Windows. The solution I found was to use the "doFuture" package en change the doParallel part with

library("doFuture")
registerDoFuture()
plan(multiprocess)

@AngelZweig86
Copy link

Elaborating on my previous post, since doFuture is quite slow you can actually use the following expansion to the doParallel call

sout <- foreach(s = 1:nsims, .export = c('infection.seiqhrf.icm','arrivals.seiqhrf.icm',
                                         'control.icm','cum_discr_si','departures.seiqhrf.icm',
                                         'get_prev.seiqhrf.icm','init_status.icm','initialize.icm',
                                         'saveout.seiqhrf.icm','infection.seiqhrf.icm','progress.seiqhrf.icm'),
                
                .packages = 'EpiModel') %dopar% {

@XiangBu
Copy link

XiangBu commented Mar 29, 2020

same problem. Windows users Just change or add ncores=1 when running simulate function, it might take time but it works!

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

3 participants