Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 by running the following command:

No Format
/reg/common/package/scripts/matlic

You can find run the following command to find who is using the Matlab licenses, and for how long, by running the following command:

No Format
/reg/common/package/scripts/matlic --show-users

...

nohup /reg/common/package/matlab/r2013a/bin/matlab -nodesktop -nosplash -r "try; myscript; quit; catch; end" >myoutput> 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.

Reattaching

...

to a Running Session

Users doing long computations in interactive sessions will typically lock their machine overnight and return to the Matlab session the next day. If you are experiencing network connection problems, the matlab session will typically be killed when the connection is lost. In addition to using nohup and batch mode as above, one can use the unix utility tmux to reconnect to a matlab session that is run in a terminal window (as opposed to in its typical graphical window). For instance,

...

Let's suppose this was done on the host psanacs040. If you lose the connection to psanacs040, you can go back to that node and reattach:

ssh psexport
ssh psanacs040
tmux attach

You need to remember the node you ran tmux on, but or you can use the --show-users switch to matlic to discover this.