tests/hpc/test-crew_sge.R

test_that("crew SGE with many tasks and many workers", {
  skip_on_cran()
  skip_if_not_installed("crew.cluster")
  tar_script({
    library(targets)
    controller <- crew.cluster::crew_controller_sge(
      workers = 25,
      tasks_max = 100,
      options_cluster = crew.cluster::crew_options_sge(
        script_lines = paste0("module load R/", getRversion())
      )
    )
    tar_option_set(controller = crew::crew_controller_group(controller))
    list(
      tar_target(x, seq_len(10000), deployment = "main"),
      tar_target(y, Sys.sleep(0.1), pattern = map(x))
    )
  })
  tar_make()
  expect_equal(tar_outdated(), character(0))
})

Try the targets package in your browser

Any scripts or data that you put into this service are public.

targets documentation built on Sept. 13, 2025, 9:08 a.m.