start#
- ansys.mapdl.core.cli.start.start(exec_file=None, run_location=None, jobname='file', nproc=2, ram=None, override=False, additional_switches='', start_timeout=45, port=None, license_type=None, version=None, loglevel='')#
Launch an MAPDL instance without connecting a client to it.
- Parameters:
- exec_file
str,optional Location of the MAPDL executable. The cached location is used when left at
Noneand no environment variable is set. The executable path can also be set through thePYMAPDL_MAPDL_EXECenvironment variable.- run_location
str,optional MAPDL working directory. Defaults to a temporary working directory. The directory is created when it does not exist.
- jobname
str, default: “file” MAPDL jobname.
- nproc
int, default: 2 Number of processors.
- ram
int,optional Fixed amount of memory to request for MAPDL, in megabytes. When
None, MAPDL uses as much as available on the host machine.- overridebool, default:
False Whether to delete the lock file at run_location. Useful when a previous MAPDL session exited prematurely.
- additional_switches
str, default: “” Additional switches for MAPDL, for example
"aa_r"for the academic research license. Avoid switches such as-i,-oor-b, which are already included.- start_timeout
int, default: 45 Maximum allowable time to connect to the MAPDL server.
- port
int,optional Port to launch the MAPDL gRPC server on. The final port is the first one available after (or including) this port. Defaults to
50052, or to thePYMAPDL_PORTenvironment variable when it is set.- license_type
str,optional License name (for example
"meba") or description (for example"enterprise solver"). WhenNone, the license server decides which license to provide.- version
str,optional Version of MAPDL to launch. When
None, the latest installed version is used.- loglevel
str, default: “” Logging level of the MAPDL process.
- exec_file
- Returns:
- Raises:
LaunchErrorWhen the MAPDL instance cannot be launched.
- Return type:
Examples
Launch an instance on port 50054:
>>> from ansys.mapdl.core.cli.start import start >>> ip, port, pid = start(port=50054) >>> print(f"{ip}:{port}") 127.0.0.1:50054