1+ from __future__ import annotations
2+
13import uuid
24from concurrent .futures import Future
35from typing import Any , Callable , Dict , Optional , Union
1113 _globus_compute_enabled = True
1214except ImportError :
1315 _globus_compute_enabled = False
14- Client : Any # type: ignore[no-redef]
1516
1617UUID_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