This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
matlab_usage [2015/03/11 18:43] mgstauff |
matlab_usage [2018/02/06 20:44] (current) mgstauff [Matlab Search Path] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Matlab===== | + | ** [[: |
- | ===== Matlab via qsub batch jobs===== | + | |
+ | =====Matlab | ||
+ | ==== Default startup.m settings ==== | ||
+ | If you need to replace the default CfN settings in your startup.m file, see / | ||
+ | |||
+ | ==== Matlab Search Path ==== | ||
+ | To customize the Matlab search path, change your ~/ | ||
+ | |||
+ | https:// | ||
+ | |||
+ | Add the definition to your ~/ | ||
+ | ==== Matlab via qsub batch jobs==== | ||
You may need to run Matlab scripts in a qsub job. It's fairly easy. This command will run a series of Matlab commands from the command line (shell), which we can use in a qsub job script: | You may need to run Matlab scripts in a qsub job. It's fairly easy. This command will run a series of Matlab commands from the command line (shell), which we can use in a qsub job script: | ||
Line 30: | Line 41: | ||
| | ||
+ | ==== Parallel-processing / Multi-threading Considerations ==== | ||
+ | Matlab is known to be greedy about how many CPU cores it uses. When it sees, for example, 16 cores on the machine where it's running, it will generally use 16 threads for its own code that is multi-threaded. The cluster will automatically set the number of threads for matlab to use according to how many cores/slots you requested for your job. This is done in two ways: | ||
+ | |||
+ | * Single core/slot: a wrapper around the ' | ||
+ | |||
+ | * Multiple cores/ | ||
+ | |||
+ | **WARNING** | ||
+ | If you notice matlab running very slowly during heavy computation (e.g. much slower than when you prototyped on your own machine), it may be because matlab is using more threads than you have cores/slots assigned to your job. | ||
+ | |||
+ | In this case, the slowdown happens because SGE ' | ||
+ | |||
+ | What to do: you should request more cores to lessen the computational bottleneck. Anecdotally, | ||
+ | |||
+ | See more discussion in [[using_ogs_sge# | ||
+ | |||
==== Parallel Toolbox Considerations ==== | ==== Parallel Toolbox Considerations ==== | ||
=== Number of Workers === | === Number of Workers === | ||
- | Note that when using Matlab' | + | When using Matlab' |
+ | NOTE: Your jobs (qsub or qlogin) run on a single compute node for easier parallel processing, and each compute node has only 16 cores. So you don't want to ask for more than 16 slots (and thus matlab workers) for a job. But also note that asking for 16 slots meaning waiting for a compute node to be completely free before you can start your job. | ||
+ | |||
+ | NOTE: ' | ||
+ | |||
+ | See more discussion in [[using_ogs_sge# | ||
+ | |||
+ | === Issue with MATLABPOOL in Multiple Matlab sessions === | ||
+ | Why am I unable to start a local MATLABPOOL from multiple MATLAB sessions that use | ||
+ | a shared preference directory using Parallel Computing Toolbox? | ||
+ | | ||
+ | See [[http:// | ||