-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #502 from rfbgo/workload_groups
Proof of concept for workload_groups
- Loading branch information
Showing
6 changed files
with
223 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
var/ramble/repos/builtin.mock/applications/workload-groups-inherited/application.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2022-2024 The Ramble Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
from ramble.appkit import * | ||
|
||
from ramble.app.builtin.mock.workload_groups import WorkloadGroups | ||
|
||
|
||
class WorkloadGroupsInherited(WorkloadGroups): | ||
name = "workload-groups-inherited" | ||
|
||
workload('test_wl3', executable='baz') | ||
|
||
# Test populated group applies existing vars to new workload | ||
workload_group('test_wlg', | ||
workloads=['test_wl3'], | ||
mode='append') |
38 changes: 38 additions & 0 deletions
38
var/ramble/repos/builtin.mock/applications/workload-groups/application.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2022-2024 The Ramble Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
from ramble.appkit import * | ||
|
||
|
||
class WorkloadGroups(ExecutableApplication): | ||
name = "workload-groups" | ||
|
||
executable('foo', 'echo "bar"', use_mpi=False) | ||
executable('bar', 'echo "baz"', use_mpi=False) | ||
|
||
workload('test_wl', executable='foo') | ||
workload('test_wl2', executable='bar') | ||
|
||
# Test empty group | ||
workload_group('empty', | ||
workloads=[]) | ||
|
||
# Test populated group | ||
workload_group('test_wlg', | ||
workloads=['test_wl', 'test_wl2']) | ||
|
||
# Test workload_variable that uses a group | ||
workload_variable('test_var', default='2.0', | ||
description='Test workload vars and groups', | ||
workload_group='test_wlg') | ||
|
||
# Test passing both groups an explicit workloads | ||
workload_variable('test_var_mixed', default='3.0', | ||
description='Test vars for workload and groups', | ||
workload='test_wl', | ||
workload_group='test_wlg') |