串行

APPLY<- function(m){
mTemp <- apply(m, 2, mysort)
return(mTemp)
}

snowfall包的并行

SNOWFALL<-function(m,ncl){
library(snowfall)
sfInit(parallel = TRUE, cpus = ncl)
mTemp<- sfApply(m,2,mysort)
sfStop()
return(mTemp)
}

04-28 11:38