Hi there,
My error message:
I've got the following issue when I want to use the caret
package on a personal cluster (4 nodes of 20 cores each) with SLURM task manager:
> # Train model -----------------------------------------------------
> model <- train(Temp ~ ., data = data, method = "lm")
Error in { :
task 1 failed - "object 'requireNamespaceQuietStop' not found"
Calls: train ... train.default -> nominalTrainWorkflow -> %op% -> <Anonymous>
Execution halted
It seems to me that the internal caret function requireNamespaceQuietStop
is not found.
How I launch my computation:
Command
sbatch job.sh
File job.sh
#!/bin/bash
#SBATCH --job-name=test_caret
#SBATCH --mail-type=ALL
#SBATCH --nodes=1 # number of nodes
#SBATCH --ntasks-per-node=20 # number of cores
#SBATCH --time=48:00:00 # walltime
#SBATCH --output=r_job.out
#SBATCH --error=error.err
module load R
module load openmpi
mpirun R CMD BATCH script.R
File script.R
# Load library ---------------------------------------------------
library(doMPI)
library(caret)
library(dplyr)
# Create parallel backend ----------------------------------------
# Create repository for mpi logs
dir.create("log", showWarnings = FALSE)
# Create cluster
cl <- startMPIcluster(verbose = TRUE, logdir = "log")
registerDoMPI(cl)
nbCore <- clusterSize(cl)
print(nbCore)
# Load data -------------------------------------------------------
data("airquality")
data <- airquality %>% na.omit()
# Train model -----------------------------------------------------
model <- train(Temp ~ ., data = data, method = "lm")
# Stop parallel backend -------------------------------------------
stopCluster(cl)
mpi.quit()
Sofwares versions
Currently Loaded Modulefiles:
1) hwloc/1.11.2 3) R/3.5.2
2) openmpi/psm2/gcc49/2.0.1
> packageVersion('caret')
[1] 6.0.81
> packageVersion('doMPI')
[1] 0.2.2
> packageVersion('Rmpi')
[1] 0.6.6
> packageVersion('foreach')
[1] 1.4.4
Output
error.err
nothing
r_job.out
-------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:
Process name: [[39630,1],0]
Exit code: 1
--------------------------------------------------------------------------
script.Rout
R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> # Load library ---------------------------------------------------
> library(doMPI)
Loading required package: foreach
Loading required package: iterators
Loading required package: Rmpi
> library(caret)
Loading required package: lattice
Loading required package: ggplot2
> library(dplyr)
Attaching package: \u2018dplyr\u2019
The following objects are masked from \u2018package:stats\u2019:
filter, lag
The following objects are masked from \u2018package:base\u2019:
intersect, setdiff, setequal, union
>
> # Create parallel backend ----------------------------------------
> # Create repository for mpi logs
> dir.create("log", showWarnings = FALSE)
> # Create cluster
> cl <- startMPIcluster(verbose = TRUE, logdir = "log")
> registerDoMPI(cl)
> nbCore <- clusterSize(cl)
> print(nbCore)
[1] 19
>
> # Load data -------------------------------------------------------
> data("airquality")
> data <- airquality %>% na.omit()
>
> # Train model -----------------------------------------------------
> model <- train(Temp ~ ., data = data, method = "lm")
Error in { :
task 1 failed - "object 'requireNamespaceQuietStop' not found"
Calls: train ... train.default -> nominalTrainWorkflow -> %op% -> <Anonymous>
Execution halted
Thanks in advance for any help !