Eu tenho acesso a um cluster IBM IDataplex com o CentOS v.6.2. Se eu quiser executar o seguinte script R em 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))
Como eu utilizo o desempenho do cluster (especificando núcleos) usando qsub / bsub para executar este script?