Quick question about number of particles

1 view
Skip to first unread message

Daniel Gates

unread,
Jun 27, 2012, 4:02:51 PM6/27/12
to treevo-...@googlegroups.com
Greetings all,

I've added a way to run the particle step in parallel that seems to be working on my computer, but I have a question. The way that I currently have it set I draw the number of cores available particles and carry out just the create new particle and setDistance() steps in parallel (this is the time intensive part), after I have a list of particles (say 8 if I'm using 8 cores), I then do all the checks for particle acceptance in a loop. The problem is that since I'm running them out as blocks the loop will usually accept more particles than the set number before it kicks out to the while loop and stops the whole process. For example if the last step ended at 98 particles, the new step then made 8 more particles of which 5 were accepted I end up with 103 particles before the while loop stops and everything progresses. I was curious if this would have serious adverse affects to anything downstream because I've been running it through and nothing has blown up when I've gone over the set number of cores and it has given me ending results all the same. Is this generally going to be considered a problem, and given my (vague) description does it seem like there is an easy solution to this?

Cheers!
-Dan

B.Banbury

unread,
Jun 27, 2012, 4:19:38 PM6/27/12
to treevo-...@googlegroups.com
Awesome, how is the overhead on parallelization?  

I don't think more accepted particles would cause a problem (maybe Brian can correct me if there is something I am missing).  But an easy solution would be to just take the top 100 of 108 once they all come back together and rename it particleDataFrame.  It might be a good idea to do it that way while you are checking seeds, since the original doRun won't go past 100.  

Barb

______________________
Barb Banbury
Postdoctoral Research Associate
Ecology and Evolutionary Biology
University of Tennessee, Knoxville

Brian O'Meara

unread,
Jun 27, 2012, 4:56:10 PM6/27/12
to treevo-...@googlegroups.com
You'd probably want to take a random subset of the 108 rather than the best ones. But keeping them all would be even better. Just make sure that you have at least as many as the required number.

Brian

_______________________________________
Brian O'Meara
Assistant Professor
Dept. of Ecology & Evolutionary Biology
U. of Tennessee, Knoxville
http://www.brianomeara.info

Students wanted: Applications due Dec. 15, annually
Postdoc collaborators wanted: Check NIMBioS' website
Calendar: http://www.brianomeara.info/calendars/omeara

dga...@huskers.unl.edu

unread,
Jun 27, 2012, 6:00:58 PM6/27/12
to treevo-...@googlegroups.com
Ok I'll keep that in mind, thanks Brian!

Barb the overhead on the parallelization seems pretty good. I've only given it a couple of short runs on my computer (because long runs tend to get stuck like I mentioned a while back) but to complete 15 particles it seems to be taking around 20-25 seconds using 8 cores while it was taking around 100-105 seconds so 8x as many cores seems to be running it 4-5x faster (I think this should end up even faster as the nuber of generations is increased). I've updated it now to work as a foreach function since the cores are already registered and that's what's used earlier.

Does the foreach lose the set seed that we have? I was noticing I couldn't replicate the results I was getting in multiple parallelized runs and it seems that even when I run the initial simulations with the multicore=TRUE I'm getting different initial simulation results.

Thanks for all the help!
-Dan



From: treevo-...@googlegroups.com [treevo-...@googlegroups.com] on behalf of Brian O'Meara [bom...@utk.edu]
Sent: Wednesday, June 27, 2012 3:56 PM
To: treevo-...@googlegroups.com
Subject: Re: Quick question about number of particles

Reply all
Reply to author
Forward
0 new messages