kernelopts - Maple Help

kernelopts

set or query kernel variables and options

 Calling Sequence kernelopts(arg1, arg2, ... )

Parameters

 arg1, arg2, ... - argument(s) of the form name=val or name

Description

 • The kernelopts command is a mechanism for communication between the user and the Maple kernel. Specifically, this command is used to set and query variables that affect the computation of Maple. The variables that can be set and queried are as follows.

 ASSERT assertlevel bindir byteorder bytesalloc bytesused cacheclearlimit cpulimit cputime cputype dagtag datadir datalimit dirsep display_zero_complex_part filelimit floatPi gcbytesavail gcbytesreturned gcmaxthreads gcthreadmemorysize gctimes gctotaltime gmpthreshold gmpversion heaps homedir includepath inline jvmheaplimit keepdebuginfo level limitjvmheap locale mapledir max_record_depth maxdigits maximmediate memusage multithreaded numcpus numactivethreads opaquemodules pathsep pid platform printbytes 'printlevel' processlimit profile readdotm setsort shortlineinfo sparse_sort_cutoff stackalloc stacklimit system toolboxdir toolboxversion traceincidentalassign tracecatch tracelineinfo traceshowspecassign tracesplitmulassign unread username version versionnumber wordsize

 • There is a Maplet interface to the kernelopts routine. For more information, see the Maplets[Examples][KernelOpts] help page.
 • If an argument is of the form name=val then this specifies the setting for the named variable.
 For each argument of this type, kernelopts returns the old value of the argument. This is convenient when you want to change and later restore a value, for example,

 oldNumCPUs := kernelopts(numcpus=4);  # set new value and save old . . . . kernelopts(numcpus=oldNumCPUs);          # restore previous value

 • If an argument is a name then the current value of the named variable is retrieved and returned as the function value.
 • When kernelopts is called with many arguments, it returns an expression sequence containing the values.
 • The cpulimit, datalimit, and stacklimit limit variables must be used carefully. When a limit is reached Maple may shutdown without warning. The option to save may not be given. On some platforms, including all Windows platforms, the detection of limit violations is tied to garbage collection. Therefore, the detection of limit violations is inaccurate for code that rarely invokes garbage collection. If garbage collection is never invoked, Maple does not detect limit violations.
 • The filelimit and processlimit limit variables must also be used carefully. They limit the total number of files or processes that Maple can use. Some internal Maple functions open files or run processes and thus will fail if these limits are too low.
 • The values assigned to the following kernelopts options can be modified by attaching a unit: cacheclearlimit, cpulimit, datalimit, jvmheaplimit, and stacklimit. When the conversion from the given unit to the default unit is not exact the value is rounded down. The units used for these options follow the IEC prefixes and definitions, with the exception of the unit word. For kernelopts a word is the wordsize of the current machine (either 32 or 64 bits). The return value for these options is the previous value in the default unit.
 • Some kernelopts are most useful in the multithreaded Maple engine.  In particular the numcpus and numactivethreads have limited usefulness in the single threaded kernel.
 • The standard set of kernelopts variables is:

 • The kernelopts command is thread safe as of Maple 15, however different variables behave differently when set by multiple threads.
 • The following variables have a global effect, thus the most recent setting of these variables will take effect.  Without explicit synchronization you may not be able to determine what settings are in effect at any particular time.

 ASSERT assertlevel cacheclearlimit cpulimit datalimit display_zero_complex_part filelimit floatPi includepath inline max_record_depth maxdigits opaquemodules printbytes 'printlevel' processlimit profile readdotm sparse_sort_cutoff stacklimit unread

 • The following variables can be safely accessed from any thread:

 bindir byteorder bytesalloc bytesused cputime cputype dagtag datadir dirsep gcbytesavail gcbytesreturned gcmaxthreads gcthreadmemorysize gctimes gctotaltime gmpthreshold gmpversion heaps homedir inline level locale mapledir maxdigits maximmediate memusage multithreaded numcpus numactivethreads pathsep pid platform stackalloc stacklimit system toolboxdir toolboxversion username version wordsize

Examples

 > $\mathrm{kernelopts}\left(\mathrm{maxdigits}\right)$
 ${38654705646}$ (1)
 > $\mathrm{kernelopts}\left(\mathrm{wordsize}\right)$
 ${64}$ (2)
 > $\mathrm{kernelopts}\left(\mathrm{dagtag}=4\right)$
 ${\mathrm{FLOAT}}$ (3)
 > $\mathrm{kernelopts}\left(\mathrm{dagtag}=\mathrm{SERIES}\right)$
 ${15}$ (4)
 > $\mathrm{kernelopts}\left(\mathrm{cputime}\right)$
 ${0.253610000000000}$ (5)
 > $\mathrm{kernelopts}\left(\mathrm{datalimit}=256\mathrm{Unit}\left(\mathrm{megabyte}\right)\right):$
 > $\mathrm{kernelopts}\left(\mathrm{datalimit}=256\mathrm{Unit}\left(\mathrm{mebibyte}\right)\right)$
 ${250000}$ (6)
 > $\mathrm{kernelopts}\left(\mathrm{datalimit}=250000\mathrm{Unit}\left(\mathrm{kibibyte}\right)\right)$
 ${262144}$ (7)
 > $\mathrm{kernelopts}\left(\mathrm{datalimit}\right)$
 ${250000}$ (8)
 > $\mathrm{kernelopts}\left(\mathrm{cpulimit}=10\mathrm{Unit}\left(\mathrm{minute}\right)\right):$
 > $\mathrm{kernelopts}\left(\mathrm{cpulimit}\right)$
 ${600}$ (9)
 > $\mathrm{\pi }\cdot 1.1$
 ${3.455751919}$ (10)
 > $\mathrm{kernelopts}\left(\mathrm{floatPi}=\mathrm{false}\right):$
 > $\mathrm{\pi }\cdot 1.1$
 ${1.1}{}{\mathrm{\pi }}$ (11)

Compatibility

 • The tracelineinfo and shortlineinfo options are new in Maple 2020.
 • The tracecatch option of debugopts was moved to kernelopts in Maple 2020.
 • The kernelopts command was updated in Maple 2020.