[R-sig-hpc] To run bugsparallel

Whit Armstrong armstrong.whit at gmail.com
Fri Mar 5 14:07:48 CET 2010


Running jags w/ Rmpi works, but  you may have to hack the R2jags source a bit.

The issue we had was that all the Rmpi instances running on one
machine try to write the data files to the same location.

I still have the patched package if you are interested.

Another way to tackle the problem is to run
pymc(http://code.google.com/p/pymc/) using python/boostmpi.

Happy to talk more about either of those options.

-Whit


On Fri, Mar 5, 2010 at 12:48 AM, Paul Johnson <pauljohn32 at gmail.com> wrote:
> I didn't want you to think we are ignoring you.  I don't know the
> answer because I use Linux, not Windows, and you do outline a very
> complicated toolchain.  I can ask some questions that may help you
> think through this.
>
> 1. You have success with MPI programs in R?  Except for winbugs, I
> mean. Right?  You can run the examples that circulate with programs
> like Rmpi or snowFT?
>
> 2. You have success running just ONE thread with winbugs from R?  (no
> parallelism). Right?
>
> 3. When you run winbugs from R, are you able to get it to run multiple
> chains at once (without invoking MPI)?
>
> 4. what is "bugsparallel" software?  Do we have any reason to believe
> it is good?
>
> I doubt that testing all of this on a one processor system is useful.
> In my experience, mpich will notice that and refuse to do anything at
> all.
>
> On Linux, Winbugs works horribly for me.  There is an alternative
> implementation of BUGS called jags that runs on Linux.  I believe that
> if you really want to get something that works in an understandable
> way, you might consider going in that direction.  I'm sorry nobody
> stepped up to answer your question, but you have to admit that you
> have created a very complicated problem and there aren't many Windows
> users who have tried it. Especially on one processor systems.
>
> pj
>
> On Thu, Mar 4, 2010 at 7:07 PM, Debabrata Midya
> <Debabrata.Midya at services.nsw.gov.au> wrote:
>> Hi,
>>
>> Thanks in advance.
>>
>> I have posted this one on 25 Feb 2010 and so far I have not received
>> any answer. That is why, I am posting it once again. I may be excused
>> for this.
>>
>> I have come across bugsparallel software to run WinBUGS in parallel.
>>
>> I need your assistance to solve this problem. The computer hangs while
>> running at bugs.fit <- bugsParallel(…….)
>>
>> I have described below how I have tried.
>>
>> 1. I am running on Windows XP and I have tested on a Pentium® D CPU
>> 2.80GHz, 1.50 GB of RAM and it has a single processor (for a test run
>> only).
>>
>>
>> 2. Installed: MPICH2 requires Microsoft .Net 2.0 .NET Framework Version
>> 2.0 Redistributable Package (
>> http://www.microsoft.com/downloads/details.aspx?familyid=AEA55F2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en
>> )(NETCFSetupv2.msi)
>>
>> 3. Installed: Visual C++ 2005 SP1 Redistributable Package (x86) (
>> http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&DisplayLang=en
>> ). (vcredist_x86.exe)
>>
>> 3. Installed: MPICH2 for Windows (mpich2-1.2.1-win-ia32.msi )
>>
>> 4.      I have installed R-2.10.1 and Rmpi 0.5-9. I have tested the
>> following code and it works.
>>
>> library(Rmpi)
>> mpi.spawn.Rslaves(nslaves=3)
>> mpi.parReplicate(20, mean(rnorm(1000)))
>> mpi.close.Rslaves()
>>
>> 5. I have installed rlecuyer (0.3-1), coda (0.13-4) and lattice.
>>
>> 6. I have installed WinBUGS 1.4
>>
>> 7.      But the machine hangs on bugs.fit <- bugsParallel(…….) whenever
>> I run bugsparallel code. That means the program runs up to
>> mpi.setup.rngstream() # initializes parallel random number generation
>>
>> model.name = "FXaExample1" # root name of modeling files
>> workDir = "M:/Rmpi/bugsparallel/bugsParallel/FXaExample1" # change to
>> match the path to the directory containing FXaExample1.R and
>> FXaExample1.txt
>> toolsDir = "M:/Rmpi/bugsparallel/bugsParallel/bugsTools" # change to
>> match your setup
>> bugsDir = paste("M:/WinBUGS14/",sep="")
>> nSlaves = 4
>>
>> library(Rmpi)
>> library(rlecuyer)
>> library(coda)
>> library(lattice)
>> source(paste(toolsDir,"/bgillespie.utilities.R",sep="")) # These are a
>> few of my favorite things
>> source(paste(toolsDir,"/bugsParallel-1.0.R",sep=""))
>> source(paste(toolsDir,"/bugs.tools.R",sep="")) # A few BUGS-specific
>> utilities
>>
>> set.seed("10271998") # not required but forces consistent results
>> setwd(workDir)
>> ###################################################################
>> # Data management
>>
>> xdata = read.csv("fxa.data.avg.csv")
>>
>> # create WinBUGS data set
>> bugsdata = list(
>>            nobs = nrow(xdata),
>>            cobs = xdata$cavg,
>>            FXa = xdata$fxa.inh.avg)
>>
>> # create initial estimates
>> bugsinit = function() list(
>>            Emax = runif(1,40,100),
>>            logEC50 = rnorm(1,log(100),0.4),
>>            gamma = 10*rbeta(1,0.25,5),
>>            sigma = exp(rnorm(1,log(5),0.2)))
>>
>> # specify what variables to monitor
>> parameters = c("Emax","EC50","gamma","sigma","FXaPred")
>>
>> # specify the variables for which you want history and density plots
>> parameters.to.plot = c("deviance","Emax","EC50","gamma","sigma")
>>
>> ################################################################################################
>> # run WinBUGS
>>
>> n.chains = nSlaves
>> n.iter = 600
>> n.burnin = 100
>> n.thin = 5
>>
>> mpi.spawn.Rslaves(nslaves = nSlaves) # launches multiple R slave
>> processes on available processors
>> mpi.setup.rngstream() # initializes parallel random number generation
>>
>> if(.Platform$OS.type == "windows"){
>>            bugs.fit <- bugsParallel(data=bugsdata,inits=bugsinit,
>>
>> parameters.to.save=parameters,model.file=paste(getwd(),"/",model.name,".txt",sep=""),
>>
>> n.chains=n.chains,n.iter=n.iter,n.thin=n.thin,n.burnin=n.burnin,refresh=10,clearWD=T,
>>                        bugs.directory = bugsDir)
>> }else if(.Platform$OS.type == "unix"){
>> #          wineBin = "/Applications/Darwine/Wine.bundle/Contents/bin"
>>            wineBin = "/usr/local/MacPorts/bin"
>>            bugs.fit <- bugsParallel(data=bugsdata,inits=bugsinit,
>>
>> parameters.to.save=parameters,model.file=paste(getwd(),"/",model.name,".txt",sep=""),
>>
>> n.chains=n.chains,n.iter=n.iter,n.thin=n.thin,n.burnin=n.burnin,refresh=10,clearWD=T,
>>                        bugs.directory = bugsDir, useWINE=T,
>> WINE=paste(wineBin,"/wine",sep=""),
>>                        newWINE=T,
>> WINEPATH=paste(wineBin,"/winepath",sep=""))
>> }
>>
>> It runs up to mpi.setup.rngstream() but hangs on at
>>
>> bugs.fit <- bugsParallel(…….)
>>
>> Once again, thank you very much for the time you have given.
>>
>> I am looking forward for your reply.
>>
>> Regards,
>>
>>
>> Deb
>>
>> *************************************************************************************
>>
>> This email message, including any attached files, is confidential and
>> intended solely for the use of the individual or entity to whom it is
>> addressed.
>>
>> The Department of Services, Technology and Administration prohibits the
>> right to publish, copy, distribute or disclose any information contained in
>> this email, or its attachments, by any party other than the intended
>> recipient. If you have received this email in error please notify the sender
>> and delete it from your system.
>>
>> No employee or agent is authorised to conclude any binding agreement
>> on behalf of the Department of Services, Technology and Administration
>> by email. The views or opinions presented in this email are solely those of
>> the author and do not necessarily represent those of the Department,
>> except where the sender expressly, and with authority, states them to be
>> the views of the Department of Services, Technology and Administration.
>>
>> The Department of Services, Technology and Administration accepts no
>> liability for any loss or damage arising from the use of this email and
>> recommends that the recipient check this email and any attached files for
>> the presence of viruses.
>>
>> *************************************************************************************
>>
>>        [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> R-sig-hpc mailing list
>> R-sig-hpc at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>>
>>
>
>
>
> --
> Paul E. Johnson
> Professor, Political Science
> 1541 Lilac Lane, Room 504
> University of Kansas
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>



More information about the R-sig-hpc mailing list