CLI reference¶
Many pirate features are accessed via the command-line interface:
pirate_frb SUBCOMMAND [ARGS...]
where the list of subcommands, and documentation for each subcommand, are given below.
Subcommands¶
Subcommand |
Description |
|---|---|
|
Start FRB server(s) from an |
|
Connect to FrbServer(s) and stream status + filenames |
|
Send |
|
Run unit tests (use flags to select specific tests) |
|
Run timings (use flags to select specific timings) |
|
Run timing benchmarks from a dedisperser .yml file |
|
Print the YAML header of an ASDF file. (Note: ‘asdftool –info’ is also useful) |
|
Parse a dedisperser .yml file and write info to stdout |
|
Show hardware information, including cpu affinity |
|
Show registered cuda kernels (use flags to select specific registries) |
|
For debugging: generate random DedispersionConfig(s) and print as YAML |
|
Parse |
|
Run hardware test from hwtest.yml (use -s to send data instead of receiving) |
|
A utility for maintaining |
|
A utility for maintaining |
|
For debugging: run whatever code is currently in |
Detailed usage¶
run_server¶
usage: pirate_frb run_server [-h] [-s] config
Start FRB server(s) from an frb_server .yml file
positional arguments:
config Path to YAML config file
options:
-h, --help show this help message and exit
-s, --send (not yet implemented) Send fake X-engine data
rpc_status¶
usage: pirate_frb rpc_status [-h] ADDRESS [ADDRESS ...]
Connect to FrbServer(s) and stream status + filenames
positional arguments:
ADDRESS Server address(es) (e.g. 127.0.0.1:6000)
options:
-h, --help show this help message and exit
rpc_write¶
usage: pirate_frb rpc_write [-h] ADDRESS [ADDRESS ...]
Send write_files RPC to FrbServer(s) with random beams/time range
positional arguments:
ADDRESS Server address(es) (e.g. 127.0.0.1:6000)
options:
-h, --help show this help message and exit
test¶
usage: pirate_frb test [-h] [-g GPU] [-n NITER] [--rt] [--pfwr] [--pfom] [--gldk] [--gddk] [--gpfk] [--grck] [--gtgk] [--gdqk] [--cdd2] [--casm] [--zomb] [--dd] [--ana] [--chime] [--net]
Run unit tests (use flags to select specific tests)
options:
-h, --help show this help message and exit
-g GPU, --gpu GPU GPU to use for tests (default 0)
-n NITER, --niter NITER
Number of unit test iterations (default 100)
--rt Runs ReferenceTree and ReferenceLagbuf tests
--pfwr Runs PfWeightReaderMicrokernel.test_random()
--pfom Runs PfOutputMicrokernel.test_random()
--gldk Runs GpuLaggedDownsamplingKernel.test_random()
--gddk Runs GpuDedispersionKernel.test_random()
--gpfk Runs GpuPeakFindingKernel.test_random()
--grck Runs GpuRingbufCopyKernel.test_random()
--gtgk Runs GpuTreeGriddingKernel.test_random()
--gdqk Runs GpuDequantizationKernel.test_random()
--cdd2 Runs CoalescedDdKernel2.test_random()
--casm Runs some casm tests
--zomb Runs "zombie" tests (code that I wrote during protoyping that may never get used)
--dd Runs GpuDedisperser.test_random()
--ana Runs AnalyticDedisperser.test_random()
--chime Runs test_chime_frb_upchan()
--net Runs network/allocator tests (AssembledFrameAllocator, etc.)
time¶
usage: pirate_frb time [-h] [-g GPU] [-t NTHREADS] [--ncu] [--gldk] [--gddk] [--casm] [--chime] [--zomb] [--cdd2] [--gdqk] [--gtgk]
Run timings (use flags to select specific timings)
options:
-h, --help show this help message and exit
-g GPU, --gpu GPU GPU to use for timing (default 0)
-t NTHREADS, --nthreads NTHREADS
number of CPU threads (only for time_cpu_downsample)
--ncu Just run a single kernel (intended for profiling with nvidia 'ncu')
--gldk Runs time_lagged_downsampling_kernels()
--gddk Runs time_gpu_dedispersion_kernels()
--casm Runs CasmBeamformer.run_timings()
--chime Runs time_chime_frb_{beamform,upchan}()
--zomb Runs "zombie" timings (code that I wrote during protoyping that may never get used)
--cdd2 Runs CoalescedDdKernel2.time_selected()
--gdqk Runs GpuDequantizationKernel.time_selected()
--gtgk Runs GpuTreeGriddingKernel.time_selected()
time_dedisperser¶
usage: pirate_frb time_dedisperser [-h] [-n NITER] [-b BEAMS] [-g MAX_GPU_CLAG] [-H] [--python] config_file
Run timing benchmarks from a dedisperser .yml file
positional arguments:
config_file Path to YAML config file
options:
-h, --help show this help message and exit
-n NITER, --niter NITER
Number of iterations for timing (default 1000)
-b BEAMS, --beams BEAMS
Override config.beams_per_gpu with specified value
-g MAX_GPU_CLAG, --max-gpu-clag MAX_GPU_CLAG
Override config.max_gpu_clag with specified value
-H, --no-hugepages Disable hugepages
--python Use Python/cupy timing instead of C++ (for testing pybind11 interface)
show_asdf¶
usage: pirate_frb show_asdf [-h] asdf_file
Print the YAML header of an ASDF file. (Note: 'asdftool --info' is also useful)
positional arguments:
asdf_file Path to ASDF file
options:
-h, --help show this help message and exit
show_dedisperser¶
usage: pirate_frb show_dedisperser [-h] [-v] [-c] [-s STREAMS] [-b BEAMS] [-g MAX_GPU_CLAG] [--channel-map] [-r] [-R] [--test] config_file
Parse a dedisperser .yml file and write info to stdout
positional arguments:
config_file Path to YAML config file
options:
-h, --help show this help message and exit
-v, --verbose Include comments explaining the meaning of each field
-c, --config-only Print config only (skip plan)
-s STREAMS, --streams STREAMS
Override config.num_active_batches with specified value
-b BEAMS, --beams BEAMS
Override config.beams_per_gpu with specified value
-g MAX_GPU_CLAG, --max-gpu-clag MAX_GPU_CLAG
Override config.max_gpu_clag with specified value
--channel-map Show channel map tree->freq (warning: produces long output!)
-r, --resources Show resource tracking (all kernels must be precompiled)
-R, --fine-grained-resources
Like -r, but shows fine-grained per-kernel info
--test Run GpuDedisperser.test_one() with config
show_hardware¶
usage: pirate_frb show_hardware [-h]
Show hardware information, including cpu affinity
options:
-h, --help show this help message and exit
show_kernels¶
usage: pirate_frb show_kernels [-h] [--pfom] [--pfwr] [--gddk] [--gpfk] [--cdd2]
Show registered cuda kernels (use flags to select specific registries)
options:
-h, --help show this help message and exit
--pfom Show PfOutputMicrokernel registry
--pfwr Show PfWeightReaderMicrokernel registry
--gddk Show GpuDedispersionKernel registry
--gpfk Show GpuPeakFindingKernel registry
--cdd2 Show CoalescedDdKernel2 registry
show_random_config¶
usage: pirate_frb show_random_config [-h] [-n NCONFIG] [-a] [-v]
For debugging: generate random DedispersionConfig(s) and print as YAML
options:
-h, --help show this help message and exit
-n NCONFIG generate multiple random configs
-a generate arbitrary random config, without restricting to precompiled kernels
-v verbose
show_xengine_metadata¶
usage: pirate_frb show_xengine_metadata [-h] [-v] config_file
Parse xengine_metadata yml file and write info to stdout
positional arguments:
config_file Path to YAML config file
options:
-h, --help show this help message and exit
-v, --verbose Include comments explaining the meaning of each field
hwtest¶
usage: pirate_frb hwtest [-h] [-t TIME] [-s] config_file
Run hardware test using YAML config file (use -s to send data instead of receiving).
Runs and times parallel synthetic loads: network IO, disk IO, PCIe transfers
between GPU and host, GPU compute kernels, CPU compute kernels, host memory
bandwidth.
Example networking-only run::
# On cf05. The test will pause after "listening for TCP connections".
python -m pirate_frb hwtest configs/hwtest/cf05_net64.yml
# On cf00. Send to all four IP addresses on cf05.
python -m pirate_frb hwtest -s configs/hwtest/cf05_net64.yml
See configs/hwtest/*.yml for more examples.
positional arguments:
config_file Path to YAML config file
options:
-h, --help show this help message and exit
-t TIME, --time TIME Number of seconds to run test (default 20)
-s, --send Send data to test server (uses ip_addrs from config file)
make_subbands¶
usage: pirate_frb make_subbands [-h] [-r PF_RANK] fmin fmax threshold
A utility for maintaining makefile_helper.py.
The 'threshold' argument is a "target" fractional bandwidth. For example, if threshold=0.2,
then the make_subbands command will try to make bands whose fractional bandwidth is <= 20%.
However, some subbands may be wider than the threshold, due to technical constraints.
Example usage::
# Specify frequency min, max, and threshold
python -m make_subbands 300 1500 0.2
python -m make_subbands 400 800 0.1 -r 4
positional arguments:
fmin Minimum frequency (MHz)
fmax Maximum frequency (MHz)
threshold Threshold for flo/fhi
options:
-h, --help show this help message and exit
-r PF_RANK, --pf-rank PF_RANK
Peak finding rank (default: 4)
random_kernels¶
usage: pirate_frb random_kernels [-h] [-n N] [--pf] [--cdd2] [--pfwr]
A utility for maintaining makefile_helper.py
options:
-h, --help show this help message and exit
-n N Number of random kernels to print (default 20)
--pf Print random PeakFinder kernel params
--cdd2 Print random CoalescedDdKernel2 kernel params
--pfwr Print random PfWeightReader kernel params
scratch¶
usage: pirate_frb scratch [-h]
For debugging: run whatever code is currently in src_lib/scratch.cu)
options:
-h, --help show this help message and exit