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
| Option | Value Required | Purpose | Notes |
|---|---|---|---|
| -n | No | Set standard input (STDIN) to /dev/null. | Flag option, no value required. |
-u <host_file> | Yes | Read host list from a file and execute on all listed hosts. | Conflicts with -z; error if file is missing or invalid. |
-z <hostname> | Yes | Specify a single host to run on. | Conflicts with -u. |
| --use-login-shell | No | Use the user's login shell (such as Bash or Zsh) to execute commands. | Flag option; behavior is undefined if used with --no-shell. |
| --no-shell | No | Run 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/nullto 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 examplehost1.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 Worldon the default host.
Example 2: Specify a Single Host
blaunch -z host3 python script.py
- Runs
python script.pyonhost3.
Example 3: Load Host List from File
Assume hosts.txt contains:
node1
node2
Run:
blaunch -u hosts.txt ./run.sh
- Runs
./run.shonnode1andnode2.
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
-
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. -
Conflict checks: Using
-uand-ztogether, or--use-login-shellwith--no-shell, results in errors or undefined behavior. -
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.
- Job queue management (
-
Error handling: If option parsing fails, a detailed error message is printed and execution stops.