Skip to content

Commit

Permalink
GCE now accepts user_endpoint_config via resource specification
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford authored and yadudoc committed Nov 7, 2024
1 parent 5cd1e2a commit a57a841
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ ignore_missing_imports = True
#[mypy-multiprocessing.synchronization.*]
#ignore_missing_imports = True

[mypy-globus_compute_sdk.*]
ignore_missing_imports = True

[mypy-pandas.*]
ignore_missing_imports = True

Expand Down
18 changes: 14 additions & 4 deletions parsl/executors/globus_compute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import uuid
from concurrent.futures import Future
from typing import Any, Callable, Dict, Optional, Union
Expand All @@ -11,7 +13,6 @@
_globus_compute_enabled = True
except ImportError:
_globus_compute_enabled = False
Client: Any # type: ignore[no-redef]

UUID_LIKE_T = Union[uuid.UUID, str]

Expand Down Expand Up @@ -54,7 +55,9 @@ def __init__(
user_endpoint_config:
User endpoint configuration values as described
and allowed by endpoint administrators. Must be a JSON-serializable dict
or None.
or None. Refer docs from `globus-compute
<https://globus-compute.readthedocs.io/en/latest/endpoints/endpoints.html#templating-endpoint-configuration>`_
for more info.
label:
a label to name the executor; mainly utilized for
Expand Down Expand Up @@ -118,11 +121,16 @@ def submit(self, func: Callable, resource_specification: Dict[str, Any], *args:
func: Callable
Python function to execute remotely
resource_specification: Dict[str, Any]
Resource specification used to run MPI applications on Endpoints configured
to use globus compute's MPIEngine
Resource specification can be used specify MPI resources required by MPI applications on
Endpoints configured to use globus compute's MPIEngine. GCE also accepts *user_endpoint_config*
to configure endpoints when the endpoint is a `Multi-User Endpoint
<https://globus-compute.readthedocs.io/en/latest/endpoints/endpoints.html#templating-endpoint-configuration>`_
args:
Args to pass to the function
kwargs:
kwargs to pass to the function
Expand All @@ -132,6 +140,8 @@ def submit(self, func: Callable, resource_specification: Dict[str, Any], *args:
Future
"""
self._executor.resource_specification = resource_specification or self.resource_specification
# Pop user_endpoint_config since it is illegal in resource_spec for globus_compute
self._executor.user_endpoint_config = resource_specification.pop('user_endpoint_config', self.user_endpoint_config)
return self._executor.submit(func, *args, **kwargs)

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

0 comments on commit a57a841

Please sign in to comment.