matthewjdenny / GERGM

An R package to estimate Generalized Exponential Random Graph Models
38 stars 10 forks source link

Parallel Inquiry #3

Open kmcnayr opened 7 years ago

kmcnayr commented 7 years ago

Not an issue, but don't know a better way to ask a question: is there a way to verify the parallel is working? I set parallel and parallel_statistic_calculation to true and cores to my number of cpus in the ergm function but it doesn't seem like my computer's cpu's are being used. Was thinking they'd all hit 100% doing some work like other parallel models. Just curious what the parallel should look like and what kind of speedup to expect. Thanks!

matthewjdenny commented 7 years ago

@kmcnayr Sorry I didn't see this earlier! You need to set parallel = TRUE, cores = X, and parallel_statistic_calculation = TRUE. For parallel_statistic_calculation, it uses C++ threading, which only really kicks in if you are working with a large network, and only during MCMC when simulating networks. I have found it gives a pretty moderate speedup (maybe 2x-5x faster with networks under 100 nodes, using like 10 cores), but this speedup grows relatively in the network size. Let me know if you still do not see full utilization (although I would not expect to see it with a smaller network under 20 nodes or so, just because it should happen so fast you do not get to register the utilization). There might also be some issues with it on windows or more exotic linux distros. Hope this helps!