wrong args for environment subassignment
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 50/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- R
- Sterne
- 69
- Forks
- 32
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Bioconductor/BiocParallel
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
Bioconductor/BiocParallel#286 · 1 Kommentar ·
-
futile.logger may be archived from CRANEvtl. wieder frei @Jiefei-Wang hat das vor 272 Tagen übernommen, und es ist kein Pull Request offen. Offen
Bioconductor/BiocParallel#284 · 2 Kommentare · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
Bioconductor/BiocParallel#283 · 2 Kommentare ·
-
DoparParam: Captured stdout is relayed to stdout for some foreach adapters and stderr for othersOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Bioconductor/BiocParallel#277 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
Bioconductor/BiocParallel#276 ·
Alle Issues in Bioconductor/BiocParallel
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
OHDSI/CohortSymmetry#369 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#330 ·
-
core
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
insightsengineering/teal#1747 ·