From daeaf30a8345ac020d047d0e40e83a2710efcb83 Mon Sep 17 00:00:00 2001 From: nperez Date: Mon, 5 Aug 2019 14:38:45 +0200 Subject: [PATCH] CDO module option in Compute --- DESCRIPTION | 12 ++++++++++-- R/ByChunks.R | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index aa75822..4b74cad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: startR -Title: Automatically Retrieve Multidimensional Distributed Data Sets +Title: Automatically Retrieve Multidimensional Distributed Data Sets Version: 0.1.3 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), @@ -8,7 +8,15 @@ Authors@R: c( person("Javier", "Vegas", , "javier.vegas@bsc.es", role = c("ctb")), person("Pierre-Antoine", "Bretonniere", , "pierre-antoine.bretonniere@bsc.es", role = c("ctb")), person("Roberto", "Serrano", , "rsnotivoli@gmal.com", role = c("ctb"))) -Description: Tool to automatically fetch, transform and arrange subsets of multidimensional data sets (collections of files) stored in local and/or remote file systems or servers, using multicore capabilities where possible. The tool provides an interface to perceive a collection of data sets as a single large multidimensional data array, and enables the user to request for automatic retrieval, processing and arrangement of subsets of the large array. Wrapper functions to add support for custom file formats can be plugged in/out, making the tool suitable for any research field where large multidimensional data sets are involved. +Description: Tool to automatically fetch, transform and arrange subsets of + multidimensional data sets (collections of files) stored in local and/or remote + file systems or servers, using multicore capabilities where possible. The tool + provides an interface to perceive a collection of data sets as a single large + multidimensional data array, and enables the user to request for automatic + retrieval, processing and arrangement of subsets of the large array. Wrapper + functions to add support for custom file formats can be plugged in/out, making + the tool suitable for any research field where large multidimensional data sets + are involved. Depends: R (>= 3.2.0) Imports: diff --git a/R/ByChunks.R b/R/ByChunks.R index 3959edb..8c293b9 100644 --- a/R/ByChunks.R +++ b/R/ByChunks.R @@ -81,6 +81,7 @@ ByChunks <- function(step_fun, cube_headers, ..., chunks = 'auto', lib_dir = NULL, init_commands = list(''), r_module = 'R', + CDO_module = NULL, ecflow_module = 'ecFlow', node_memory = NULL, cores_per_job = NULL, @@ -99,7 +100,8 @@ ByChunks <- function(step_fun, cube_headers, ..., chunks = 'auto', } if (any(!(names(cluster) %in% c('queue_host', 'queue_type', 'data_dir', 'temp_dir', 'lib_dir', 'init_commands', - 'r_module', 'ecflow_module', 'node_memory', + 'r_module', 'CDO_module', + 'ecflow_module', 'node_memory', 'cores_per_job', 'job_wallclock', 'max_jobs', 'extra_queue_params', 'bidirectional', 'polling_period', 'special_setup')))) { @@ -165,9 +167,19 @@ ByChunks <- function(step_fun, cube_headers, ..., chunks = 'auto', stop("The component 'r_module' of the parameter 'cluster' must be a character string.") } if ((nchar(cluster[['r_module']]) < 1) || (grepl(' ', cluster[['r_module']]))) { - stop("The component 'r_module' of the parameter 'cluster' must have at least one character ", + stop("The component 'r_module' of the parameter 'cluster' must have at least one character ", "and contain no blank spaces.") } + if (!is.null(cluster[['CDO_module']])) { + if (!is.character(cluster[['CDO_module']])) { + stop("The component 'CDO_module' of the parameter 'cluster' must be a character string.") + } + if (nchar(cluster[['CDO_module']]) < 1 || grepl(' ', cluster[['CDO_module']])) { + warning("The component 'CDO_module' of parameter 'cluster' must have ", + " than 1 and only the first element will be used.") + } + cluster[['r_module']] <- paste(cluster[['r_module']], cluster[['CDO_module']]) + } if (!is.character(cluster[['ecflow_module']])) { stop("The component 'ecflow_module' of the parameter 'cluster' must be a character string.") } -- GitLab