From 48651eea342432076f5c67936bcf20e4935082e8 Mon Sep 17 00:00:00 2001 From: Michal Pawlik Date: Tue, 9 Aug 2022 12:29:13 +0200 Subject: [PATCH] Adjust replace rules --- ansys/rep/client/jms/resource/task_definition.py | 2 +- ansys/rep/client/jms/resource/task_definition_template.py | 2 +- examples/mapdl_motorbike_frame/motorbike_frame.ipynb | 2 +- examples/mapdl_motorbike_frame/project_setup.py | 2 +- examples/mapdl_tyre_performance/project_setup.py | 2 +- tests/jms/test_task_definition_templates.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansys/rep/client/jms/resource/task_definition.py b/ansys/rep/client/jms/resource/task_definition.py index 7f70fe585..4e4e528c3 100644 --- a/ansys/rep/client/jms/resource/task_definition.py +++ b/ansys/rep/client/jms/resource/task_definition.py @@ -112,7 +112,7 @@ class TaskDefinition(Object): name="MAPDL_run", application_name="ANSYS Mechanical APDL", application_version="20.1", - execution_command="%executable% -b -i %file:mac% -o file.out -np %num_cores%", + execution_command="%executable% -b -i %file:mac% -o file.out -np %resource:num_cores%", max_execution_time=20.0, cpu_core_usage=1, execution_level=0, diff --git a/ansys/rep/client/jms/resource/task_definition_template.py b/ansys/rep/client/jms/resource/task_definition_template.py index 99a2d7cc9..fac0b5b82 100644 --- a/ansys/rep/client/jms/resource/task_definition_template.py +++ b/ansys/rep/client/jms/resource/task_definition_template.py @@ -25,7 +25,7 @@ class TaskDefinitionTemplate(Object): application_name="ANSYS Mechanical APDL", application_version="2022 R2", data = { - "execution_command": "%executable% -b -i %file:mac% -o file.out -np %num_cores%", + "execution_command": "%executable% -b -i %file:mac% -o file.out -np %resource:num_cores%", "output_files": [ { "name": "out", diff --git a/examples/mapdl_motorbike_frame/motorbike_frame.ipynb b/examples/mapdl_motorbike_frame/motorbike_frame.ipynb index f89a248d7..9ab08c8c2 100644 --- a/examples/mapdl_motorbike_frame/motorbike_frame.ipynb +++ b/examples/mapdl_motorbike_frame/motorbike_frame.ipynb @@ -186,7 +186,7 @@ "job_def.add_task_definition( name=\"MAPDL_run\", \n", " application_name=\"ANSYS Mechanical APDL\",\n", " application_version=\"2022 R2\",\n", - " execution_command=\"%executable% -b -i %file:mac% -o file.out -np %num_cores%\",\n", + " execution_command=\"%executable% -b -i %file:mac% -o file.out -np %resource:num_cores%\",\n", " max_execution_time=50.0,\n", " cpu_core_usage=1.0,\n", " execution_level=0,\n", diff --git a/examples/mapdl_motorbike_frame/project_setup.py b/examples/mapdl_motorbike_frame/project_setup.py index a08bb97f5..187035452 100644 --- a/examples/mapdl_motorbike_frame/project_setup.py +++ b/examples/mapdl_motorbike_frame/project_setup.py @@ -229,7 +229,7 @@ def create_project(client, name, num_jobs=20): software_requirements=[ Software(name="ANSYS Mechanical APDL", version=ansys_version), ], - execution_command="%executable% -b -i %file:mac% -o file.out -np %num_cores%", + execution_command="%executable% -b -i %file:mac% -o file.out -np %resource:num_cores%", resource_requirements=ResourceRequirements( cpu_core_usage=1.0, memory=250, diff --git a/examples/mapdl_tyre_performance/project_setup.py b/examples/mapdl_tyre_performance/project_setup.py index 07769e368..988fd16e5 100644 --- a/examples/mapdl_tyre_performance/project_setup.py +++ b/examples/mapdl_tyre_performance/project_setup.py @@ -171,7 +171,7 @@ def main(client, name, num_jobs): task_def = TaskDefinition( name="MAPDL_run", software_requirements=[Software(name="ANSYS Mechanical APDL", version=ansys_version)], - execution_command="%executable% -b -i %file:mac% -o file.out -np %num_cores%", + execution_command="%executable% -b -i %file:mac% -o file.out -np %resource:num_cores%", resource_requirements=ResourceRequirements( cpu_core_usage=4, memory=4000, diff --git a/tests/jms/test_task_definition_templates.py b/tests/jms/test_task_definition_templates.py index b23ac871a..86e62804f 100644 --- a/tests/jms/test_task_definition_templates.py +++ b/tests/jms/test_task_definition_templates.py @@ -27,7 +27,7 @@ def test_template_deserialization(self): "creation_time": "2021-09-16T12:27:44.771067+00:00", "name": "ANSYS Mechanical APDL 2021 R1 Default", "data": { - "execution_command": "%executable% -b nolist -i %file:dat% -o %file:out% -np %num_cores% -dis -s noread -p ansys", + "execution_command": "%executable% -b nolist -i %file:dat% -o %file:out% -np %resource:num_cores% -dis -s noread -p ansys", "software_requirements": [ { "name": "ANSYS Mechanical APDL",