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:

Prerequisites
- License resources have been configured. See Configure License Scheduling
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:
| Field | Description | Example Value Analysis |
|---|---|---|
LicenseName | License identifier: license_name@server_name | apex20k@10.106.32.69_27000 |
Total | Total number of licenses | 999 |
Used | Used within the current cluster | 0 (no usage in the cluster) |
Free | Remaining available in the cluster | 99 (key decision indicator) |
Reserved | Reserved license count | 0 |
Remote | Whether it is a remote license | yes (from external server) |
LastConsumed | Total consumption (inside + outside cluster) | 900 (900 used externally) |
LastDeficit | Most recent shortage amount | 900 (short by 900) |
Key insights:
Free=99indicates the cluster currently has 99 apex20k licenses availableLastConsumed=900indicates 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 stateREASON=(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 licensesFree=899: available count decreases to 899LastConsumed=0: external usage cleared (possibly released)- Job status changes from
PDtoR(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 range | Licenses consumed | Applicable scenario |
|---|---|---|
| ≤ 4 cores | 0 | Small compute tasks |
| 5-12 cores | 1 | Medium compute tasks |
| 13-36 cores | 2 | Large compute tasks |
| 37-132 cores | 3 | Extra-large compute tasks |
| 133-516 cores | 4 | Extreme scale compute |
| >516 cores | 0 | Special 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
-3435578-d6f2f742fb6c6d322b18d288c2bccbad.png)
UI steps:
- Select or create a job template
- Add license configuration parameters in the Script section
- Save the template configuration
Submit Jobs Using Templates
Workflow:
- Log in to the job submission UI
- Select the configured license template
- Set job parameters (node count, process count, etc.)
- 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 --extregularly to understand license status - Use
squeueto 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