-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into benc-sshd-thread-stop
- Loading branch information
Showing
4 changed files
with
53 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
|
||
from parsl import AUTO_LOGNAME, Config, bash_app, python_app | ||
from parsl.executors import ThreadPoolExecutor | ||
|
||
|
||
def local_config(): | ||
return Config(executors=[ThreadPoolExecutor()]) | ||
|
||
|
||
@pytest.mark.local | ||
def test_default_inputs(): | ||
@python_app | ||
def identity(inp): | ||
return inp | ||
|
||
@bash_app | ||
def sum_inputs(inputs=[identity(1), identity(2)], stdout=AUTO_LOGNAME): | ||
calc = sum(inputs) | ||
return f"echo {calc}" | ||
|
||
fut = sum_inputs() | ||
fut.result() | ||
with open(fut.stdout, 'r') as f: | ||
assert int(f.read()) == 3 |
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 @@ | ||
import pytest | ||
|
||
import parsl | ||
from parsl import python_app | ||
from parsl.executors.threads import ThreadPoolExecutor | ||
|
||
|
||
def local_config(): | ||
return parsl.Config(executors=[ThreadPoolExecutor()]) | ||
|
||
|
||
@pytest.mark.local | ||
def test_default_inputs(): | ||
@python_app | ||
def identity(inp): | ||
return inp | ||
|
||
@python_app | ||
def add_inputs(inputs=[identity(1), identity(2)]): | ||
return sum(inputs) | ||
|
||
assert add_inputs().result() == 3 |