Difference between revisions of "Matlab GUI Example"
m (→GUI Session) |
|||
Line 1: | Line 1: | ||
[[Matlab|back to the main Matlab page]] | [[Matlab|back to the main Matlab page]] | ||
− | =GUI | + | =GUI Sessions= |
Start a MATLAB GUI session by loading the GUI module: | Start a MATLAB GUI session by loading the GUI module: | ||
Line 6: | Line 6: | ||
module load gui | module load gui | ||
</pre> | </pre> | ||
+ | |||
+ | Then you can launch a MATLAB GUI session using one of two main methods: | ||
==Launch Wrapper== | ==Launch Wrapper== | ||
− | Use the MATLAB launch wrapper to start your MATLAB GUI session: | + | Use the MATLAB launch wrapper provided by UFRC to start your MATLAB GUI session: |
<pre> | <pre> |
Revision as of 17:30, 14 February 2017
GUI Sessions
Start a MATLAB GUI session by loading the GUI module:
module load gui
Then you can launch a MATLAB GUI session using one of two main methods:
Launch Wrapper
Use the MATLAB launch wrapper provided by UFRC to start your MATLAB GUI session:
launch_matlab_gui
If you would like to pass custom parameters to the job script, these parameters can be listed using the -h parameter:
[$USERNAME@gator3 ~]$ launch_matlab_gui -h Usage: launch_xpra_gui_$application [options] Options: -h - show this help message -e <executable> - program to run (REQUIRED) -m <memory> - memory, gb (default is 4gb) -p <procs> - processor cores, (default is a single core) -t <time> - SLURM time limit, hrs (default is 4hrs) -a <account> - SLURM account (default is your main account) -b - Use burst SLURM qos (default is main qos) -n - Do not wait until the job starts. I will run xpra_list_sessions later -j - Set up environment for a Java program -f <jobfile> - Job script to use for the gui session -l - List application presets -v - Verbose output to show the submission information Defaults will be used for missing values
Advanced Launch
Sometimes your work-flow may require access more advanced SLURM options such as dependency scheduling or incorporating GUI MATLAB tasks into larger launch scripts. In these cases you can use an advanced job script to start a MATLAB GUI session. Please note that this is for advanced use and does not automatically list your port connection information like the earlier method does. This port connection info can be found by running the xpra_list_sessions command after your MATLAB GUI section of your job has started.
Example
- Note
- this script is also available as '$HPC_GUI_JOB/launch_matlab.sh' after loading the gui environment module. Please feel free to change the parameters as needed for your work.
#!/bin/bash #SBATCH --job-name="Matlab" #SBATCH --output matlab_gui-%j.out #SBATCH --partition=gui #SBATCH --ntasks=1 #SBATCH --mem-per-cpu=2gb #SBATCH --time=04:00:00 ##SBATCH --account=<optional> ##SBATCH --qos=<optional> hostname;pwd;date module load gui matlab xpra_start_matlab date