Table of Contents
Machines in the lab
There are many machines available in the Hero lab. Go to Computing Resources for a description of each one.
Accounts for the machines
- You use EECS account to login. If you don't have one already (possibly because you are not in EECS), you need to ask DCO to make one.
- Since only people in prof. Hero's group are allowed to use the machines, your EECS account must be granted the access. You need to send DCO an e-mail to have this done.
Parallel Computing in Matlab
Each of the machines has the Parallel Computing Toolbox installed with Matlab which enables parallel computing. One of the most basic ways to use this feature is via a parfor loop. A parfor loop computes iterations of a for loop in parallel. Note that this requires some restrictions on what can be done within the parfor loop. Also, on machines with older versions of matlab, you need to open a pool of Matlab workers using matlabpool first. On newer versions, this is done automatically.
Running Matlab Remotely
- The guide was originally written up by Greg Newstadt, and posted to wiki under his permission.
- Add new information or tip you want to share with others!
For a Windows PC, you will want the following software:
- Special instructions: To get the best out of this program, you can modify several options. I suggest the following:
- SSH tab: Make sure that enable compression is checked
- SSH-X11 tab: Under compression, make sure that Blowfish is the first compression type selected.
- Session tab: type the full name of the server (i.e., arcadelt.eecs.umich.edu) under server.
- Also, make sure that you save your session after you make these changes (so that you don't have to do it again)
- Available at: http://www.straightrunning.com/XmingNotes/
- Special instructions: None
- Available at: http://winscp.net/eng/download.php
- Special instructions:
- Once again, I suggest saving the session so that you don't have to retype server names/passwords all the time.
- I also suggest that you use a different text editor than the default one in WinSCP (look through the options to select the proper program). I like to use
General instructions on how to use these software to use Matlab remotely:
- Get access to the computers in Dr. Hero's lab. Basically if you can login to any of the computers (arcadelt, palestrina, irabi, fkrick, etc.), then you are fine.
- If not, you will need to contact DCO and Dr. Hero to get acecss. Note that access will be through your DCO account, not your normal umich account.
- Open Xming.
- Open Putty and login to an appropriate server.
- Open WinSCP and login to the same server.
- At this point you have the option of how to use Matlab.
- Full graphical display (+ Matlab editor), type
- Graphical display (outside editor), type
'matlab -nodesktop' or 'matlab -nodesktop -nosplash'
- Text display only (only command prompt), type
What I usually do is use either the text only display or the graphical display without the Matlab editor. In both of these cases, you should use WinSCP to edit files (make sure that you click 'Edit File' and not 'Open File', since the former will allow you to save directly to the server). Then you can use the command prompt to run scripts or short commands.
Lastly, if you are still having problems with figures taking too long to load on the screen, you can use the following commands to print directly to a file (which you can then open with WinSCP). For example:
h = figure('visible','off'); t=1:10; plot(t, sin(t), '-*'); print(h, '-depsc2', 'file.eps'); close(h);
Note that you can change the option '-depsc2' to any other format, including:
- JPEG ('-djpeg')
- BMP ('dbmp')
- EPS ('deps2')
- EPS in color ('depsc2')
- TIFF ('-dtiff')
- PDF ('-dpdf')
See http://www.mathworks.com/access/helpdesk/help/techdoc/ref/print.html for more information on the print command.
When using Matlab figures in TeX documents, you might want to keep the plot margins minimal. For example:
set(h,'Units','points') set(h,'PaperUnits','points') pos = get(h,'Position'); u=pos(3); v=pos(4); set(h,'PaperPosition',[0 0 u v]) set(h,'PaperSize',[u v]) print(h,'-dpdf','file.pdf')
Another useful tool is to run a script in matlab without actually opening up matlab. One way to do this is to open up a terminal, and type in
matlab -nodisplay >&! matlab.out << EOF
where matlab.out is a text file that will be written to the current directory. At this point, the terminal will give a matlab command line to type in commands. For example
> t = 1:5; > x = sin(t);
or if you wanted to run some script and save the output:
> output = runGoodScript(options); > save output.mat output;
at the end of what you run, make sure you exit matlab
And then to finish the batch command you have to type in
Thus, a batch job may look like:
% matlab -nodisplay >&! matlab.out << EOF > output = runGoodScript(options); > save output.mat output; > exit > EOF %
I suggest two additional options here. First, to make sure that you get control in ther terminal again, you can use the “&” after the first “EOF”. Moreover, to make sure that even if you lose your internet connection, the job will still run, type in “nohup” before matlab. Thus, it would like:
% nohup matlab -nodisplay >&! matlab.out << EOF & > output = runGoodScript(options); > save output.mat output; > exit > EOF %