Skip to main content

blaunch

Overview

blaunch is an FSCHED CLI tool that replaces LSF, allowing you to run tasks or commands on specified hosts and providing LSF-like behavior.


Parameters

Options

OptionValue RequiredPurposeNotes
-nNoSet standard input (STDIN) to /dev/null.Flag option, no value required.
-u <host_file>YesRead host list from a file and execute on all listed hosts.Conflicts with -z; error if file is missing or invalid.
-z <hostname>YesSpecify a single host to run on.Conflicts with -u.
--use-login-shellNoUse the user's login shell (such as Bash or Zsh) to execute commands.Flag option; behavior is undefined if used with --no-shell.
--no-shellNoRun the command directly without any intermediate shell.Flag option; behavior is undefined if used with --use-login-shell.

Detailed Option Notes

1. -n

  • Purpose: Set job standard input to /dev/null to avoid reading from the terminal.
  • Example:
    blaunch -n my_command arg1 arg2

2. -u <host_file>

  • Value requirements: <host_file> is a text file containing host names, one per line (blank lines are ignored).
  • Example:
    blaunch -u hosts.txt my_script.sh
  • Notes: If the file does not exist or the format is invalid, the command fails and exits.

3. -z <hostname>

  • Value requirements: <hostname> is the target host name (for example host1.example.com).
  • Example:
    blaunch -z host2 compute_task

4. --use-login-shell

  • Purpose: Execute commands via the user's login shell to ensure environment variables and configuration are loaded.
  • Example:
    blaunch --use-login-shell ./my_script.sh
  • Notes: Behavior is undefined if used with --no-shell.

5. --no-shell

  • Purpose: Execute commands directly without any intermediate shell.
  • Example:
    blaunch --no-shell my_binary
  • Notes: Behavior is undefined if used with --use-login-shell.

Examples

Example 1: Basic Task Execution

blaunch echo "Hello World"
  • Result: prints Hello World on the default host.

Example 2: Specify a Single Host

blaunch -z host3 python script.py
  • Runs python script.py on host3.

Example 3: Load Host List from File

Assume hosts.txt contains:

node1
node2

Run:

blaunch -u hosts.txt ./run.sh
  • Runs ./run.sh on node1 and node2.

Example 4: Conflict Error Handling

Try using -u and -z together:

blaunch -u hosts.txt -z host4 cmd  # Error!
  • Error message: FATAL: conflicting with -z

Notes

  1. Command structure: The command format is blaunch [options] [host] command [arguments]. If no host is specified (such as with -u/-z), the first remaining argument is treated as the target host and the rest as the command and arguments.

  2. Conflict checks: Using -u and -z together, or --use-login-shell with --no-shell, results in errors or undefined behavior.

  3. FSCHED/LSF differences: Some LSF-specific features are not implemented:

    • Job queue management (-q).
    • Resource quota control (such as memory, GPU allocation).
    • Dependency definitions for distributed tasks.
  4. Error handling: If option parsing fails, a detailed error message is printed and execution stops.