Workspaces/Advanced Features/ws find: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
(Created page with "= ws_find - Find Workspace Path = <tt>ws_find</tt> returns the full path to a workspace, useful for scripts and automation. == Basic Usage == $ ws_find myWs This prints the full path to the workspace named <tt>myWs</tt>. == Options == * <tt>-F <filesystem></tt> - Search workspace on specific filesystem * <tt>-l</tt> - List valid filesystem names == Example in Scripts == $ WORKSPACE=$(ws_find myProject) $ cd "$WORKSPACE" This is particularly useful in ba...")
 
mNo edit summary
 
Line 1: Line 1:
= ws_find - Find Workspace Path =
= ws_find - Find Workspace Path =


<tt>ws_find</tt> returns the full path to a workspace, useful for scripts and automation.
<tt>ws_find</tt> prints the full path to a workspace. Essential for scripts and batch jobs.


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


$ ws_find myWs
$ ws_find myWs # Print workspace path


== Use in Scripts ==
This prints the full path to the workspace named <tt>myWs</tt>.


'''Capture path in variable:'''
== Options ==

* <tt>-F <filesystem></tt> - Search workspace on specific filesystem
* <tt>-l</tt> - List valid filesystem names

== Example in Scripts ==


$ WORKSPACE=$(ws_find myProject)
$ WORKSPACE=$(ws_find myProject)
$ cd "$WORKSPACE"
$ cd "$WORKSPACE"


'''In batch jobs:'''
This is particularly useful in batch job scripts where you need to locate a workspace that was created on the login node. See [[Workspaces/Advanced_Features/ws_allocate#Using_Workspaces_in_Batch_Jobs|Using Workspaces in Batch Jobs]] for more details.

<pre>
#!/bin/bash
#SBATCH --job-name=my_job

WORKSPACE=$(ws_find myProject)
cd "$WORKSPACE"
./my_program
</pre>

This is the recommended way to locate workspaces in batch jobs. See [[Workspaces/Advanced_Features/ws_allocate#Using_Workspaces_in_Batch_Jobs|Using Workspaces in Batch Jobs]].

== Options ==

* <tt>-F <filesystem></tt> - Find workspace on specific filesystem
* <tt>-l</tt> - List available filesystem locations


== Checking Available Filesystems ==
== Check Available Filesystems ==


$ ws_find -l
$ ws_find -l # Show filesystem locations


Shows which filesystem locations are available for workspaces on your cluster. See [[Workspaces/Advanced_Features/Filesystems|Filesystems guide]] for more information about choosing filesystems.
See [[Workspaces/Advanced_Features/Filesystems|Filesystems guide]] for choosing the right filesystem.


For more information: <tt>$ ws_find -h</tt> or <tt>man ws_find</tt>
For more information: <tt>ws_find -h</tt> or <tt>man ws_find</tt>

Latest revision as of 16:39, 2 December 2025

ws_find - Find Workspace Path

ws_find prints the full path to a workspace. Essential for scripts and batch jobs.

Basic Usage

  $ ws_find myWs                           # Print workspace path

Use in Scripts

Capture path in variable:

  $ WORKSPACE=$(ws_find myProject)
  $ cd "$WORKSPACE"

In batch jobs:

#!/bin/bash
#SBATCH --job-name=my_job

WORKSPACE=$(ws_find myProject)
cd "$WORKSPACE"
./my_program

This is the recommended way to locate workspaces in batch jobs. See Using Workspaces in Batch Jobs.

Options

  • -F <filesystem> - Find workspace on specific filesystem
  • -l - List available filesystem locations

Check Available Filesystems

  $ ws_find -l                             # Show filesystem locations

See Filesystems guide for choosing the right filesystem.

For more information: ws_find -h or man ws_find