Skip to content

Commit 046d18d

Browse files
R (>= 4.2.0) defaults on user = NULL
1 parent 3f147e2 commit 046d18d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: parallelly
2-
Version: 1.45.1-9006
2+
Version: 1.45.1-9007
33
Title: Enhancing the 'parallel' Package
44
Imports:
55
parallel,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The **parallelly** package provides functions that enhance the **parallel** pack
1515
| ---------------------------------- | :-------------: | :--------: |
1616
| remote clusters without knowing local public IP || N/A |
1717
| remote clusters without firewall configuration || N/A |
18-
| remote username in ~/.ssh/config || R (>= 4.1.0) with `user = NULL` |
18+
| remote username in ~/.ssh/config || R (>= 4.2.0) |
1919
| set workers' library package path on startup || N/A |
2020
| set workers' environment variables on startup || N/A |
2121
| custom workers startup code || N/A |
@@ -65,7 +65,7 @@ Did you know that `parallel::detectCores()` might return NA on some systems, or
6565
Just like other software tools that "hijacks" all cores by default, R scripts, and packages that defaults to `detectCores()` number of parallel workers cause lots of suffering for fellow end-users and system administrators. For instance, a shared server with 48 cores will come to a halt already after a few users run parallel processing using `detectCores()` number of parallel workers. This problem gets worse on machines with many cores because they can host even more concurrent users. If these R users would have used `availableCores()` instead, then the system administrator can limit the number of cores each user get to, say, two (2), by setting the environment variable `R_PARALLELLY_AVAILABLECORES_FALLBACK=2`.
6666
In contrast, it is _not_ possible to override what `parallel::detectCores()` returns, cf. [PR#17641 - WISH: Make parallel::detectCores() agile to new env var R_DEFAULT_CORES ](https://bugs.r-project.org/show_bug.cgi?id=17641).
6767

68-
Similarly, `availableCores()` is also agile to CPU limitations set by Unix control groups (cgroups), which is often used by Linux containers (e.g. Docker, Apptainer / Singularity, and Podman) and Kubernetes (K8s) environments. For example, `docker run --cpuset-cpus=0-2,8 ...` sets the CPU affinity so that the processes can only run on CPUs 0, 1, 2, and 8 on the host system. In this case `availableCores()` detects this and returns four (4). Another example is `docker run --cpu=3.4 ...`, which throttles the CPU quota to on average 3.4 CPUs on the host system. In this case `availableCores()` detects this and returns three (3), because it rounds to the nearest integer. In contrast, `parallel::detectCores()` completely ignores such cgroups settings and returns the number of CPUs on the host system, which results in CPU overuse and degredated performance. Continous Integration (CI) services (e.g. GitHub Actions, Travis CI, and Appveyor CI) and cloud services (e.g. RStudio Cloud) use these types of cgroups settings under the hood, which means `availableCores()` respects their CPU allocations.
68+
Similarly, `availableCores()` is also agile to CPU limitations set by Unix control groups (cgroups), which is often used by Linux containers (e.g. Docker, Apptainer / Singularity, and Podman) and Kubernetes (K8s) environments. For example, `docker run --cpuset-cpus=0-2,8 ...` sets the CPU affinity so that the processes can only run on CPUs 0, 1, 2, and 8 on the host system. In this case `availableCores()` detects this and returns four (4). Another example is `docker run --cpu=3.4 ...`, which throttles the CPU quota to on average 3.4 CPUs on the host system. In this case `availableCores()` detects this and returns three (3), because it rounds to the nearest integer. In contrast, `parallel::detectCores()` completely ignores such cgroups settings and returns the number of CPUs on the host system, which results in CPU overuse and degraded performance. Continuous Integration (CI) services (e.g. GitHub Actions, Travis CI, and AppVeyor CI) and cloud services (e.g. RStudio Cloud) use these types of cgroups settings under the hood, which means `availableCores()` respects their CPU allocations.
6969

7070
If running on an HPC cluster with a job scheduler, a script that uses `availableCores()` will run the number of parallel workers that the job scheduler has assigned to the job. For example, if we submit a Slurm job as `sbatch --cpus-per-task=16 ...`, then `availableCores()` returns 16, because it respects the `SLURM_*` environment variables set by the scheduler. On Son of Grid Engine (SGE), the scheduler sets `NSLOTS` when submitting using `qsub -pe smp 8 ...` and `availableCores()` returns eight (8). See `help("availableCores", package = "parallelly")` for currently supported job schedulers, which includes 'Fujitsu Technical Computing Suite', 'Load Sharing Facility' (LSF), Simple Linux Utility for Resource Management (Slurm), Sun Grid Engine/Oracle Grid Engine/Son of Grid Engine (SGE), Univa Grid Engine (UGE), and TORQUE/PBS.
7171

incl/OVERVIEW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The **parallelly** package provides functions that enhance the **parallel** pack
77
| ---------------------------------- | :-------------: | :--------: |
88
| remote clusters without knowing local public IP || N/A |
99
| remote clusters without firewall configuration || N/A |
10-
| remote username in ~/.ssh/config || R (>= 4.1.0) with `user = NULL` |
10+
| remote username in ~/.ssh/config || R (>= 4.2.0) |
1111
| set workers' library package path on startup || N/A |
1212
| set workers' environment variables on startup || N/A |
1313
| custom workers startup code || N/A |

vignettes/parallelly-01-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The **parallelly** package provides functions that enhance the **parallel** pack
1818
| ---------------------------------- | :-------------: | :--------: |
1919
| remote clusters without knowing local public IP || N/A |
2020
| remote clusters without firewall configuration || N/A |
21-
| remote username in ~/.ssh/config || R (>= 4.1.0) with `user = NULL` |
21+
| remote username in ~/.ssh/config || R (>= 4.2.0) |
2222
| set workers' library package path on startup || N/A |
2323
| set workers' environment variables on startup || N/A |
2424
| custom workers startup code || N/A |

0 commit comments

Comments
 (0)