2

I have access to an IBM IDataplex Cluster with CentOS v.6.2. If I want to run the following R script on R:

library(data.table) library(mgcv) library(reshape2) library(dplyr) 
library(tidyr) library(lubridate) library(DataCombine)

temp_hist <- as.data.table(temp_hist)
humid_hist <- as.data.table(humid_hist)

# Merge
mykey<- c("FIPS", "year","month", "week")
setkeyv(temp_hist, mykey)
setkeyv(humid_hist, mykey)

hist<- merge(temp_hist, humid_hist, by=mykey)

# Min
hist_min <- hist

hist_min$FIPS <- hist_min$year <- hist_min$month <- hist_min$tmax <- hist_min$tmean <- hist_min$hmax <- hist_min$hmean <- NULL

# Adding Factors
hist_min$citycode <- rep(101,nrow(hist_min)) 
hist_min$year <- rep(2010,nrow(hist_min))
hist_min$week <- rep(1,nrow(hist_min)) 
hist_min$lnincome <- rep(10.262,nrow(hist_min))

# Predictions
pred_hist_min <- predict.gam(gam_mean_count_wk, hist_min)

pred_hist_min <- as.data.table(pred_hist_min)
pred_hist_min <- cbind(hist, pred_hist_min)
pred_hist_min$tmax <- pred_hist_min$tmean <- pred_hist_min$tmin <- pred_hist_min$hmax <- pred_hist_min$hmean <- pred_hist_min$hmin <- NULL

# Aggregate by FIPS
min_hist <- pred_hist_min %>%
  group_by(FIPS) %>%
  summarise(pred_hist = mean(pred_hist_min))

How do I utilise the performance of the cluster (specifying cores) using qsub/bsub to run this script?

  • 1
    Would something like Rmpi work for you? – Faheem Mitha Apr 17 '16 at 16:43
  • I can't seem to install Rmpi on my the cluster. Are there any other solutions? Thanks! – shouro Apr 17 '16 at 17:07
  • Sure, see stackoverflow.com/q/1395309/350713 – Faheem Mitha Apr 17 '16 at 17:33
  • Thanks again. I'll check out the packages. Do I not need use bsub or qsub beforehand? – shouro Apr 17 '16 at 17:53
  • Sorry, I'm not sure. Maybe talk to the people who run the cluster? – Faheem Mitha Apr 17 '16 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.