Open popescu-v opened 3 weeks ago
So, these parameters will be part of the official API ? Not only for Python ?
One detail: When executing a large quantity small tasks is often convenient to execute with just 1 CPU because the overhead coming from the MPI process creation dominates the execution time. This overhead is worse on machines with many CPUs.
So when an API with max_cores
set to 1 or 2 I think MPI should not be used on execution.
Description
Currently, Khiops scenarios's
MaxCoreNumber
,MemoryLimit
andTemporaryDirectoryName
SystemParameters
are set either from a customGeneralOptions
instance, or fromKhiopsRunner
'sgeneral_options
attribute. But, theGeneralOptions
's attributesmax_cores
,max_memory_mb
andkhiops_temp_dir
are initialized fromkhiops_env
KHIOPS_PROC_NUMBER
,KHIOPS_MEMORY_LIMIT
andKHIOPS_TMP_DIR
attributes, respectively.However:
KHIOPS_PROC_NUMBER
is just an internal variable ofkhiops_env
which is used for setting theKHIOPS_MPI_COMMAND
variable; thus, this sets the upper bound of the number of CPU cores that Khiops would use in the current session;KHIOPS_MEMORY_LIMIT
is relayed to theMODL*
binaries and sets the upper bound of the number of MBs that Khiops would use in the current session;KHIOPS_TMP_DIR
is relayed to theMODL*
binaries and sets the default temporary directory that Khiops would use in the current session.Hence, these are global settings which set bounds for any processing done by Khiops in the current working session.
However, Khiops scenarios' parameters
SystemParameters.{MaxCoreNumber,MemoryLimit,TemporaryDirecytoryName}
are local to each processing (i.e. to each Core API call), hence:Questions/Ideas
khiops/core/api.py
should take three new keyword arguments:max_core_number: int
memory_limit: int
tmp_dir: str
KhiopsRunner._write_scenario_prologue
should not write intoAnalysisSpec.SystemParameters.{MaxCoreNumber,MemoryLimit,TemporaryDirectoryName}
from thegeneral_options
anymore, but fromtask_args
, as these are "task"-level arguments.