Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .bumpversion.cfg

This file was deleted.

28 changes: 28 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[tool.bumpversion]
current_version = "0.7.1"

[[tool.bumpversion.files]]
filename = "Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = ".github/ISSUE_TEMPLATE/bug_report.yml"
search = """
description: What version of **row** are you using?
placeholder: {current_version}"""

replace = """
description: What version of **row** are you using?
placeholder: {new_version}"""

[[tool.bumpversion.files]]
filename = ".github/ISSUE_TEMPLATE/release.md"
search = "Release {current_version}"
replace = "Release {new_version}"

[[tool.bumpversion.files]]
filename = "doc/src/release-notes.md"
regex = true
search = 'Next release$'
replace = '{new_version} ({now:%Y-%m-%d})'
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ assignees: 'joaander'
---

- [ ] Run `prek autoupdate`.
- [ ] Run *bumpversion*.
- [ ] Run *bump-my-version*.
- [ ] Run `cargo check`
- [ ] Run `cargo update`
- [ ] Run `cargo bundle-licenses --format yaml --output THIRDPARTY.yaml`
- [ ] Check for new or duplicate contributors since the last release:
`comm -13 (git log $(git describe --tags --abbrev=0) --format="%aN <%aE>" | sort | uniq | psub) (git log --format="%aN <%aE>" | sort | uniq | psub)`.
Add entries to `.mailmap` to remove duplicates.
- [ ] Add release date and highlights to release notes.
- [ ] Add highlights to release notes.
- [ ] Check readthedocs build, especially release notes formatting.
- [ ] Tag and push.
- [ ] Update conda-forge recipe.
30 changes: 24 additions & 6 deletions doc/src/launchers/built-in.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# Built-in launchers

**Row** includes built-in support for OpenMP and MPI via the launchers `"openmp"`
and `"mpi"`. These have been tested on the [built-in clusters](../clusters/built-in.md).
You may need to add new configurations for your specific cluster or adjust the `none`
launcher to match your system. Execute [`row show launchers`](../row/show/launchers.md)
to see the current launcher configuration.
**Row** includes built-in support for MPI, OpenMP, and Rayon via the launchers
`"mpi"`, `"openmp"`, and `"rayon"`. These have been tested on the [built-in
clusters](../clusters/built-in.md). You may need to add new configurations
for your specific cluster or adjust the `none` launcher to match your system.
Execute [`row show launchers`](../row/show/launchers.md) to see the current
launcher configuration.

## OpenMP

Set `launchers = ["openmp"]` to prefix the action's command with:
```bash
OMP_NUM_THREADS={T}
```
where `{T}` is the number of `threads_per_process` requested.

## Rayon

Set `launchers = ["rayon"]` to prefix the action's command with:
```bash
RAYON_NUM_THREADS={T}
```
where `{T}` is the number of `threads_per_process` requested.


## Hybrid OpenMP/MPI

When using OpenMP/MPI hybrid applications, place `"openmp"` first in the list of
launchers (`launchers = ["openmp", "mpi"]`) to generate the appropriate command:
```bash
OMP_NUM_THREADS=T srun --ntasks=N --cpus-per-task=T command $directory
OMP_NUM_THREADS={T} srun --ntasks=N --cpus-per-task=T command $directory
```
6 changes: 5 additions & 1 deletion doc/src/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Release notes

## 0.7.1 (2025-11-09)
## Next release

*Added:*

* Rayon launcher that prefixes commands with `RAYON_NUM_THREADS={T}`.

*Fixed:*

Expand Down
11 changes: 11 additions & 0 deletions src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ impl BuiltIn for launcher::Configuration {

result.launchers.insert("openmp".into(), openmp);

let mut rayon = HashMap::with_capacity(1);
rayon.insert(
"default".into(),
Launcher {
threads_per_process: Some("RAYON_NUM_THREADS=".into()),
..Launcher::default()
},
);

result.launchers.insert("rayon".into(), rayon);

let mut mpi = HashMap::with_capacity(3);
mpi.insert(
"default".into(),
Expand Down
23 changes: 22 additions & 1 deletion src/launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,26 @@ mod tests {
assert_eq!(openmp.prefix(&threads, 1), "OMP_NUM_THREADS=5 ");
}

#[test]
#[parallel]
fn rayon_prefix() {
setup();
let launchers = Configuration::built_in();
let launchers_by_cluster = launchers.by_cluster("any_cluster");
let rayon = launchers_by_cluster.get("rayon").expect("a valid Launcher");

let no_threads = Resources::default();
assert_eq!(rayon.prefix(&no_threads, 10), "");
assert_eq!(rayon.prefix(&no_threads, 1), "");

let threads = Resources {
threads_per_process: Some(5),
..Resources::default()
};
assert_eq!(rayon.prefix(&threads, 10), "RAYON_NUM_THREADS=5 ");
assert_eq!(rayon.prefix(&threads, 1), "RAYON_NUM_THREADS=5 ");
}

#[test]
#[parallel]
fn mpi_prefix_none() {
Expand Down Expand Up @@ -375,9 +395,10 @@ executable = "e"
let launchers = Configuration::open_from_path(temp.path().into()).expect("valid launcher");

let built_in = Configuration::built_in();
assert_eq!(launchers.launchers.len(), 3);
assert_eq!(launchers.launchers.len(), 4);
assert_eq!(launchers.launchers["openmp"], built_in.launchers["openmp"]);
assert_eq!(launchers.launchers["mpi"], built_in.launchers["mpi"]);
assert_eq!(launchers.launchers["rayon"], built_in.launchers["rayon"]);

let launchers_by_cluster = launchers.by_cluster("non_default");
let non_default = launchers_by_cluster.get("new_launcher").unwrap();
Expand Down
23 changes: 23 additions & 0 deletions src/scheduler/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,29 @@ mod tests {
assert!(script.contains("OMP_NUM_THREADS=4 command \"${directories[@]}\""));
}

#[test]
#[parallel]
fn execution_rayon() {
let (mut action, directories, launchers) = setup();
action.resources.processes = Some(Processes::PerSubmission(1));
action.launchers = Some(vec!["rayon".into()]);
action.command = Some("command {directories}".to_string());

let script = BashScriptBuilder::new(
"cluster",
&action,
&directories,
&PathBuf::default(),
&HashMap::new(),
&launchers,
)
.build()
.expect("Valid script.");
println!("{script}");

assert!(script.contains("RAYON_NUM_THREADS=4 command \"${directories[@]}\""));
}

#[test]
#[parallel]
fn execution_mpi() {
Expand Down
3 changes: 2 additions & 1 deletion tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ fn show_launchers_short() -> Result<(), Box<dyn std::error::Error>> {
.assert()
.success()
.stdout(predicate::str::contains("mpi"))
.stdout(predicate::str::contains("openmp\n"));
.stdout(predicate::str::contains("openmp\n"))
.stdout(predicate::str::contains("rayon\n"));

Ok(())
}
Expand Down