-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
101 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
|
||
from sarc.config import config | ||
|
||
|
||
@pytest.mark.usefixtures("standard_config") | ||
def test_clusterconfig_node_to_gpu(): | ||
cluster_config = config().clusters["raisin_no_prometheus"] | ||
mapping = cluster_config.node_to_gpu | ||
|
||
result = mapping["cn-c018"] | ||
assert result in cluster_config.gpus | ||
assert ( | ||
mapping._harmonize_gpu(f"{cluster_config.gpus[0]}_suffix") | ||
== cluster_config.gpus[0] | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import pytest | ||
|
||
from sarc.jobs.node_gpu_mapping import NodeToGPUMapping | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"gpu_type,expected,harmonize_gpu_map,gpus", | ||
[ | ||
[ | ||
"DoesNotExist", | ||
None, | ||
{}, | ||
[], | ||
], | ||
[ | ||
"prefix GPU1:suffix", | ||
"gpu1", | ||
{}, | ||
["gpu1", "gpu2"], | ||
], | ||
[ | ||
"prefix GPU2 suffix", | ||
"gpu2", | ||
{}, | ||
["gpu1", "gpu2"], | ||
], | ||
[ | ||
"prefix GPU1_suffix", | ||
"gpu1", | ||
{".*gpu1_suffix.*": "gpu1"}, | ||
["gpu1", "gpu2"], | ||
], | ||
], | ||
) | ||
def test_node_to_gpu_mapping(gpu_type, expected, harmonize_gpu_map, gpus): | ||
mapping = NodeToGPUMapping("cluster", None, harmonize_gpu_map, gpus) | ||
|
||
assert mapping._harmonize_gpu(gpu_type) == expected |