Hi @aho
I am almost sure I have found and solved the problem of the file names when chunking on a remote cluster.
The function rle() used before removes duplicated values causing the problem with chunk 11.
Could you take a look and check if you want to improve it? Below I share how I have tested. I'll try to test it on Nord3v2 now
# inputs:
out_dir <- "/gpfs/scratch/bsc32/bsc32339/startR_hpc//STARTR_CHUNKING_6838098107/"
task_path <- "/gpfs/scratch/bsc32/bsc32339/startR_hpc//STARTR_CHUNKING_6838098107///STARTR_CHUNKING_6838098107/computation/lon_CHUNK_1/lat_CHUNK_1/month_CHUNK_1/var_CHUNK_1/dat_CHUNK_1/Chunk"
# code in load_chunks_...R
nameMemoryObject <- gsub("[^0-9.-]", "_", gsub(out_dir, "", task_path))
nameMemoryObject <- substr(nameMemoryObject, 2, nchar(nameMemoryObject))
removeRS <- function(str) {
vec <- strsplit(str, "")[[1]]
res <- vec[1]
for (i in 2:length(vec)) {
if (!is.na(as.numeric(vec[i]))) {
res <- c(res, vec[i])
} else if (res[length(res)] != vec[i]) {
res <- c(res, vec[i])
}
}
return(paste(res, collapse = ""))
}
nameMemoryObject <- removeRS(nameMemoryObject)
#result:
nameMemoryObject
Cheers,
Núria