-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding types-mock to test-requirements.txt
- Loading branch information
Showing
5 changed files
with
36 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,49 @@ | ||
import pytest | ||
|
||
from parsl import Config | ||
from parsl.executors import HighThroughputExecutor | ||
from parsl.executors import MPIExecutor | ||
from parsl.launchers import AprunLauncher, SimpleLauncher, SrunLauncher | ||
from parsl.providers import SlurmProvider | ||
|
||
|
||
@pytest.mark.local | ||
def test_bad_launcher_with_mpi_mode(): | ||
"""AssertionError if a launcher other than SimpleLauncher is supplied""" | ||
def test_bad_launcher(): | ||
"""TypeError if a launcher other than SimpleLauncher is supplied""" | ||
|
||
for launcher in [SrunLauncher(), AprunLauncher()]: | ||
with pytest.raises(AssertionError): | ||
with pytest.raises(TypeError): | ||
Config(executors=[ | ||
HighThroughputExecutor( | ||
enable_mpi_mode=True, | ||
MPIExecutor( | ||
provider=SlurmProvider(launcher=launcher), | ||
) | ||
]) | ||
|
||
|
||
@pytest.mark.local | ||
def test_correct_launcher_with_mpi_mode(): | ||
def test_bad_mpi_launcher(): | ||
"""ValueError if an unsupported mpi_launcher is specified""" | ||
|
||
for launcher in [SrunLauncher(), AprunLauncher()]: | ||
with pytest.raises(TypeError): | ||
Config(executors=[ | ||
MPIExecutor( | ||
mpi_launcher="bad_launcher", | ||
provider=SlurmProvider(launcher=launcher), | ||
) | ||
]) | ||
|
||
|
||
@pytest.mark.local | ||
@pytest.mark.parametrize( | ||
"mpi_launcher", | ||
["srun", "aprun", "mpiexec"] | ||
) | ||
def test_correct_launcher_with_mpi_mode(mpi_launcher: str): | ||
"""Confirm that SimpleLauncher works with mpi_mode""" | ||
|
||
config = Config(executors=[ | ||
HighThroughputExecutor( | ||
enable_mpi_mode=True, | ||
provider=SlurmProvider(launcher=SimpleLauncher()), | ||
) | ||
]) | ||
assert isinstance(config.executors[0].provider.launcher, SimpleLauncher) | ||
executor = MPIExecutor( | ||
mpi_launcher=mpi_launcher, | ||
provider=SlurmProvider(launcher=SimpleLauncher()), | ||
) | ||
|
||
assert isinstance(executor.provider.launcher, SimpleLauncher) |
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