-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a2cab6
commit 8e4192e
Showing
16 changed files
with
296 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import com.mathworks.toolbox.distcomp.mjs.service.ConfigUtil; | ||
import com.mathworks.toolbox.distcomp.control.PortConfig; | ||
import com.mathworks.util.PlatformInfo; | ||
import com.mathworks.toolbox.parallel.pctutil.logging.DistcompFileHandler; | ||
import com.mathworks.toolbox.parallel.pctutil.logging.DistcompSimpleFormatter; | ||
import com.mathworks.toolbox.parallel.pctutil.logging.DistcompLevel; | ||
|
||
/* Copyright 2018-2024 The MathWorks, Inc. */ | ||
|
||
// IMPORTANT!!!: Please note that the system properties referenced here actually get set | ||
// in start-workergroup.config file, are read by the service constructor on STDIN and then are | ||
// set using the java.lang.System.setProperty method before the service makes use of the | ||
// config file. This is because MATLAB does not accept -D arguments. In order to see a | ||
// property here, you need to add them to the String[] that is passed as the 6th argument | ||
// to the SharedActivatableServiceDescriptor in start-workergroup.config | ||
|
||
com.mathworks.toolbox.distcomp.workergroup { | ||
private static configDir = "${com.mathworks.toolbox.distcomp.toolboxroot}${/}config${/}"; | ||
|
||
persistenceDirectory = "${com.mathworks.toolbox.distcomp.persistenceDir}"; | ||
logDirectory = "${com.mathworks.toolbox.distcomp.logdir}"; | ||
serviceName = "${com.mathworks.toolbox.distcomp.servicename}"; | ||
|
||
lookupServiceQueryIntervalSecs = 30; | ||
maxWaitBeforeShutdownSecs = 10; | ||
|
||
codebase = ""; | ||
policy = ConfigUtil.concat(new String[]{configDir,"jsk-all.policy"}); | ||
minServiceExportPort = PortConfig.getMinDistcompServiceExportPort("${com.mathworks.toolbox.distcomp.base_port}"); | ||
|
||
// Each worker needs 2 ports, so need a large port range to accommodate | ||
// machines running many workers. This range will allow approximately 2000 | ||
// workers. | ||
maxNumPorts = 4000; | ||
|
||
defaultRmiClientConnectTimeoutSecs = 5; | ||
|
||
logLevel = "${com.mathworks.toolbox.distcomp.loglevel}"; | ||
|
||
onDemand = "${com.mathworks.toolbox.distcomp.worker.onDemand}"; | ||
idleKillTimeoutInSeconds = 5L; | ||
idleLicenseTimeoutInSeconds = 0L; // Immediately return licenses every time | ||
|
||
// Messages logged via LOGGER.log() in the Worker JVM will end up in this file. | ||
serviceLogFilePattern = ConfigUtil.concat(new String[]{ | ||
"${com.mathworks.toolbox.distcomp.logdir}${/}", | ||
"workergroup_", | ||
serviceName, | ||
".%u.%g", //unique number and sequence number | ||
".log"}); | ||
serviceHandler = new DistcompFileHandler(serviceLogFilePattern, | ||
true, | ||
DistcompLevel.getLevelFromValue(Integer.parseInt(logLevel)), | ||
10, | ||
100000000, | ||
new DistcompSimpleFormatter()); | ||
|
||
securityLevel = "${com.mathworks.toolbox.distcomp.securityLevel}"; | ||
securityDir = "${com.mathworks.toolbox.distcomp.securityDir}"; | ||
|
||
useSecureCommunication = Boolean.parseBoolean("${com.mathworks.toolbox.distcomp.rmi.useSecureCommunication}"); | ||
|
||
requireWebLicensing = Boolean.parseBoolean("${com.mathworks.toolbox.distcomp.requireWebLicensing}"); | ||
|
||
requireClientCertificate = Boolean.parseBoolean("${com.mathworks.toolbox.distcomp.rmi.requireClientCertificate}"); | ||
|
||
taskEvaluator = "com.mathworks.toolbox.distcomp.mjs.worker.matlab.VersionSwitchingTaskEvaluator"; | ||
|
||
matlabroot = "${com.mathworks.toolbox.distcomp.matlabroot}"; | ||
|
||
// These properties control how the Worker starts MATLAB. | ||
matlabExecutable = "${com.mathworks.toolbox.distcomp.matlabexecutable}"; | ||
|
||
// Use -noFigureWindows on Windows and -nodisplay everywhere else | ||
private static nodisplay = ConfigUtil.ifThenElse( | ||
/*if*/ PlatformInfo.isWindows(), | ||
/*then*/ "-noFigureWindows", | ||
/*else*/ "-nodisplay" | ||
); | ||
|
||
|
||
// Can add other command line arguments: e.g -timing or -jdb | ||
// In addition to these arguments, the PID of the Java worker service is automatically | ||
// added as an argument to the initworker.m script | ||
matlabArguments = new String[]{"-parallelserver", nodisplay, "-r", "initworker"}; | ||
// Command line arguments for worker MATLABs from 18b and earlier | ||
matlabArgumentsDmlWorker = new String[]{"-dmlworker", nodisplay, "-r", "initworker"}; | ||
// Command line arguments for worker MATLABs launched with MVM from 19b | ||
matlabArgumentsMvm = new String[]{"-parallelserver", nodisplay}; | ||
|
||
// Time to wait between polls on the MVM for whether it is still running | ||
mvmPollIntervalMillis = 1000L; | ||
|
||
// Can be used to instrument the workers for debugging, with e.g. strace or gdb. | ||
// Will be placed in front of the MATLAB executable on the command line | ||
workerInstrumentation = new String[]{}; | ||
|
||
// Whether to launch each worker with "mpiexec -n 1 -laucher fork" | ||
// This is required for mpich3, but should be removed for other mpi | ||
// implementations | ||
shouldLaunchWithMpiexec = false; | ||
|
||
// MATLAB stdout and stderr streams are written to this file. | ||
matlabOutputMaxTotalSize = 1000000000; // 1GB | ||
matlabOutputMaxNumFiles = 10; | ||
|
||
matlabEnvironment = new String[]{ | ||
"HOSTNAME", "${com.mathworks.toolbox.distcomp.hostname}", | ||
"BASE_PORT", "${com.mathworks.toolbox.distcomp.base_port}", | ||
"USE_SERVER_SPECIFIED_HOSTNAME", "${com.mathworks.toolbox.distcomp.rmi.useServerSpecifiedHostname}", | ||
"MDCS_PEERSESSION_KEEP_ALIVE_PERIOD", "${com.mathworks.toolbox.distcomp.pmode.keepAlivePeriod}", | ||
"MDCS_PEERSESSION_KEEP_ALIVE_TIME_UNIT", "${com.mathworks.toolbox.distcomp.pmode.keepAliveTimeUnit}", | ||
"MDCS_MAX_NUM_PORTS", Integer.toString(maxNumPorts), | ||
"MDCS_MATLAB_DRIVE_ENABLED_ON_WORKER", "${com.mathworks.toolbox.distcomp.matlabDriveEnabledOnWorker}", | ||
"MJS_IDLE_LICENSE_TIMEOUT_SECS", Long.toString(idleLicenseTimeoutInSeconds), | ||
"MW_MATLAB_DRIVE_FOLDER_LOCATION_CFG", "${com.mathworks.toolbox.distcomp.matlabDriveFolderLocationCfg}"}; | ||
|
||
// Other useful variables to set for debugging purposes are: | ||
//"PCTIPC_VERBOSE", "DEBUG4", | ||
//"PCTIPC_LOGFILE", ConfigUtil.concat("/tmp/pctipc_", serviceName, ".log") | ||
|
||
// Set by mjs_def "WORKER_START_TIMEOUT" property | ||
matlabStartupTimeoutSecs = Long.parseLong("${com.mathworks.toolbox.distcomp.workerstarttimeout}"); | ||
|
||
// Maximum time to wait for a clean MATLAB shutdown before the process is hard-killed | ||
matlabShutdownTimeoutSecs = 60; | ||
|
||
windowsDomain = "${com.mathworks.toolbox.distcomp.worker.windowsDomain}"; | ||
|
||
// By default do not use an activatable exporter. | ||
useActivatableExporter = false; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if eq (include "derived.overrideWorkergroupConfig" .) "true" -}} | ||
# Config files for the MJS workers. | ||
# Copyright 2024 The MathWorks, Inc. | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: mjs-worker-config | ||
data: | ||
workergroup.config: | | ||
{{- .Files.Get "files/workergroup.config" | nindent 4 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.