Skip to content

Neither nprocs, -np, or PYMAPDL_NPROC override SLURM env variable core count - PySyC workflow #4160

@pshutche

Description

@pshutche

🤓 Before submitting the issue

🔍 Description of the bug

I am following this method of submission via submission script:

https://mapdl.docs.pyansys.com/version/stable/user_guide/hpc/pymapdl.html

So SLURM reserves 32 cores on 1 node. 32 cores are then given to Fluent and to MAPDL.

I want to reduce the MAPDL cores to 16. For this I try both 1 or 2 as follows:

  1. My python script launches MAPDL using:

mechanical = pymapdl.launch_mapdl(nproc = 16)

  1. I put PYMAPDL_NPROCS=16 in my submission script and in python script either:

a. mechanical = pymapdl.launch_mapdl()
b. not issue this at all and wait for pysyc to launch mapdl (which it does)

In all cases MAPDL launches on 32 cores.

🕵️ Steps To Reproduce

import ansys.fluent.core as pyfluent
import ansys.mapdl.core as pymapdl
import ansys.systemcoupling.core as pysystemcoupling

Fluent_folder = "Fluent_1"
Fluent_case = "Fluent-overset-laminar.cas.h5"
Fluent_cores = 32
Fluent_ui_mode = "no_gui" # -gu
Mechanical_folder = "Mechanical_2"
Mechanical_jobname = "Mechanical"
Mechanical_input = "Mechanical.dat"
Mechanical_scp = "Mechanical_2/Mechanical.scp"
Mechanical_cores = 16

mechanical = pymapdl.launch_mapdl()
#mechanical = pymapdl.launch_mapdl(nproc = Mechanical_cores,override = True)
fluent = pyfluent.launch_fluent(case_file_name = Fluent_case, processor_count = Fluent_cores, ui_mode = Fluent_ui_mode, cwd = Fluent_folder, graphics_driver = "null")
syc = pysystemcoupling.launch(start_output=True)

solid = syc.setup.add_participant(input_file = Mechanical_scp)
fluid = syc.setup.add_participant(participant_session = fluent)

fsi_interface = syc.setup.add_interface(
side_one_participant=solid,side_one_regions=['FSIN_1'],
side_two_participant=fluid,side_two_regions=['fsi'])

force_transfer_name = syc.setup.add_data_transfer(
interface=fsi_interface,
target_side="One",
target_variable="FORC",
source_variable="force",
)

displacement_transfer_name = syc.setup.add_data_transfer(
interface=fsi_interface,
target_side="Two",
source_variable="INCD",
target_variable="displacement",
)

syc.setup.solution_control.time_step_size = 1e-3
syc.setup.solution_control.end_time = 1e-3
syc.setup.solution_control.maximum_iterations = 1
syc.solution.solve()
syc.solution.shutdown()
syc.exit()

💻 Which Operating System are you using?

Linux

🐍 Which Python version are you using?

3.10

💾 Which MAPDL version are you using?

25R1

📝 PyMAPDL Report


PyAnsys Software and Environment Report

Date: Thu Aug 07 12:41:15 2025 CEST

                             OS : Linux (Rocky Linux 8.10)
                         CPU(s) : 32
                        Machine : x86_64
                   Architecture : 64bit
                            RAM : 187.5 GiB
                    Environment : Python
                    File system : xfs
                     GPU Vendor : Mesa
                   GPU Renderer : llvmpipe (LLVM 17.0.2, 256 bits)
                    GPU Version : 4.5 (Core Profile) Mesa 23.1.4

Python 3.10.12 (main, Mar 26 2024, 02:17:48) [GCC 8.2.0]

               ansys.mapdl.core : 0.70.2
                          numpy : 1.26.4
                   platformdirs : 4.3.7
                          scipy : 1.15.2
                           grpc : 1.71.0
             ansys.api.mapdl.v0 : Version unknown
             ansys.mapdl.reader : 0.54.2
                google.protobuf : 4.25.6
                ansys-math-core : 0.2.2
                     matplotlib : 3.10.1
                        pyvista : 0.45.0
                         pyiges : 0.3.1
                           tqdm : 4.67.1

ansys-tools-visualization_interface : 0.9.1
pandas : 2.2.3
ansys_sphinx_theme : Module not found
ansys.acp.core : Module not found
ansys.dpf.composites : Module not found
ansys.dpf.core : Module not found
ansys.dpf.post : Module not found
ansys.fluent.core : 0.30.2
ansys.fluent.visualization : Module not found
ansys.fluent.parametric : Module not found
ansys.geometry.core : Module not found
ansys.hps.client : Module not found
ansys.math.core : 0.2.2
ansys.mechanical.core : Module not found
ansys.meshing.prime : Module not found
ansys.modelcenter.workflow : Module not found
ansys.motorcad.core : Module not found
ansys.openapi.common : Module not found
ansys.optislang.core : Module not found
ansys.platform.instancemanagement : 1.1.2
ansys.pyensight.core : Module not found
ansys.rocky.core : Module not found
ansys.seascape : Module not found
ansys.simai.core : Module not found
ansys.systemcoupling.core : 0.9.0
ansys.turbogrid.core : Module not found
ansys.tools.report : 0.8.2
ansys.tools.versioning : 0.6.0
pyaedt : Module not found
pyedb : Module not found
pygranta : Module not found
pytwin : Module not found
appdirs : 1.4.4
pexpect : 4.9.0

Ansys Environment Report

Ansys Installation


No Ansys installations provided

Ansys Environment Variables


PYMAPDL_NPROC 16
PYMAPDL_MAPDL_EXEC /home/pshutche/ansys_inc/v251/ansys/bin/ansys251
ANSYSLI_SERVERS 2325@ottvmlicense1:2325@ottlicense6
FLUENT_MAX_IDLE_TIMEOUT 1440
ANSYSLMD_LICENSE_FILE 1055@ottvmlicense1:1055@ottlicense6
FLUENT_WEBSERVER_TOKEN pshutche
AWP_ROOT251 /home/pshutche/ansys_inc/v251

📝 Logger output file

Show the logger output file.

# PASTE HERE THE CONTENT OF THE LOGGER OUTPUT FILE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue, problem or error in PyMAPDL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions