Skip to content

Commit 4c513ca

Browse files
Updated 'gh-pages' from docs/ folder
1 parent 41440c2 commit 4c513ca

73 files changed

Lines changed: 4327 additions & 244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

404.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Content not found. Please use links in the navbar.
2+
3+
# Page not found (404)

CONDUCT.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONDUCT.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our
7+
project and our community a harassment-free experience for everyone,
8+
regardless of age, body size, disability, ethnicity, gender identity and
9+
expression, level of experience, nationality, personal appearance, race,
10+
religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual
26+
attention or advances
27+
- Trolling, insulting/derogatory comments, and personal or political
28+
attacks
29+
- Public or private harassment
30+
- Publishing others’ private information, such as a physical or
31+
electronic address, without explicit permission
32+
- Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of
38+
acceptable behavior and are expected to take appropriate and fair
39+
corrective action in response to any instances of unacceptable behavior.
40+
41+
Project maintainers have the right and responsibility to remove, edit,
42+
or reject comments, commits, code, wiki edits, issues, and other
43+
contributions that are not aligned to this Code of Conduct, or to ban
44+
temporarily or permanently any contributor for other behaviors that they
45+
deem inappropriate, threatening, offensive, or harmful.
46+
47+
## Scope
48+
49+
This Code of Conduct applies both within project spaces and in public
50+
spaces when an individual is representing the project or its community.
51+
Examples of representing a project or community include using an
52+
official project e-mail address, posting via an official social media
53+
account, or acting as an appointed representative at an online or
54+
offline event. Representation of a project may be further defined and
55+
clarified by project maintainers.
56+
57+
## Enforcement
58+
59+
Instances of abusive, harassing, or otherwise unacceptable behavior may
60+
be reported by contacting the project team. All complaints will be
61+
reviewed and investigated and will result in a response that is deemed
62+
necessary and appropriate to the circumstances. The project team is
63+
obligated to maintain confidentiality with regard to the reporter of an
64+
incident. Further details of specific enforcement policies may be posted
65+
separately.
66+
67+
Project maintainers who do not follow or enforce the Code of Conduct in
68+
good faith may face temporary or permanent repercussions as determined
69+
by other members of the project’s leadership.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor
74+
Covenant](http://contributor-covenant.org), version 1.4, available at
75+
[http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/)

CONTRIBUTING.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributing to the ‘future.batchtools’ package
2+
3+
This Git repository uses the [Git
4+
Flow](https://nvie.com/posts/a-successful-git-branching-model/)
5+
branching model (the
6+
[`git flow`](https://github.com/petervanderdoes/gitflow-avh) extension
7+
is useful for this). The
8+
[`develop`](https://github.com/futureverse/future.batchtools/tree/develop)
9+
branch contains the latest contributions and other code that will appear
10+
in the next release, and the
11+
[`master`](https://github.com/futureverse/future.batchtools) branch
12+
contains the code of the latest release, which is exactly what is
13+
currently on
14+
[CRAN](https://cran.r-project.org/package=future.batchtools).
15+
16+
Contributing to this package is easy. Just send a [pull
17+
request](https://help.github.com/articles/using-pull-requests/). When
18+
you send your PR, make sure `develop` is the destination branch on the
19+
[future.batchtools
20+
repository](https://github.com/futureverse/future.batchtools). Your PR
21+
should pass `R CMD check --as-cran`, which will also be checked by
22+
[GitHub
23+
Actions](https://github.com/futureverse/future.batchtools/actions?query=workflow%3AR-CMD-check)
24+
and when the PR is submitted.
25+
26+
We abide to the [Code of
27+
Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/)
28+
of Contributor Covenant.

OVERVIEW.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OVERVIEW.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# NA
2+
3+
\<% \## Reuse the future vignette md \<-
4+
R.rsp::rstring(file=“vignettes/future.batchtools.md.rsp”,
5+
postprocess=FALSE)
6+
7+
## Drop the header, i.e. anything before the first “H2” header
8+
9+
md \<- unlist(strsplit(md, split=“”, fixed=TRUE)) row \<- grep(“^##”,
10+
md)\[1\] if (!is.na(row)) md \<- md\[-seq_len(row-1)\]
11+
12+
## Drop the footer, i.e. anything after the first horizontal line
13+
14+
row \<- grep(“^—”, md)\[1\] if (!is.na(row)) md \<- md\[seq_len(row-1)\]
15+
16+
## Output
17+
18+
cat(md, sep=“”) %\>

articles/future.batchtools.html

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/future.batchtools.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# A Future for batchtools
2+
3+
## TL;DR
4+
5+
Here is an example on how to evaluate R expressions on a Slurm
6+
high-performance compute (HPC) cluster from within R.
7+
8+
``` r
9+
10+
library(future)
11+
12+
# Limit runtime to 10 minutes and memory to 400 MiB per future,
13+
# request a parallel environment with four slots on a single host.
14+
# On this system, R is available via environment module 'r'. By
15+
# specifying 'r/4.5.1', 'module load r/4.5.1' will be added to
16+
# the submitted job script.
17+
plan(future.batchtools::batchtools_slurm, resources = list(
18+
time = "00:10:00", mem = "400M", nodes = 1, ntasks = 4,
19+
modules = c("r/4.5.1")
20+
))
21+
22+
# Give it a spin
23+
f <- future({
24+
data.frame(
25+
hostname = Sys.info()[["nodename"]],
26+
os = Sys.info()[["sysname"]],
27+
cores = unname(parallelly::availableCores()),
28+
modules = Sys.getenv("LOADEDMODULES")
29+
)
30+
})
31+
info <- value(f)
32+
print(info)
33+
#> hostname os cores modules
34+
#> 1 n12 Linux 4 r/4.5.1
35+
```
36+
37+
## Introduction
38+
39+
The **[future](https://cran.r-project.org/package=future)** package
40+
provides a generic API for using futures in R. A future is a simple yet
41+
powerful mechanism to evaluate an R expression and retrieve its value at
42+
some point in time. Futures can be resolved in many different ways
43+
depending on which strategy is used. There are various types of
44+
synchronous and asynchronous futures to choose from in the
45+
**[future](https://cran.r-project.org/package=future)** package.
46+
47+
This package,
48+
**[future.batchtools](https://cran.r-project.org/package=future.batchtools)**,
49+
provides a type of futures that utilizes the
50+
**[batchtools](https://cran.r-project.org/package=batchtools)** package.
51+
This means that *any* type of backend that the **batchtools** package
52+
supports can be used as a future. More specifically,
53+
**future.batchtools** will allow you or users of your package to
54+
leverage the compute power of high-performance computing (HPC) clusters
55+
via a simple switch in settings - without having to change any code at
56+
all.
57+
58+
For instance, the below two future R expressions will be processed by
59+
parallel R workers that launched on different compute nodes by the
60+
specified job scheduler:
61+
62+
``` r
63+
64+
library(future)
65+
plan(future.batchtools::batchtools_slurm)
66+
67+
f_x <- future({ Sys.sleep(5); 3.14 })
68+
f_y <- future({ Sys.sleep(5); 2.71 })
69+
x <- value(f_x)
70+
y <- value(f_y)
71+
x + y
72+
#> [1] 5.85
73+
```
74+
75+
This is just a toy example to illustrate what futures look like and how
76+
to work with them.
77+
78+
For an introduction as well as full details on how to use futures,
79+
please see <https://www.futureverse.org> or consult the package
80+
vignettes of the **[future](https://cran.r-project.org/package=future)**
81+
package.
82+
83+
## Demos
84+
85+
The **[future](https://cran.r-project.org/package=future)** package
86+
provides a demo using futures for calculating a set of Mandelbrot
87+
planes. The demo does not assume anything about what type of futures are
88+
used. *The user has full control of how futures are evaluated*. For
89+
instance, to use local batchtools futures, run the demo as:
90+
91+
``` r
92+
93+
library(future)
94+
plan(future.batchtools::batchtools_local)
95+
demo("mandelbrot", package = "future", ask = FALSE)
96+
```
97+
98+
## Available batchtools backend
99+
100+
The **future.batchtools** package implements a generic future wrapper
101+
for all batchtools backends. Below are the most common types of
102+
batchtools backends. For other types of parallel and distributed
103+
backends, please see <https://www.futureverse.org/backends.html>.
104+
105+
| Backend | Description | Alternative in future package |
106+
|:---|:---|:---|
107+
| `batchtools_lsf` | Futures are evaluated via a [Load Sharing Facility (LSF)](https://en.wikipedia.org/wiki/Platform_LSF) job scheduler | N/A |
108+
| `batchtools_openlava` | Futures are evaluated via an [OpenLava](https://en.wikipedia.org/wiki/OpenLava) job scheduler | N/A |
109+
| `batchtools_sge` | Futures are evaluated via a [Sun/Son of/Oracle/Univa/Altair Grid Engine (SGE)](https://en.wikipedia.org/wiki/Oracle_Grid_Engine) job scheduler | N/A |
110+
| `batchtools_slurm` | Futures are evaluated via a [Slurm](https://en.wikipedia.org/wiki/Slurm_Workload_Manager) job scheduler | N/A |
111+
| `batchtools_torque` | Futures are evaluated via a [TORQUE](https://en.wikipedia.org/wiki/TORQUE) / PBS job scheduler | N/A |
112+
| `batchtools_custom` | Futures are evaluated via a custom batchtools configuration R script or via a set of cluster functions | N/A |
113+
| `batchtools_multicore` | parallel evaluation by forking the current R process | `plan(multicore)` |
114+
| `batchtools_local` | sequential evaluation in a separate R process (on current machine) | `plan(cluster, workers = I(1))` |

0 commit comments

Comments
 (0)