Testing for license checkout for MATLAB_Distrib_Comp_Engine

If you need to check whether you can check out the distributing computer

[user1@hpc-gekko1 ~]# /usr/local/MATLAB/R2019a/bin/matlab -dmlworker =r "license, exit"
X11 connection rejected because of wrong authentication.
MATLAB is selecting SOFTWARE OPENGL rendering.
======BEGIN LICENSE MANAGER ERROR======
License checkout failed.
License Manager Error -5
Cannot find a license for MATLAB_Distrib_Comp_Engine.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/R2019a/5

Diagnostic Information:
Feature: MATLAB_Distrib_Comp_Engine
License path: /root/.matlab/R2019a_licenses:/usr/local/MATLAB/R2019a/licenses/license.dat:/usr/local/MATLAB/R2019a
/licenses/network.lic
Licensing error: -5,147. System Error: 2======END LICENSE MANAGER ERROR======

2. Check the “normal MATLAB License Server”

$ /usr/local/MATLAB/R2019a/etc/glnxa64/lmutil lmstat -a -c ../../licenses/network.lic -f MATLAB_Distr_Comp_Engine
lmutil - Copyright (c) 1989-2017 Flexera Software LLC. All Rights Reserved.
Flexible License Manager status on Thu 10/24/2019 12:31

License server status: 27000@xxx.xxx.xxx.xxx
License file(s) on xxx.xxx.xxx.xxx: C:\Program Files\MATLAB\R2019b\etc\license.dat:

xxx.xxx.xxx.xxx: license server UP v11.16.2

Vendor daemon status (on N4SAP0048):

MLM: UP v11.16.2
Feature usage info:

Increasing JavaMemHeapMax for MATLAB on CentOS

Some of your MATLAB application may require more Java Heap Memory than the default. You may want to edit your ~/.matlab/R2017a/matlab.prf. If you do not have it, just create the file

1. Create matlab.prf

$ touch ~/.matlab/R2017a/matlab.prf

2. Increase memory to 36GB

$ vim ~/.matlab/R2017a/matlab.prf
JavaMemHeapMax=I36532

References:

  1. Change Java Heap Memory Settings Without Starting Matlab?

Managing MATLAB Users using MLM options for FlexLM

Step 1: Create a file to mlm.opt

Step 2: Edit your license.dat file

SERVER myMATLABLicense 00000000000000009
DAEMON MLM "/usr/local/MATLAB/R2016b/etc/MLM" port=1708 options="/usr/local/MATLAB/R2016b/etc/mlm.opt"
.....
.....

Step 3: Prepare mlm.opt

# Make user names and host names case insensitive when
# listed in a GROUP or HOST_GROUP.  This is not
# required but it is here to prevent some common errors.
GROUPCASEINSENSITIVE ON


# Define GROUP Users
GROUP MATLAB_BLOCK_USERS user1 user2 user3
GROUP MATLAB_INC_USERS user4 user5 user6


# EXCLUDE Users from MATLAB and selected Toolboxes
EXCLUDE "MATLAB asset_info=111111" GROUP MATLAB_BLOCK_USERS
EXCLUDE "Image_Toolbox asset_info=111111" GROUP MATLAB_BLOCK_USERS
EXCLUDE "Signal_Toolbox asset_info=111111" GROUP MATLAB_BLOCK_USERS


# RESERVE for selected for user1
RESERVE 1 "SIMULINK asset_info=111111" USER user1


# Restrict the number of licenses that can be used on machine "server1"
MAX 4 "MATLAB asset_info=111111" HOST server1


# To exclude ALL features 
EXCLUDEALL GROUP MATLAB_BLOCK_USERS


#Includes a user or pre-defined group of users, etc.
#Anyone not in an INCLUDEALL statement is not allowed to use these features. 
INCLUDEALL GROUP MATLAB_INC_USERS

References:

  1. https://www.mathworks.com/matlabcentral/answers/uploaded_files/2331/sampleMLM.opt
  2. The Options File
  3. Is there a way to administer FLEXnet based licenses? How do I create an Options file?