ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
424 stars 120 forks source link

Using HPC licenses with `MapdlPool` #3136

Closed germa89 closed 2 months ago

germa89 commented 4 months ago

Requested internally by @ayush-kumar-423

germa89 commented 3 months ago

Main idea

We want to use MapdlPool (spawn multiple MAPDL instances), to use HPC licenses instead. So we do not require that many solver licenses.

Caveats

Probably this is not possible because HPC licenses hangs from a main MAPDL instance (use one solver license) which then spawns accross multiple processes or CPUs, using those HPC licenses.

Our usage is more focused on multiple MAPDL instances, hence each one will have a solver license. Presumably, the number of processes or CPUs won't grow enough to require HPC licenses.

I could be wrong with the reasoning though.

Ping @mikerife @pmaroneh @mcMunich for double check.

mcMunich commented 3 months ago

I thought briefly about this. What if you use pool or something to generate the input files (input_1.dat, input2.dat...), but don't solve, and then use some python multp thread/process to launch a bunch of simul solves?

germa89 commented 2 months ago

I thought briefly about this. What if you use pool or something to generate the input files (input_1.dat, input2.dat...), but don't solve, and then use some python multp thread/process to launch a bunch of simul solves?

The problem is that launching simulation solves will consume licenses I guess. HPC licenses only allow you to utilize more cores, not more instances I believe. So I guess that to utilize HPC licenses, we just need to use many cores when using launch_mapdl:

mapdl = launch_mapdl(nproc=48)
germa89 commented 2 months ago

Closing issue because it is not applicable.

saitade-bh commented 2 months ago

Just a quick question! If I use mapdl = launch_mapdl(loglevel="ERROR", print_com=True, license_type="meba", run_location=save_dir, nproc=8, jobname="flexlok", override=True), how do I know if it is using and how many HPC licenses? A bit new to using PyMAPDL.

germa89 commented 2 months ago

@mcMunich can you give us a hand here? I am not very familiar with the licensing.

mikerife commented 2 months ago

Hi @germa89 @mcMunich @adeebsaitBH There are several answers to this depending on your setup. Licensing information is available on the license server; normally users do not have direct access to a license server, just the license admin does. The license admin can use the server side license application to generate a report showing your usage. Or even just look at the raw log and see what you have checked in/out recently.

If you happen to be the license admin, as well as a user, then you can use the server side license tool yourself.

If you are not an license admin but want an alternate answer, then you could dig into the client side license logs. 'Client' here means the computer that is running MAPDL (that PyMAPDL launched). There is a folder named .ansys in the temp folder that holds the client side logs. Each application (MAPDL, WB Mechanical, Fluent, etc) has its own log. On a MS Windows system if you enter the following on a File Explorer: %temp%.ansys And hit enter it will take you to that folder. The files have the naming convention "licdebug.computer name.application.version number.out" The file for MAPDL has application name of 'ANSYS'. These are text files.

The logs are pretty straight forward if you are just looking for check out/in. If you want to learn how to read all of the log, and are a commercial customer, please open a support case in the usual manner for you. The logs are really meant for the developers and technical support. Mike