I tried to run it on both linix station and windows. It seems to run oK. However, the run time is much longer than running on one cpu. Does anybody know what is the problem? My code is roughly like this. Can somebody help me with this? Thanks
bgSubtract.dym.p <- function (sL.bg, mL.bg, sL.tg, mL.tg, lRT, rRT, ppm, lowThr, ppmAdj,fac)
{
sL.bg <- as.matrix(sL.bg)
sL.tg <- as.matrix(sL.tg)
mL.bg <- as.matrix(mL.bg)
mL.tg <- as.matrix(mL.tg)
mL.tg2 <- NULL
if( "rparallel" %in% names( getLoadedDLLs()) )
{
runParallel( resultVar="mL.tg2", resultOp="c", nWorkers=2 )
}
else
{
for (i in 1:nrow(sL.tg))
{
.....
for (j in start:end)
{
........
}
mL.tg2 <- c(mL.tg2, mL.tg[start:end,2])
}
}
return(mL.tg2)
}
|