# Since version R2023a, MATLAB can discover clusters running third-party
# schedulers such as Slurm. The Discover Clusters functionality
# automatically configures the Parallel Computing Toolbox to submit MATLAB
# jobs to the cluster. To use this functionality, you must create a cluster
# configuration file and store it at a location accessible to MATLAB users.
#
# This file is an example of a cluster configuration which MATLAB can
# discover. You can copy and modify this file to make your cluster discoverable.
#
# For more information, including the required format for this file, see
# the online documentation for making a cluster running a third-party
# scheduler discoverable:
# https://www.mathworks.com/help/matlab-parallel-server/configure-for-cluster-discovery.html

# Copyright 2023 The MathWorks, Inc.

# The name MATLAB will display for the cluster when discovered.
Name = Viking

# Maximum number of MATLAB workers a single user can use in a single job.
# This number must not exceed the number of available MATLAB Parallel
# Server licenses.
NumWorkers = 960

# Path to the MATLAB install on the cluster for the workers to use. Note
# the variable "$MATLAB_VERSION_STRING" returns the release number of the
# MATLAB client that is running discovery, e.g. 2023a. If multiple versions
# of MATLAB are installed on the cluster, this allows discovery to select
# the correct installation path. Add a leading "R" or "r" if needed to
# complete the MATLAB version.
ClusterMatlabRoot = /opt/apps/eb/software/MATLAB/"$MATLAB_VERSION_STRING"

# Location where the MATLAB client stores job and task information.
#JobStorageLocation = /home/matlabjobs
JobStorageLocation =
# If the client and cluster share a filesystem but the client is running
# the Windows operating system and the cluster running a Linux operating
# system, you must specify the JobStorageLocation using a structure by
# commenting out the previous line and uncommenting the following lines.
# The 'windows' and 'unix' fields must correspond to the same folder as
# viewed from each of those operating systems.
#JobStorageLocation.windows = \\organization\home\matlabjobs
#JobStorageLocation.unix = /organization/home/matlabjobs

# Folder that contains the scheduler plugin scripts that describe how
# MATLAB interacts with the scheduler. A property can take different values
# depending on the operating system of the client MATLAB by specifying the
# name of the OS in parentheses.
PluginScriptsLocation (Windows) = C:\Users\"$USERNAME"\OneDrive - University of York\Documents\MATLAB\slurm-plugin
PluginScriptsLocation (Mac) = /Users/"$USER"/Library/Application Support/MathWorks/MATLAB Add-Ons/Collections/Parallel Computing Toolbox Plugin for Slurm
PluginScriptsLocation (Unix) = "$HOME"/MATLAB Add-Ons/Collections/Parallel Computing Toolbox Plugin for Slurm

# The operating system on the cluster. Valid values are 'unix' and 'windows'.
OperatingSystem = unix

# Specify whether client and cluster nodes share JobStorageLocation. To
# configure MATLAB to copy job input and output files to and from the
# cluster using SFTP, set this property to false and specify a value for
# AdditionalProperties.RemoteJobStorageLocation below.
HasSharedFilesystem = false

# Specify whether the cluster uses online licensing.
RequiresOnlineLicensing = false

# LicenseNumber for the workers to use. Specify only if
# RequiresOnlineLicensing is set to true.
#LicenseNumber = 123456

[AdditionalProperties]

# To configure the user's machine to connect to the submission host via
# SSH, uncomment the following line and enter the hostname of the cluster
# machine that has the scheduler utilities to submit jobs.
ClusterHost = viking.york.ac.uk

# If the user's machine and the cluster nodes do not have a shared file
# system, MATLAB can copy job input and output files to and from the
# cluster using SFTP. To activate this feature, set HasSharedFilesystem
# above to false. Then uncomment the following lines and enter the location
# on the cluster to store job files.
RemoteJobStorageLocation (Windows) = /users/"$USERNAME"/scratch/.matlab/generic_cluster_jobs
RemoteJobStorageLocation (Unix)    = /users/"$USER"/scratch/.matlab/generic_cluster_jobs

# Username to log in to ClusterHost with. On Linux and Mac, use the USER
# environment variable. On Windows, use the USERNAME variable.
Username (Unix) = "$USER"
Username (Windows) = "$USERNAME"

UseIdentityFile = false
UseUniqueSubfolders = true
Partition = nodes
WallTime = 00:15:00

AdditionalSubmitArgs = --nodes=1