Workspaces/Advanced Features/ws allocate: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 1: Line 1:
= ws_allocate - Create and Extend Workspaces =
= ws_allocate - Create and Extend Workspaces =


Create new workspaces or extend existing ones. This is your primary command for managing workspace lifetime.
{| class="wikitable"
|-
!style="width:40%" | Works on cluster
!style="width:10%" | bwUC 3.0
!style="width:10%" | BinAC2
!style="width:10%" | Helix
!style="width:10%" | JUSTUS 2
!style="width:10%" | NEMO2
|-
|<tt>ws_allocate -x -u</tt> (extend other user's workspace)
| style="text-align:center;" |
| style="text-align:center;" |
| style="text-align:center;" |
| style="text-align:center;" |
|style="background-color:#90EE90; text-align:center;" | ✓
|}


== Basic Usage ==
== Basic Usage ==

Latest revision as of 16:54, 2 December 2025

ws_allocate - Create and Extend Workspaces

Create new workspaces or extend existing ones. This is your primary command for managing workspace lifetime.

Basic Usage

  $ ws_allocate myWs 30                    # Create workspace for 30 days

Returns:

  Workspace created. Duration is 720 hours. 
  Further extensions available: 3
  /work/workspace/scratch/username-myWs-0

Capture path in variable:

  $ WORKSPACE=$(ws_allocate myWs 30)
  $ cd "$WORKSPACE"

Important: Running the same command again is safe - it returns the existing workspace path. This makes it ideal for batch job scripts.

Common Options

Group workspaces (for teams):

  $ ws_allocate -g myWs 30                 # Group-readable
  $ ws_allocate -G projectgroup myWs 30    # Group-writable (recommended for collaboration)

Specific filesystem (if available):

  $ ws_allocate -F ffuc myWs 30            # bwUniCluster 3.0: Flash filesystem

Extend existing workspace:

  $ ws_allocate -x myWs 30                 # Extend by 30 days
  $ ws_allocate -x -u alice myWs 30        # Extend Alice's group workspace

Custom reminders:

  $ ws_allocate -r 7 myWs 30               # Reminder 7 days before expiry
  $ ws_allocate -r 7 -x myWs 0             # Update reminder only (no extension)

All Options

Option Description When to Use
-F <filesystem> Create on specific filesystem Only if your cluster has multiple filesystems. Use ws_list -l to check availability. See Filesystems guide.
-g Group-readable workspace When team members need to read your data
-G <groupname> Group-writable workspace For collaborative work. Set default in ~/.ws_user.conf
-m <email> Custom email for reminders Only to override identity provider email
-r <days> Reminder n days before expiration To customize reminder timing (default is automatic)
-x Extend existing workspace When you need more time
-u <username> Extend another user's workspace When group member is unavailable (requires -G)
-c <comment> Add workspace comment Document workspace purpose
-d <duration> Duration in days Alternative to positional argument
-n <name> Workspace name Alternative to positional argument

Duration Settings

If you don't specify duration, the system default is used. Maximum lifetime varies by cluster - see Cluster-Specific Workspace Limits.

If you request more than the maximum, it will be capped automatically.

Using Workspaces in Batch Jobs

Recommended approach: Create workspace manually, then use ws_find in job scripts.

(1) Create workspace (on login node):

  $ ws_allocate myProject 60

(2) Use in job script:

#!/bin/bash
#SBATCH --job-name=my_job
#SBATCH --time=24:00:00

# Find existing workspace
WORKSPACE=$(ws_find myProject)
cd "$WORKSPACE"

# Your computation
./my_program --input input.dat --output results.dat

Important: Don't create workspaces in job scripts that run frequently. Create them manually when needed, then locate them with ws_find.

See also: ws_find

For more information: ws_allocate -h or man ws_allocate