Skip to contents

Spawns n detached containers from image, each bind-mounting scratch_root to /scratch inside. Each container runs a sleep-based busy loop that responds to docker stop by exiting cleanly. The intended workflow is to dispatch many landis_pool_exec() calls to the pool, then call landis_pool_stop() to tear it down – typically via on.exit() in the calling driver.

Usage

landis_pool_start(
  n,
  image = NULL,
  scratch_root,
  cpu_limit = 4,
  mem_limit = "8g",
  pull = FALSE,
  name_prefix = NULL
)

Arguments

n

Integer. Number of pool containers to start. Typically the number of parallel DEoptim workers.

image

Character or NULL. Docker image reference. NULL = getOption("landisutils.docker.image").

scratch_root

Character. Host directory bind-mounted to /scratch inside every container. Must be a stable absolute path. All per-trial directories used by landis_pool_exec() must be SUBDIRECTORIES of this.

cpu_limit

Numeric or NULL. Per-container --cpus cap. Default 4.

mem_limit

Character or NULL. Per-container --memory cap. Default "8g".

pull

Logical. When TRUE, docker pull the image before starting.

name_prefix

Character or NULL. Optional prefix for the container name; the rest is auto-generated to avoid collisions across concurrent pools.

Value

A list with names (container names), image, scratch_root, n, started_at, and digest (image RepoDigest if available).