Hoffman2:Scripts:matlab license check.sh

From Center for Cognitive Neuroscience
Jump to navigation Jump to search

Back to Hoffman2 Scripts

Use Cases

  • You need to run a MATLAB script and want to check that there are sufficient licenses. If not, you are grabbing a coffee or going for a run until they free up.
  • You tried running a MATLAB script and found that you couldn't check out sufficient licenses to do your work. Now you want to see if the users taking up precious licenses are part of your group so you can ask/yell for them to release the license and step away from the computer for a bit.



A bit about licenses

Every time you run the MATLAB program, you need a MATLAB license. If you also make use of the utilities in a specific toolbox, say some statistical plotting commands line boxplot from the Statistics Toolbox, you need a license for that specific toolbox in addition to the one just for MATLAB.

If you were trying to run multiple MATLAB instances at once and each used a specific toolbox, you can see how the number of licenses you'd need could get out of hand.

Compiled MATLAB only needs the requisite licenses to create the compiled code. After that it can run without taking up a license making compiled code very attractive for massively parallel processing.


Help/Usage

    matlab_license_check.sh
    2013.07.02

    Wrapper script for the command
        /u/local/licenses/lic_manager.sh users matlab
    which is used to check on the status of MATLAB licenses on Hoffman2. The
    output is slightly modified and managed to make it more readable for users.


    USAGE:
      $ matlab_license_check.sh [-h --help -r -f]


    ARGUMENTS:
      With no argument, a simple digest version is displayed listing the
      number of used and avaiable licenses of each MATLAB tool.

      Optional arguments:
        -h, --help  Show this usage message
        -r          Show the digest version plus reservation information,
                    because reserved licenses are counted as in-use, so even if
                    it says all licenses are used, it is important to check to
                    see if there are any reserved licenses that you are able to
                    make use of.
        -u          Show the digest version plus reservations plus in-use licenses.
                    The layout of this is more readable than the "-f" full output.
        -f          Show the full output, including details about which users
                    are using licenses and on which nodes


Example Output

Digest

$ matlab_license_check.sh
20130702T114020-0700
MATLAB
---- (Total of 37 licenses issued;  Total of 35 licenses in use)
Compiler
---- (Total of 7 licenses issued;  Total of 4 licenses in use)
Curve_Fitting_Toolbox
---- (Total of 1 license issued;  Total of 1 license in use)
Image_Toolbox
---- (Total of 8 licenses issued;  Total of 7 licenses in use)
Optimization_Toolbox
---- (Total of 4 licenses issued;  Total of 2 licenses in use)
Signal_Toolbox
---- (Total of 5 licenses issued;  Total of 4 licenses in use)
Statistics_Toolbox
---- (Total of 15 licenses issued;  Total of 12 licenses in use)
Wavelet_Toolbox
---- (Total of 2 licenses issued;  Total of 2 licenses in use)
Bioinformatics_Toolbox
---- (Total of 8 licenses issued;  Total of 8 licenses in use)
Distrib_Computing_Toolbox
---- (Total of 3 licenses issued;  Total of 3 licenses in use)
MATLAB_Distrib_Comp_Engine
---- (Total of 16 licenses issued;  Total of 16 licenses in use)
SIMULINK
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Control_Toolbox
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Control_Design
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Design_Optim
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Symbolic_Toolbox
---- (Total of 1 license issued;  Total of 0 licenses in use)

This shows that all but two MATLAB licenses are either in use or reserved. It also shows that things like SIMULINK and Symbolic Toolbox are not in use by anyone right now but things like the Wavelet and Bioinformatics Toolboxes are in use or reserved.


Reservations

$ matlab_license_check.sh -r
20130702T113736-0700
MATLAB
---- (Total of 37 licenses issued;  Total of 35 licenses in use)
------ 1 RESERVATION for GROUP bueragroup (lm/27010)
------ 4 RESERVATIONs for GROUP cohenlab (lm/27010)
------ 6 RESERVATIONs for GROUP fmrigroup (lm/27010)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
------ 1 RESERVATION for GROUP ghoniemgroup (lm/27010)
------ 3 RESERVATIONs for GROUP kluggroup (lm/27010)
------ 2 RESERVATIONs for GROUP miaogroup (lm/27010)
------ 1 RESERVATION for GROUP miaogroup (lm/27010)
------ 1 RESERVATION for GROUP moshegroup (lm/27010)
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
------ 1 RESERVATION for GROUP staff1group (lm/27010)
Compiler
---- (Total of 7 licenses issued;  Total of 4 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP miaogroup (lm/27010)
Curve_Fitting_Toolbox
---- (Total of 1 license issued;  Total of 1 license in use)
------ 1 RESERVATION for GROUP bueragroup (lm/27010)
Image_Toolbox
---- (Total of 8 licenses issued;  Total of 7 licenses in use)
------ 5 RESERVATIONs for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
Optimization_Toolbox
---- (Total of 4 licenses issued;  Total of 2 licenses in use)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
Signal_Toolbox
---- (Total of 5 licenses issued;  Total of 4 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
Statistics_Toolbox
---- (Total of 15 licenses issued;  Total of 12 licenses in use)
------ 3 RESERVATIONs for GROUP fmrigroup (lm/27010)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
Wavelet_Toolbox
---- (Total of 2 licenses issued;  Total of 2 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 1 RESERVATION for GROUP fmrigroup (lm/27010)
Bioinformatics_Toolbox
---- (Total of 8 licenses issued;  Total of 8 licenses in use)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
Distrib_Computing_Toolbox
---- (Total of 3 licenses issued;  Total of 3 licenses in use)
MATLAB_Distrib_Comp_Engine
---- (Total of 16 licenses issued;  Total of 16 licenses in use)
SIMULINK
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Control_Toolbox
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Control_Design
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Design_Optim
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Symbolic_Toolbox
---- (Total of 1 license issued;  Total of 0 licenses in use)

This shows that there are still four (4) licenses reserved for cohenlab (mscohen) and six (6) reserved for fmrigroup (sbook), in addition to the two remaining free licenses. The Wavelet and Bioinformatics Toolboxes are all in use because they are all reserved by specific groups, but SIMULINK and the Symbolic Toolbox are not used and don't have any reservations on them.


In Use

$ matlab_license_check.sh -u
20130702T113908-0700
MATLAB
---- (Total of 37 licenses issued;  Total of 35 licenses in use)
------ 1 RESERVATION for GROUP bueragroup (lm/27010)
------ 4 RESERVATIONs for GROUP cohenlab (lm/27010)
------ 6 RESERVATIONs for GROUP fmrigroup (lm/27010)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
------ 1 RESERVATION for GROUP ghoniemgroup (lm/27010)
-------- hiteshag n6280 /dev/tty (v27) (lm/27010 2001), start Tue 7/2 10:21
-------- huning n2180 /dev/tty (v27) (lm/27010 1801), start Tue 7/2 10:20
-------- kerr b8169-harley.local /dev/ttys000 (v23) (lm/27010 2501), start Tue 7/2 10:22
------ 3 RESERVATIONs for GROUP kluggroup (lm/27010)
------ 2 RESERVATIONs for GROUP miaogroup (lm/27010)
------ 1 RESERVATION for GROUP miaogroup (lm/27010)
------ 1 RESERVATION for GROUP moshegroup (lm/27010)
-------- navari n233 /dev/pts/4 (v27) (lm/27010 2201), start Tue 7/2 10:22
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
-------- raobasav n6165 /dev/tty (v27) (lm/27010 1901), start Tue 7/2 10:20
-------- raobasav n6154 /dev/tty (v27) (lm/27010 3001), start Tue 7/2 10:29
-------- snt n2179 /dev/tty (v27) (lm/27010 2903), start Tue 7/2 10:39
------ 1 RESERVATION for GROUP staff1group (lm/27010)
Compiler
---- (Total of 7 licenses issued;  Total of 4 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP miaogroup (lm/27010)
-------- tdevries n6263 /dev/pts/0 (v27) (lm/27010 2802), start Tue 7/2 11:33 (linger: 1800)
Curve_Fitting_Toolbox
---- (Total of 1 license issued;  Total of 1 license in use)
------ 1 RESERVATION for GROUP bueragroup (lm/27010)
Image_Toolbox
---- (Total of 8 licenses issued;  Total of 7 licenses in use)
------ 5 RESERVATIONs for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
Optimization_Toolbox
---- (Total of 4 licenses issued;  Total of 2 licenses in use)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
Signal_Toolbox
---- (Total of 5 licenses issued;  Total of 4 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 2 RESERVATIONs for GROUP fmrigroup (lm/27010)
-------- hiteshag n6280 /dev/tty (v27) (lm/27010 2101), start Tue 7/2 10:21
Statistics_Toolbox
---- (Total of 15 licenses issued;  Total of 12 licenses in use)
------ 3 RESERVATIONs for GROUP fmrigroup (lm/27010)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
-------- navari n233 /dev/pts/4 (v27) (lm/27010 2401), start Tue 7/2 10:22
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
Wavelet_Toolbox
---- (Total of 2 licenses issued;  Total of 2 licenses in use)
------ 1 RESERVATION for GROUP cohenlab (lm/27010)
------ 1 RESERVATION for GROUP fmrigroup (lm/27010)
Bioinformatics_Toolbox
---- (Total of 8 licenses issued;  Total of 8 licenses in use)
------ 4 RESERVATIONs for GROUP galaxygroup (lm/27010)
------ 4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
Distrib_Computing_Toolbox
---- (Total of 3 licenses issued;  Total of 3 licenses in use)
-------- navari n233 /dev/pts/4 (v27) (lm/27010 2301), start Tue 7/2 10:22
-------- raobasav n6165 /dev/tty (v27) (lm/27010 102), start Tue 7/2 10:20
-------- raobasav n6154 /dev/tty (v27) (lm/27010 3101), start Tue 7/2 10:29
MATLAB_Distrib_Comp_Engine
---- (Total of 16 licenses issued;  Total of 16 licenses in use)
-------- raobasav n6268 /dev/tty (v27) (lm/27010 1001), start Tue 7/2 10:19
-------- raobasav n6268 /dev/tty (v27) (lm/27010 1101), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 1201), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 1301), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 1401), start Tue 7/2 10:19
-------- raobasav n7256 /dev/tty (v27) (lm/27010 1501), start Tue 7/2 10:19
-------- raobasav n7256 /dev/tty (v27) (lm/27010 1601), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 1701), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 201), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 301), start Tue 7/2 10:19
-------- raobasav n7166 /dev/tty (v27) (lm/27010 401), start Tue 7/2 10:19
-------- raobasav n7255 /dev/tty (v27) (lm/27010 501), start Tue 7/2 10:19
-------- raobasav n7255 /dev/tty (v27) (lm/27010 601), start Tue 7/2 10:19
-------- raobasav n7255 /dev/tty (v27) (lm/27010 701), start Tue 7/2 10:19
-------- raobasav n7255 /dev/tty (v27) (lm/27010 801), start Tue 7/2 10:19
-------- raobasav n6268 /dev/tty (v27) (lm/27010 901), start Tue 7/2 10:19
SIMULINK
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Control_Toolbox
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Control_Design
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Simulink_Design_Optim
---- (Total of 2 licenses issued;  Total of 0 licenses in use)
Symbolic_Toolbox
---- (Total of 1 license issued;  Total of 0 licenses in use)

This shows the same information as the "-r" option, but adds in who is using each license and where they are using it from. All of the Distributed Computing licenses are being used by user raobasav. You can also see that only seven specific MATLAB licenses are in use by six different users.


Full

$ matlab_license_check.sh -f
20130702T114032-0700

    You have requested: users matlab

. /u/local/licenses/LM_CMDS.sh users matlab
Arguments are "users" and "matlab"
The license directory is /u/local/licenses
The apps directory is /u/local/apps
 
lmstat - Copyright (c) 1989-2010 Flexera Software, Inc. All Rights Reserved.
Flexible License Manager status on Tue 7/2/2013 11:40

License server status: 27010@lm
    License file(s) on lm: /u/local/licenses/license.matlab:

        lm: license server UP (MASTER) v11.9

Vendor daemon status (on lm):

       MLM: UP v11.6
Feature usage info:

Users of MATLAB:  (Total of 37 licenses issued;  Total of 35 licenses in use)

  "MATLAB" v28, vendor: MLM
  floating license


  "MATLAB" v28, vendor: MLM
  floating license

    1 RESERVATION for GROUP bueragroup (lm/27010)

  "MATLAB" v27, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP cohenlab (lm/27010)

  "MATLAB" v28, vendor: MLM
  floating license

    6 RESERVATIONs for GROUP fmrigroup (lm/27010)

  "MATLAB" v27, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP galaxygroup (lm/27010)

  "MATLAB" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP ghoniemgroup (lm/27010)
    hiteshag n6280 /dev/tty (v27) (lm/27010 2001), start Tue 7/2 10:21

  "MATLAB" v27, vendor: MLM
  floating license

    huning n2180 /dev/tty (v27) (lm/27010 1801), start Tue 7/2 10:20

  "MATLAB" v28, vendor: MLM
  floating license

    kerr b8169-harley.local /dev/ttys000 (v23) (lm/27010 2501), start Tue 7/2 10:22

  "MATLAB" v27, vendor: MLM
  floating license


  "MATLAB" v21, vendor: MLM
  nodelocked license, locked to "ID=301818"

    3 RESERVATIONs for GROUP kluggroup (lm/27010)

  "MATLAB" v21, vendor: MLM
  nodelocked license, locked to "ID=319868"

    2 RESERVATIONs for GROUP miaogroup (lm/27010)

  "MATLAB" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP miaogroup (lm/27010)

  "MATLAB" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP moshegroup (lm/27010)
    navari n233 /dev/pts/4 (v27) (lm/27010 2201), start Tue 7/2 10:22

  "MATLAB" v28, vendor: MLM
  floating license


  "MATLAB" v27, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)
    raobasav n6165 /dev/tty (v27) (lm/27010 1901), start Tue 7/2 10:20
    raobasav n6154 /dev/tty (v27) (lm/27010 3001), start Tue 7/2 10:29

  "MATLAB" v27, vendor: MLM
  floating license

    snt n2179 /dev/tty (v27) (lm/27010 2903), start Tue 7/2 10:39

  "MATLAB" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP staff1group (lm/27010)

Users of Compiler:  (Total of 7 licenses issued;  Total of 4 licenses in use)

  "Compiler" v28, vendor: MLM
  floating license


  "Compiler" v21, vendor: MLM
  nodelocked license, locked to "ID=301818"

    1 RESERVATION for GROUP cohenlab (lm/27010)

  "Compiler" v27, vendor: MLM
  floating license

    2 RESERVATIONs for GROUP miaogroup (lm/27010)
    tdevries n6263 /dev/pts/0 (v27) (lm/27010 2802), start Tue 7/2 11:33 (linger: 1800)

Users of Curve_Fitting_Toolbox:  (Total of 1 license issued;  Total of 1 license in use)

  "Curve_Fitting_Toolbox" v28, vendor: MLM
  floating license

    1 RESERVATION for GROUP bueragroup (lm/27010)

Users of Image_Toolbox:  (Total of 8 licenses issued;  Total of 7 licenses in use)

  "Image_Toolbox" v28, vendor: MLM
  floating license


  "Image_Toolbox" v27, vendor: MLM
  floating license

    5 RESERVATIONs for GROUP cohenlab (lm/27010)
    2 RESERVATIONs for GROUP fmrigroup (lm/27010)

Users of Optimization_Toolbox:  (Total of 4 licenses issued;  Total of 2 licenses in use)

  "Optimization_Toolbox" v27, vendor: MLM
  floating license

    2 RESERVATIONs for GROUP fmrigroup (lm/27010)

Users of Signal_Toolbox:  (Total of 5 licenses issued;  Total of 4 licenses in use)

  "Signal_Toolbox" v28, vendor: MLM
  floating license


  "Signal_Toolbox" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP cohenlab (lm/27010)

  "Signal_Toolbox" v27, vendor: MLM
  floating license

    2 RESERVATIONs for GROUP fmrigroup (lm/27010)
    hiteshag n6280 /dev/tty (v27) (lm/27010 2101), start Tue 7/2 10:21

Users of Statistics_Toolbox:  (Total of 15 licenses issued;  Total of 12 licenses in use)

  "Statistics_Toolbox" v27, vendor: MLM
  floating license


  "Statistics_Toolbox" v28, vendor: MLM
  floating license

    3 RESERVATIONs for GROUP fmrigroup (lm/27010)

  "Statistics_Toolbox" v27, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP galaxygroup (lm/27010)
    navari n233 /dev/pts/4 (v27) (lm/27010 2401), start Tue 7/2 10:22

  "Statistics_Toolbox" v28, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)

Users of Wavelet_Toolbox:  (Total of 2 licenses issued;  Total of 2 licenses in use)

  "Wavelet_Toolbox" v28, vendor: MLM
  floating license


  "Wavelet_Toolbox" v27, vendor: MLM
  floating license

    1 RESERVATION for GROUP cohenlab (lm/27010)
    1 RESERVATION for GROUP fmrigroup (lm/27010)

Users of Bioinformatics_Toolbox:  (Total of 8 licenses issued;  Total of 8 licenses in use)

  "Bioinformatics_Toolbox" v28, vendor: MLM
  floating license

    4 RESERVATIONs for GROUP galaxygroup (lm/27010)
    4 RESERVATIONs for GROUP pellegrinigroup (lm/27010)

Users of Distrib_Computing_Toolbox:  (Total of 3 licenses issued;  Total of 3 licenses in use)

  "Distrib_Computing_Toolbox" v27, vendor: MLM
  floating license

    navari n233 /dev/pts/4 (v27) (lm/27010 2301), start Tue 7/2 10:22

  "Distrib_Computing_Toolbox" v27, vendor: MLM
  floating license

    raobasav n6165 /dev/tty (v27) (lm/27010 102), start Tue 7/2 10:20

  "Distrib_Computing_Toolbox" v27, vendor: MLM
  floating license

    raobasav n6154 /dev/tty (v27) (lm/27010 3101), start Tue 7/2 10:29

Users of MATLAB_Distrib_Comp_Engine:  (Total of 16 licenses issued;  Total of 16 licenses in use)

  "MATLAB_Distrib_Comp_Engine" v27, vendor: MLM
  floating license

    raobasav n6268 /dev/tty (v27) (lm/27010 1001), start Tue 7/2 10:19
    raobasav n6268 /dev/tty (v27) (lm/27010 1101), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 1201), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 1301), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 1401), start Tue 7/2 10:19
    raobasav n7256 /dev/tty (v27) (lm/27010 1501), start Tue 7/2 10:19
    raobasav n7256 /dev/tty (v27) (lm/27010 1601), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 1701), start Tue 7/2 10:19

  "MATLAB_Distrib_Comp_Engine" v27, vendor: MLM
  floating license

    raobasav n7166 /dev/tty (v27) (lm/27010 201), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 301), start Tue 7/2 10:19
    raobasav n7166 /dev/tty (v27) (lm/27010 401), start Tue 7/2 10:19
    raobasav n7255 /dev/tty (v27) (lm/27010 501), start Tue 7/2 10:19
    raobasav n7255 /dev/tty (v27) (lm/27010 601), start Tue 7/2 10:19
    raobasav n7255 /dev/tty (v27) (lm/27010 701), start Tue 7/2 10:19
    raobasav n7255 /dev/tty (v27) (lm/27010 801), start Tue 7/2 10:19
    raobasav n6268 /dev/tty (v27) (lm/27010 901), start Tue 7/2 10:19

Users of SIMULINK:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of Control_Toolbox:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of Simulink_Control_Design:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of Simulink_Design_Optim:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of Symbolic_Toolbox:  (Total of 1 license issued;  Total of 0 licenses in use)


/u/local/apps/matlab/7.14/etc/glnxa64/lmstat -c /u/local/licenses/license.matlab -S MLM
 
#############
All done on 02/07/13 (European, I mean logical, date notation)!

All the same information as in the previous examples, except there is additional information about licenses being floating vs reserved.