Skip to content

Commit ad06b4b

Browse files
bencliffordyadudoc
authored andcommitted
GCE now accepts user_endpoint_config via resource specification
1 parent 2d59f23 commit ad06b4b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ ignore_missing_imports = True
177177
#[mypy-multiprocessing.synchronization.*]
178178
#ignore_missing_imports = True
179179

180+
[mypy-globus_compute_sdk.*]
181+
ignore_missing_imports = True
182+
180183
[mypy-pandas.*]
181184
ignore_missing_imports = True
182185

parsl/executors/globus_compute.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import uuid
24
from concurrent.futures import Future
35
from typing import Any, Callable, Dict, Optional, Union
@@ -11,7 +13,6 @@
1113
_globus_compute_enabled = True
1214
except ImportError:
1315
_globus_compute_enabled = False
14-
Client: Any # type: ignore[no-redef]
1516

1617
UUID_LIKE_T = Union[uuid.UUID, str]
1718

@@ -54,7 +55,9 @@ def __init__(
5455
user_endpoint_config:
5556
User endpoint configuration values as described
5657
and allowed by endpoint administrators. Must be a JSON-serializable dict
57-
or None.
58+
or None. Refer docs from `globus-compute
59+
<https://globus-compute.readthedocs.io/en/latest/endpoints/endpoints.html#templating-endpoint-configuration>`_
60+
for more info.
5861
5962
label:
6063
a label to name the executor; mainly utilized for
@@ -118,11 +121,16 @@ def submit(self, func: Callable, resource_specification: Dict[str, Any], *args:
118121
119122
func: Callable
120123
Python function to execute remotely
124+
121125
resource_specification: Dict[str, Any]
122-
Resource specification used to run MPI applications on Endpoints configured
123-
to use globus compute's MPIEngine
126+
Resource specification can be used specify MPI resources required by MPI applications on
127+
Endpoints configured to use globus compute's MPIEngine. GCE also accepts *user_endpoint_config*
128+
to configure endpoints when the endpoint is a `Multi-User Endpoint
129+
<https://globus-compute.readthedocs.io/en/latest/endpoints/endpoints.html#templating-endpoint-configuration>`_
130+
124131
args:
125132
Args to pass to the function
133+
126134
kwargs:
127135
kwargs to pass to the function
128136
@@ -132,6 +140,8 @@ def submit(self, func: Callable, resource_specification: Dict[str, Any], *args:
132140
Future
133141
"""
134142
self._executor.resource_specification = resource_specification or self.resource_specification
143+
# Pop user_endpoint_config since it is illegal in resource_spec for globus_compute
144+
self._executor.user_endpoint_config = resource_specification.pop('user_endpoint_config', self.user_endpoint_config)
135145
return self._executor.submit(func, *args, **kwargs)
136146

137147
def shutdown(self, wait=True, *, cancel_futures=False):

0 commit comments

Comments
 (0)