futureverse / futureverse/parallelly

HELP WANTED: availableWorkers()

Open
#16 1 comment 0 reactions 0 assignees View on GitHub
enhancement feature/resources help wanted
Dominant language
R
Stars
140
Forks
9
PR merge metrics
No merged PRs in 30d

Description

# Background
When submitting a job to the TORQUE / PBS using something like:
```sh
qsub -l nodes=3:ppn=2 myjob.sh
```
the scheduler will allocate 3 nodes with 2 cores each (= 6 cores total) for `myjob.sh` when launched. Exactly which 3 nodes is only known to `myjob.sh` at run time. This information is available in a file `$PBS_NODEFILE` written by TORQUE / PBS, e.g.
```sh
$ cat $PBS_NODEFILE
n1
n1
n8
n8
n9
n9
```
Other HPC job schedulers use other files / environment variables for this.

# Actions
Add an `availableNodes()` file that searches for common environment variables and returns a vector of node names, e.g.
```r
> availableNodes()`
[1] "n1" "n1" "n8" "n8" "n9" "n9"
```
If no known environment variables are found, the default fallback could be to return `rep("localhost", times = availableCores()`.

The above would allow us to make `workers = availableNodes()` the new default for `cluster` futures (currently `workers = availableCores()`).

Identify these settings for the following schedulers:
- [x] [PBS](https://en.wikipedia.org/wiki/Portable_Batch_System) (Portable Batch System): Environment variable `PBS_NODEFILE` (the name of a file containing one node per line where each node is repeated "ppn" times).
- [x] [Oracle Grid Engine](https://en.wikipedia.org/wiki/Oracle_Grid_Engine) (aka Sun Grid Engine, CODINE, GRD). Environment variable `PE_HOSTFILE` (a file, format unclear), cf. https://www.ace-net.ca/wiki/Sun_Grid_Engine
- [x] [Slurm](https://en.wikipedia.org/wiki/Slurm_Workload_Manager) (Simple Linux Utility for Resource Management). Environment variable `SLURM_JOB_NODELIST` (list of nodes in a compressed format, e.g. instead of "tux1,tux3,tux4" it is stored as "tux[1,3-4]". Note that multiple "compressions" may exist, e.g. ["compute-[0-6]-[0-15]"](https://groups.google.com/forum/#!topic/slurm-devel/n6x2WgGmDls). The _number_ of nodes is can be verified by `SLURM_JOB_NUM_NODES`. The "ppn" information is in stored in `SLURM_TASKS_PER_NODE`).
- [x] LSF/[OpenLava](https://en.wikipedia.org/wiki/OpenLava) (Platform Load Sharing Facility).
- [x] `LSB_HOSTS`
- [ ] [Spark](https://spark.apache.org/)
- [ ] [OAR](http://oar.imag.fr)
- [ ] [HTCondor](https://en.wikipedia.org/wiki/HTCondor)
- [ ] [Moab](https://en.wikipedia.org/wiki/Moab_Cluster_Suite)
- [x] PJM (https://staff.cs.manchester.ac.uk/~fumie/internal/Job_Operation_Software_en.pdf)
- [x] `PJM_O_NODEINF` - "Path of the allocated node list file. For a job to which virtual nodes are allocated, the IP addresses of the nodes where the virtual nodes are placed are written one per line."

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.