Skip to content

Commit

Permalink
Merge branch 'master' into benc-sshd-thread-stop
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford authored Jul 3, 2024
2 parents 1c1e47f + cfb0a20 commit a165ec1
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
4 changes: 4 additions & 0 deletions parsl/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ def __init__(self, func: Callable,
self.kwargs['walltime'] = params['walltime'].default
if 'parsl_resource_specification' in params:
self.kwargs['parsl_resource_specification'] = params['parsl_resource_specification'].default
if 'outputs' in params:
self.kwargs['outputs'] = params['outputs'].default
if 'inputs' in params:
self.kwargs['inputs'] = params['inputs'].default

@abstractmethod
def __call__(self, *args: Any, **kwargs: Any) -> AppFuture:
Expand Down
5 changes: 2 additions & 3 deletions parsl/providers/kubernetes/kube.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ def submit(self, cmd_string, tasks_per_node, job_name="parsl"):
- tasks_per_node (int) : command invocations to be launched per node
Kwargs:
- job_name (String): Name for job, must be unique
- job_name (String): Name for job
Returns:
- None: At capacity, cannot provision more
- job_id: (string) Identifier for the job
"""

Expand All @@ -187,7 +186,7 @@ def submit(self, cmd_string, tasks_per_node, job_name="parsl"):
formatted_cmd = template_string.format(command=cmd_string,
worker_init=self.worker_init)

logger.debug("Pod name :{}".format(pod_name))
logger.debug("Pod name: %s", pod_name)
self._create_pod(image=self.image,
pod_name=pod_name,
job_name=job_name,
Expand Down
25 changes: 25 additions & 0 deletions parsl/tests/test_bash_apps/test_inputs_default.py
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
22 changes: 22 additions & 0 deletions parsl/tests/test_python_apps/test_inputs_default.py
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

0 comments on commit a165ec1

Please sign in to comment.