SLRUM for PyMechanical.?

Hello @James Derrick
I’m reaching out to seek your advice on the best strategy for submitting jobs from PyAnsys (on a Windows machine) to a SLURM cluster. Currently, our process involves copying the .py file and running it through SLURM. I was wondering if there’s a more streamlined approach, similar to how we use ANSYS RSM for Workbench submissions.
Looking forward to your insights!
Comments
-
Have you tried Ansys HPC Platform Services (HPS)?:
https://github.com/ansys/pyhps
https://hps.docs.pyansys.com/0 -
@Landon Mitchell Kanner said:
Have you tried Ansys HPC Platform Services (HPS)?:
https://github.com/ansys/pyhps
https://hps.docs.pyansys.com/Yes Landon
0 -
@Landon Mitchell Kanner whether the HPS works between windows to Linux.?
0 -
@Naveen Kumar Begari HPS is able to connect windows clients to a linux based cluster. There are primarily two worksflows that can be used with pyAnsys:
1. Inside of (py)Mechanical - add a Solve Process Setting corresponding to HPS server and authentication (this is similar to RSM setup)
2. Use (py)Mechanical to write an input file that is submitted to the cluster using pyHPS
- Examples available https://hps.docs.pyansys.com/0 -
@Andreas Rydin Thanks for your information
1 -
@Andreas Rydin said:
@Naveen Kumar Begari HPS is able to connect windows clients to a linux based cluster. There are primarily two worksflows that can be used with pyAnsys:
1. Inside of (py)Mechanical - add a Solve Process Setting corresponding to HPS server and authentication (this is similar to RSM setup)
2. Use (py)Mechanical to write an input file that is submitted to the cluster using pyHPS
- Examples available https://hps.docs.pyansys.com/For First work flow i,e:
1. Inside of (py)Mechanical - add a Solve Process Setting corresponding to HPS server and authentication (this is similar to RSM setup) --- Can you please share me the examples or workflow setup.?0 -
@Naveen Kumar Begari Here is a short script to add a HPS queue in solve process settings:
You can replace the url server with the appropriate HPS server.
import os, webbrowser new_hps_config = 'hps_mech' n_cores = 20 url = 'https://<server>:8443/hps' configs = ExtAPI.Application.SolveConfigurations hps_config = [i.Name for i in configs if i.Settings.SolutionExecutionTarget == 'HPC Platform Services'] if hps_config: # exists print('HPS configuration found') config_name = hps_config[0] print(config_name) config = ExtAPI.Application.SolveConfigurations[config_name] ExtAPI.Log.WriteMessage('Solver now changed to ' + config_name) webbrowser.open(url) Model.Analyses[0].Solve( True , config_name) if not hps_config: # doesn't exist print('No HPS configuration found') config = Ansys.ACT.Mechanical.Application.SolveProcessSettings.SolveConfiguration() config.Settings.License = 'Ansys Mechanical Enterprise' config.SolveProcessSettings.MaxNumberOfCores = n_cores config.SolveProcessSettings.LicenseQueuing = True config.Settings.SolutionExecutionTarget = 'HPC Platform Services' config.Settings.DCSUrl = url config.Name = new_hps_config config.Settings.DCSUsername = os.getenv('username') configs.Add(config) emsg = HPSConfiguration + ' has been added to your Solver Configurations. Please authenticate and validate. Next time you press this button, you will run your analysis with that configuration.' msg = Ansys.Mechanical.Application.Message(emsg, MessageSeverityType.Warning) ExtAPI.Application.Messages.Add(msg)
0 -
@Andreas Rydin Thank you for sharing the script. Will get back if any
0