Skip to content

Commit

Permalink
MPM doesn't need an appname
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Nov 26, 2024
1 parent 7500d23 commit 2eb2716
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions dapi/components/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,36 @@ def app_method(
queue: Optional[str] = None,
allocation: Optional[str] = None,
) -> Any:
handler = self.handlers[app_name](app_name)
job_info = handler.generate_job_info(
self.tapis,
input_uri or "tapis://example/input/",
input_file,
job_name,
max_minutes,
node_count,
cores_per_node,
queue,
allocation,
)
handler = self.handlers[app_name]() # Remove app_name from instantiation

# Check if handler's generate_job_info expects app_name
if "app_name" in handler.generate_job_info.__code__.co_varnames:
job_info = handler.generate_job_info(
self.tapis,
input_uri or "tapis://example/input/",
input_file,
job_name,
app_name, # Pass app_name for handlers that expect it
max_minutes,
node_count,
cores_per_node,
queue,
allocation,
)
else:
# For MPM-style handlers that don't expect app_name
job_info = handler.generate_job_info(
self.tapis,
input_uri or "tapis://example/input/",
input_file,
job_name,
max_minutes,
node_count,
cores_per_node,
queue,
allocation,
)

return job_info

setattr(self, app_name, app_method)
Expand Down

0 comments on commit 2eb2716

Please sign in to comment.