Commit 5e62dfb7 authored by Alex Waite's avatar Alex Waite

initial commit; add matlab example

parents
# HTCondor Examples
This is a collection of working examples to demonstrate best practices and to
speed bootstrapping of new projects on Juseless.
If you see something that is missing or should be improved, please contribute!
| name | description |
| ---- | ----------- |
| [matlab](matlab/) | |
# Matlab
The `matlab.submit` file submits one job that calls `analyze_subject.m` ---
which simply prints out the subject ID that is passed to it.
## Prerequisites
This example assumes that it is located in `~/htcondor-templates/matlab`. If you
have cloned it elsewhere, adjust the submit file as necessary.
Your user must be assigned a Matlab license.
Otherwise, this example is entirely self contained.
## Things to Note
* `/usr/bin/matlab90` in the `executable` line. This is where you declare the
version of matlab you wish to run.
* `-singleCompThread` limits Matlab to one core. This is a *good* thing. If you
have questions about this, TODO DOCS LINK covers much of the topic.
## Licensing
This example submits only one jobs, so licensing isn't a concern. However, most
people will want to submit more that one job.
INM-7 Matlab licenses allow a user to run Matlab on two machines at the same
time. They can run as many jobs as they want on those two machines (please read
TODO DOCS LINK for more information about Matlab licensing in INM-7).
To restrict your jobs to two machines, add the following to your submit file
(adjust the machine names to your needs):
```
requirements = Machine == "cpu7.htc.inm7.de" || Machine == "cpu8.htc.inm7.de"
```
Restricting jobs to specific machines is deeply suboptimal, as the user must
guess which machines are the best fit for them. Unfortunately, the peculiar and
uncommon way that Matlab approaches licensing makes this the only viable option.
function analyze_subject(sub)
fprintf('Beginning analysis of: %s \n', sub);
fprintf('...\n');
fprintf('Done\n');
end
# The environment
universe = vanilla
getenv = True
request_cpus = 1
request_memory = 5G
# Execution
initialdir = $ENV(HOME)/htcondor-templates/matlab
executable = /usr/bin/matlab90
transfer_executable = False
# Job
arguments = -singleCompThread -r analyze_subject('sub-127')
log = $ENV(HOME)/htcondor-templates/matlab/logs/$(Cluster).$(Process).log
output = $ENV(HOME)/htcondor-templates/matlab/logs/$(Cluster).$(Process).out
error = $ENV(HOME)/htcondor-templates/matlab/logs/$(Cluster).$(Process).err
Queue
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment