calloc - Allocate Resources and Create Interactive Shell¶
calloc allocates resources using command-line specified parameters and creates a new interactive shell on the allocated compute nodes.
calloc must be started on a node where cfored is running. When the task starts, it enters a new user terminal where you can directly work on the compute node.
Tip
Exiting the calloc shell will terminate the allocation and release the resources.
Command Line Options¶
Resource Specifications¶
- -N, --nodes uint32: Number of nodes to allocate (default: 1)
- -c, --cpus-per-task float: Number of CPU cores per task (default: 1)
- --ntasks-per-node uint32: Number of tasks per node (default: 1)
- --mem string: Maximum memory per node. Supports GB (G, g), MB (M, m), KB (K, k), and Bytes (B), default unit is MB
- --gres string: Generic resources required per task, format:
gpu:a100:1orgpu:1 - --L, --licenses: The licenses that the job requires to use, format:
lic1:2,lic2:4orlic1:2|lic2:4
Job Information¶
- -J, --job-name string: Job name
- -A, --account string: Account for job submission
- -p, --partition string: Requested partition
- -q, --qos string: Quality of Service (QoS) for the job
- -t, --time string: Time limit, format:
day-hours:minutes:seconds(e.g.,5-0:0:1for 5 days, 1 second) orhours:minutes:seconds(e.g.,10:1:2for 10 hours, 1 minute, 2 seconds) - --comment string: Job comment
Node Selection¶
- -w, --nodelist string: Nodes to allocate (comma-separated list)
- -x, --exclude string: Exclude specific nodes from allocation (comma-separated list)
Environment Variables¶
- --get-user-env: Load user's login environment variables
- --export string: Propagate environment variables
Scheduling Options¶
- --exclusive: Request exclusive node resources
- -H, --hold: Submit job in held state
- -r, --reservation string: Use reserved resources
Email Notifications¶
- --mail-type string: Notify user by mail when certain events occur. Supported values:
NONE,BEGIN,END,FAIL,TIMELIMIT,ALL(default:NONE) - --mail-user string: Mail address of notification receiver
Miscellaneous¶
- -D, --chdir string: Working directory of the job
- --extra-attr string: Extra attributes of the job (JSON format)
- --debug-level string: Debug level:
trace,debug,info(default:info) - -C, --config string: Configuration file path (default:
/etc/crane/config.yaml) - -h, --help: Display help information
- -v, --version: Display calloc version
Usage Examples¶
Help Information¶
Display help:
Basic Resource Allocation¶
Allocate 2 nodes with 1 CPU core and 200M memory in CPU partition:
Result:

Specify Account and Node List¶
Allocate 1 node in GPU partition with 2 tasks per node, using specific account and node list:
Result:

Time Limit and QoS¶
Allocate resources with time limit and specific QoS:

Working Directory¶
Specify working directory:

Debug Level¶
Set debug level to trace:

Exclude Nodes¶
Exclude specific nodes from allocation:

User Environment¶
Load user's login environment:

Job Name¶
Specify job name:

Advanced Features¶
Exclusive Nodes¶
Request exclusive access to nodes:
Held Job¶
Submit job in held state (requires manual release):
Release the job later using ccontrol release <job_id>.
Use Reservation¶
Allocate resources from a reservation:
Email Notifications¶
Receive email notifications for job events:
GPU Allocation¶
Allocate GPU resources:
Interactive Usage¶
Once calloc allocates resources, you'll be placed in a new shell on the allocated compute node(s). You can:
- Run commands directly on the compute nodes
- Access all allocated nodes via SSH
- Use environment variable
CRANE_JOB_NODELISTto see allocated nodes - Run parallel tasks across allocated nodes
Example session:
# Start allocation
$ calloc -N 2 -c 4 -p CPU
# Now in the allocated shell
$ hostname
crane01
$ echo $CRANE_JOB_NODELIST
crane01;crane02
# Run commands on all nodes
$ for node in crane01 crane02; do ssh $node hostname; done
crane01
crane02
# Exit to release resources
$ exit
Important Notes¶
-
cfored Requirement: calloc must be run on a node where
cforedis running -
Resource Release: Exiting the calloc shell will automatically terminate the job and release all allocated resources
-
Interactive Nature: Unlike
cbatch, calloc provides an interactive shell for immediate work -
Node Access: You have SSH access to all allocated nodes during the allocation
-
Nested Execution: You can run
crunwithin a calloc allocation to inherit its resources
Comparison with Other Commands¶
| Command | Type | Usage |
|---|---|---|
| calloc | Interactive allocation | Get a shell on compute nodes |
| crun | Interactive execution | Run a specific program interactively |
| cbatch | Batch submission | Submit a script for later execution |