You can run matlab from any node in the psana pool:
No Format |
---|
ssh psana
matlab & |
Current Release is R2020a.
If the matlab command is not accessible, please do the following:
No Format |
---|
export PATH=/usr/local/bin:$PATH |
The current Matlab version is 2013a:
No Format |
---|
/reg/common/package/matlab/r2013a/bin/matlab
|
You can run the following command to find which nodes in the pool have a Matlab license available:
No Format |
---|
/reg/common/package/scripts/matlic
|
You can run the following command to find who is using the Matlab licenses, and for how long:
No Format |
---|
/reg/common/package/scripts/matlic --show-users |
The parallel toolbox allows you to make use of multiple cores on your local node (for example the parfor command will launch matlab workers on the multiple cores that are available).
MathWorks has a nice introduction to using use of the parfor command: http://www.mathworks.com/help/distcomp/getting-started-with-parfor.html
The following is meant to serve as a warning, and is an example of the misuse of parfor (i.e. it will not correctly calculate Fibonacci numbers, as one might expect):
f = zeros(1,50);
f(1) = 1;
f(2) = 2;
parfor n = 3:50
f(n) = f(n-1) + f(n-2);
end
If you have a matlab script named myscript.m in your current directory, a good way to launch matlab in the background is
No Format |
---|
nohup /reg/common/package/matlab/r2013a/bin/matlab -nodesktop -nosplash -r "try; myscript; quit; catch; end" > myoutput.log 2>&1 & |
By using the unix utility nohup, (short for no hang up) you will be able to close the terminal window you are using and logout without interrupting the matlab process. Note that we do not add the ".m" extension to myscript. By adding the command "quit" if the script is successful, and the "try catch" clause if there is a failure, we ensure that the matlab process will close properly when finished. This is important for managing the matlab licenses. You can check on the output by looking at the file myoutput.log that you are capturing output to, as well as errors to (with the 2>&1 command). You can also use the --show-users command with matlic (as discussed above) to check if your matlab process is still running.
...
Let's suppose this was done on the host psanacs040psanaxyz. If you lose the connection to psanacs040psanaxyz, you can go back to that node and reattach:
No Format |
---|
ssh psanacs040psanaxyz tmux attach |
You need to remember the node you ran tmux on, or you can use the --show-users switch to matlic to discover this.
...