Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • startR startR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • startRstartR
  • Merge requests
  • !167

fix function creating shared object names

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Nuria Pérez-Zanón requested to merge develop-chunkSharedObj into master Jan 17, 2022
  • Overview 3
  • Commits 2
  • Pipelines 2
  • Changes 1

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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop-chunkSharedObj