Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

wrong args for environment subassignment

Đang mở
#285 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
r
Lĩnh vực
backend, hpc

Hướng nghiên cứu

Start with the _targets.R example, process_chunks(), and the MulticoreParam/bplapply() call, then run tar_make() under the shown memory limits. Trace how the failure is reported after the parallel workers exit; done means the OOM case produces a meaningful memory-related error instead of wrong args for environment subassignment.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

I had the following error when trying to use MulticoreParam with R targets pipeline. Debugging doesn't reproduce the error. I later figured out it was OOM as it needed more than 2GB to process the data on HPC, while my local R session used to debug had more than 20GB memory allocations.

It would be ideal the print the more meaningful error message.

# _targets.R
library(targets)
library(crew)
library(crew.cluster)
library(BiocParallel)

controller_default <- crew_controller_slurm(
  name                           = "slurm_default",
  workers                        = 4,
  seconds_idle                   = 30,
  slurm_memory_gigabytes_per_cpu = 2,
  slurm_cpus_per_task            = 4
)

tar_option_set(
  controller = controller_default,
  resources  = tar_resources(
    crew = tar_resources_crew(controller = "slurm_default")
  )
)

process_chunks <- function() {
  
  cores <- as.numeric(Sys.getenv("SLURM_CPUS_PER_TASK", unset = 1)) - 1L
  if (nzchar(Sys.getenv("_R_CHECK_LIMIT_CORES_")))
    cores <- min(cores, 2L)
  
  bp <- MulticoreParam(workers = cores, progressbar = TRUE)
  
  bplapply(
    seq_len(cores + 1L),   
    FUN = function(i) {
      message(sprintf("[bpworker PID %d] task %d: allocating ~4 GB",
                      Sys.getpid(), i))
      n <- as.integer(2000 * 1024^2 / 8)   
      x <- rnorm(n)                         
      y <- rnorm(n)                          
      sum(x * y)
    },
    BPPARAM = bp
  )
}

# ── pipeline ──────────────────────────────────────────────────────────────────
list(
  tar_target(
    oom_bp,
    process_chunks()   # crew worker (2 GB) + forked bplapply children → OOM
  )
)

> library(targets)
> tar_make(store = "~", script = "~/_targets.R")
+ oom_bp dispatched                                         
✖ oom_bp errored                                             
✖ errored pipeline [50.9s, 0 completed, 0 skipped]           
Warning messages:
1: script_lines was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument. 
2: slurm_memory_gigabytes_per_cpu was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument. 
3: slurm_cpus_per_task was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument. 
4: 1 targets produced warnings. Run targets::tar_meta(fields = warnings, complete_only = TRUE) for the messages. 
Error:
! Error in tar_make():
  wrong args for environment subassignment
  See https://books.ropensci.org/targets/debugging.html

Debug:

> tar_workspace(oom_bp, store = "~", script = "~/_targets.R")
Warning messages:
1: In readLines(script) : incomplete final line found on '~/_targets.R'
2: slurm_memory_gigabytes_per_cpu was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument. 
3: slurm_cpus_per_task was deprecated on 2024-10-09 (version 0.3.2.9005). Alternative: options_cluster argument. 

> process_chunks()
  |                                                                                                                               |   0%
[bpworker PID 1690242] task 4: allocating ~4 GB
  |================                                                                                                               |  12%
[bpworker PID 1690239] task 1: allocating ~4 GB
  |================================                                                                                               |  25%
[bpworker PID 1690240] task 2: allocating ~4 GB
  |================================================                                                                               |  38%
[bpworker PID 1690245] task 7: allocating ~4 GB
  |================================================================                                                               |  50%
[bpworker PID 1690241] task 3: allocating ~4 GB
  |===============================================================================                                                |  62%
[bpworker PID 1690244] task 6: allocating ~4 GB
  |===============================================================================================                                |  75%
[bpworker PID 1690243] task 5: allocating ~4 GB
  |===============================================================================================================                |  88%
[bpworker PID 1690270] task 8: allocating ~4 GB
  |===============================================================================================================================| 100%

[[1]]
[1] 4439.251

[[2]]
[1] 14078.1

[[3]]
[1] -2978.421

[[4]]
[1] -35503.84

[[5]]
[1] -7880.825

[[6]]
[1] -3674.885

[[7]]
[1] 9433.41

[[8]]
[1] -9041.888
Ngôn ngữ chính
R
Star
69
Fork
32
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Bioconductor/BiocParallel

Tất cả issue của Bioconductor/BiocParallel

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.