Skip to main content

Submit License Jobs

A license job is a compute task that requires a specific software license to run. The Fsched scheduler ensures jobs run only after the required license resources are obtained through intelligent license management.

Core features:

  • Resource awareness: real-time monitoring of license availability
  • Smart queuing: automatically waits when licenses are insufficient
  • Dynamic allocation: automatically obtains licenses after external licenses are released
  • Flexible configuration: supports both CLI and template submission methods

License job workflow:

Untitled file (6)

Prerequisites

CLI Submission Method

Check License Availability

Command syntax:

scontrol show lic --ext

Sample output and interpretation:

[root@centos7-16c-1 ~]# scontrol show lic --ext
LicenseName=primesim@10.106.32.69_27000
Total=999 Used=0 Free=999 Reserved=0 Remote=yes
LastConsumed=0 LastDeficit=0 LastUpdate=Unknown
LicenseName=apex20k@10.106.32.69_27000
Total=999 Used=0 Free=99 Reserved=0 Remote=yes
LastConsumed=900 LastDeficit=900 LastUpdate=Unknown

Field details:

FieldDescriptionExample Value Analysis
LicenseNameLicense identifier: license_name@server_nameapex20k@10.106.32.69_27000
TotalTotal number of licenses999
UsedUsed within the current cluster0 (no usage in the cluster)
FreeRemaining available in the cluster99 (key decision indicator)
ReservedReserved license count0
RemoteWhether it is a remote licenseyes (from external server)
LastConsumedTotal consumption (inside + outside cluster)900 (900 used externally)
LastDeficitMost recent shortage amount900 (short by 900)

Key insights:

  • Free=99 indicates the cluster currently has 99 apex20k licenses available
  • LastConsumed=900 indicates external systems are using 900 licenses
  • Total licenses: 999; available to the cluster: 99; external usage: 900

Submit a License Job

Basic command syntax:

srun -L <license_name>@<server_name>:<count> <command>

Example:

# Request 100 apex20k licenses to run a task
[root@centos7-16c-1 ~]# srun -L apex20k@10.106.32.69_27000:100 sleep 600&
[1] 7070

Job Status Monitoring

Status when licenses are insufficient:

[root@centos7-16c-1 ~]# squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
80 partition sleep root PD 0:00 1 (Licenses)

Status explanation:

  • ST=PD: pending state
  • REASON=(Licenses): waiting due to insufficient license resources
  • Job ID 80 is waiting for 100 licenses, but only 99 are currently available

License Release and Job Execution

Status after external licenses are released:

# Job starts running
[root@centos7-16c-1 ~]# squeue
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
80 partition sleep root R 5:21 1 centos7-64c-6

# License status update
[root@centos7-16c-1 ~]# scontrol show lic --ext
LicenseName=apex20k@10.106.32.69_27000
Total=999 Used=100 Free=899 Reserved=0 Remote=yes
LastConsumed=0 LastDeficit=0 LastUpdate=Unknown

Status change analysis:

  • Used=100: the job is using 100 licenses
  • Free=899: available count decreases to 899
  • LastConsumed=0: external usage cleared (possibly released)
  • Job status changes from PD to R (Running)

Template Submission Method

Applicable Scenarios

Advantages of job templates:

  • Automated calculation: dynamically determine license requirements based on job size
  • Unified policy: ensure consistency of license allocation
  • Simplified operation: users do not need to manually calculate license counts
  • Resource optimization: avoid over- or under-requesting licenses

Template Configuration Example

Ansys HPC Pack license template:

#SBATCH -L ansys@se-lic:{% set cpus = (np | toInt) * (node_num | toInt) %}{% if cpus <= 4 %}0{% elseif cpus <= 12 %}1{% elseif cpus <= 36 %}2{% elseif cpus <= 132 %}3{% elseif cpus <= 516 %}4{% else %}0{% endif %}

Template logic breakdown:

CPU core rangeLicenses consumedApplicable scenario
≤ 4 cores0Small compute tasks
5-12 cores1Medium compute tasks
13-36 cores2Large compute tasks
37-132 cores3Extra-large compute tasks
133-516 cores4Extreme scale compute
>516 cores0Special handling

Calculation logic:

  • cpus = np × node_num: total CPU cores
  • Determine license count based on core range
  • This example applies to the core-based licensing mode of Ansys HPC Pack

Template Configuration UI

UI steps:

  1. Select or create a job template
  2. Add license configuration parameters in the Script section
  3. Save the template configuration

Submit Jobs Using Templates

Workflow:

  1. Log in to the job submission UI
  2. Select the configured license template
  3. Set job parameters (node count, process count, etc.)
  4. Submit the job; the system automatically calculates the required license count

Benefits:

  • Users do not need to understand the specific license calculation rules
  • The system automatically allocates an appropriate number of licenses based on job size
  • Ensures optimized license usage

Best Practices Guide

License Request Strategy

Reasonable estimation:

# Recommended: request based on actual need
srun -L apex20k@server:50 simulation_job

# Avoid: over-requesting
srun -L apex20k@server:200 simulation_job # may waste resources

# Avoid: under-requesting
srun -L apex20k@server:5 simulation_job # may impact performance

Job Queue Optimization

Monitoring and adjustment:

  • Check scontrol show lic --ext regularly to understand license status
  • Use squeue to monitor job wait status
  • Adjust submission time or job size based on queue conditions

Template Design Recommendations

Customized template rules:

# Design templates based on software characteristics
#SBATCH -L <software>@<server>:{% if task_type == "small" %}1{% elseif task_type == "medium" %}2{% else %}4{% endif %}

Troubleshooting

Issue 1: Jobs wait a long time for licenses

# Check current license status
scontrol show lic --ext

# Check external license usage
./lmstat -f <feature> -c <server>

Issue 2: Incorrect license count calculation

  • Verify template logic is correct
  • Check node and process count settings
  • Confirm license calculation rules match actual software requirements

Issue 3: License server connection failure

  • Verify network connectivity
  • Check license server status
  • Confirm server address and port are correct

Advanced Features

Jobs with Multiple Licenses

Complex job scenario:

# Request multiple licenses at the same time
srun -L ansys@server1:2,matlab@server2:1 complex_simulation