software:matlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:matlab [2019/03/18 16:36]
jrutte02 [Usage]
— (current)
Line 1: Line 1:
-====== Mathworks MATLAB  ======  
-{{ http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Matlab_Logo.png/267px-Matlab_Logo.png?100&nocache}} MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, and Fortran. (taken from http://en.wikipedia.org/wiki/MATLAB, more details there)  
- 
-[[http://www.mathworks.de/products/matlab/]]\\ 
- 
- 
- 
-^  Matlab  ^^ 
-|**Version:**|R2017a| 
-|**Lizenz:**|[[http://www.uni-mainz.de|University of Mainz]]| 
-|**Developer**:|Mathworks| 
-|**Toolboxes:**|Curve Fitting, Fuzzy Logic, Image Processing, Mapping, Compiler, Compiler SDK, Optimization, Parallel Computing, Partial Differential Equation, Signal Processing, Statistics and Machine Learning, Symbolic Math, Wavelet|  
- 
-====== Usage ====== 
-<code shell> 
-$ module add software/matlab/R2015a 
-</code> 
- 
-See the vendor documentation: 
-[[https://www.mathworks.com/help/matlab/]] 
- 
-====== Using Matlab-Compiler ====== 
- 
-There are several options to compile your Matlab code to stand-alone executables/libraries. Being independent of licenses is one of the major advantages here, of course. But when running compiled code with the Matlab Runtime Envirenment (MRE) on the cluster you have to consider the threading of your code just as well as when you run Matlab itself.  
-Generally, Matlab detects the number of physical cores and opens the same amount of threads to make full use of the multithreading implemented in the built-in functions. So, if you call  
-<code> mcc -m my_mfile.m </code> you obtain multithread code. Often this might be wanted, but you have to make sure that you select the appropriate resources for this then - namely, the appropriate core-affinity. Since Matlab wants to use everything on a host you'll have to call '' bsub -n 1 -R 'affinity[cores(64)]' '' and an appropriate memory reservation.  
-On the other hand, if your code doesn't need the full multithreading capability, which often is the case, you should compile your code with the flag 'singleCompThread' <code> mcc -m -R -singleCompThread my_mfile.m </code>. This makes sure that your standalone code will run on a single computational thread, which not only doesn't frustrate the core scheduler and the other users less but improves performance of your code because less time is spent in scheduling all the threads on one core.  
- 
-====== Examples ====== 
-===== Submitting a Matlab job ===== 
- 
-<file bash testmat.lsf> 
-#!/bin/bash 
- 
-# enable your environment, which will use .bashrc configuration in your home directory  
-#BSUB -L /bin/bash  
- 
-# the name of your job showing on the queue system  
-#SUB -J mytest 
- 
-# the following BSUB line specify the queue that you will use,  
-#BSUB -q short 
- 
-# the system output and error message output, %J will show as your jobID  
-#BSUB -o %J.out BSUB -e %J.err  
- 
-# the CPU number that you will collect 
-#BSUB -n 4 
- 
-# as Matlab will occupy the FPU of a bulldozer module 
-#BSUB -R 'affinity[core(2)] 
- 
-# when job finish that you will get  
-# email notification BSUB -u YourEmail@partners.org BSUB -N  
- 
-#enter your working directory 
-cd /home/$USER/TestMatlab 
- 
-# Finally, Start the program 
-/cluster/Lic_Apps/Matlab/R2013a/bin/matlab -nosplash -nodisplay -r main_matlabfile 
-</file> 
- 
-For full nodes consider 
- 
-<code shell> 
-#BSUB -n 32 
-#BSUB -R 'affinity[core(2)] 
-#BSUB -app Reserve3500M 
-</code> 
-as Matlab will not be able to fully utilize the node, but considers every FPU equal to a CPU. 
-===== Compiling a m-file on a node ===== 
- 
-Using the following shell script you can compile a m-file into a stand-alone c application. It's a variation of the script for [[:local_scratch|using local scratch on a node]].  
- 
-<file bash compileFile.sh> 
-#!/bin/bash 
- 
-# Store working directory to be safe 
-SAVEDPWD=`pwd` 
-FILENAME=$1 
- 
-# We define a bash function to do the cleaning when the signal is caught 
-cleanup(){ 
-    cp /jobdir/${LSB_JOBID}/*$FILENAME.sh ${SAVEDPWD}/ 
-    cp /jobdir/${LSB_JOBID}/$FILENAME ${SAVEDPWD}/ 
-    exit 0 
-} 
- 
-# Register the cleanup function when SIGUSR2 is sent, ten minutes before the job gets killed 
-trap 'cleanup' SIGUSR2 
- 
-# Copy input file 
-cp ${SAVEDPWD}/$FILENAME.m /jobdir/${LSB_JOBID}/ 
- 
-# Go to jobdir and start the program 
-cd /jobdir/${LSB_JOBID} 
-mcc -m $FILENAME.m 
- 
-# Call the cleanup function when everything went fine 
-cleanup 
-</file> 
  
  • software/matlab.1552923378.txt.gz
  • Last modified: 2019/03/18 16:36
  • by jrutte02