Skip to content

Commit 2eb2716

Browse files
committed
MPM doesn't need an appname
1 parent 7500d23 commit 2eb2716

1 file changed

Lines changed: 30 additions & 12 deletions

File tree

dapi/components/jobs/__init__.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,36 @@ def app_method(
4040
queue: Optional[str] = None,
4141
allocation: Optional[str] = None,
4242
) -> Any:
43-
handler = self.handlers[app_name](app_name)
44-
job_info = handler.generate_job_info(
45-
self.tapis,
46-
input_uri or "tapis://example/input/",
47-
input_file,
48-
job_name,
49-
max_minutes,
50-
node_count,
51-
cores_per_node,
52-
queue,
53-
allocation,
54-
)
43+
handler = self.handlers[app_name]() # Remove app_name from instantiation
44+
45+
# Check if handler's generate_job_info expects app_name
46+
if "app_name" in handler.generate_job_info.__code__.co_varnames:
47+
job_info = handler.generate_job_info(
48+
self.tapis,
49+
input_uri or "tapis://example/input/",
50+
input_file,
51+
job_name,
52+
app_name, # Pass app_name for handlers that expect it
53+
max_minutes,
54+
node_count,
55+
cores_per_node,
56+
queue,
57+
allocation,
58+
)
59+
else:
60+
# For MPM-style handlers that don't expect app_name
61+
job_info = handler.generate_job_info(
62+
self.tapis,
63+
input_uri or "tapis://example/input/",
64+
input_file,
65+
job_name,
66+
max_minutes,
67+
node_count,
68+
cores_per_node,
69+
queue,
70+
allocation,
71+
)
72+
5573
return job_info
5674

5775
setattr(self, app_name, app_method)

0 commit comments

Comments
 (0)