-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflux-commands.yaml
204 lines (185 loc) · 8.68 KB
/
flux-commands.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
commands:
- name: flux submit
groups:
- name: Basic job submission
items:
- title: Submit a sleep job
command: flux submit sleep 60
- title: Submit a job and watch the output
command: flux submit --watch ./interesting-job.sh
- title: Submit a job to run on 2 nodes, 4 tasks, and 2 cores per task
command: flux submit --nodes=2 --ntasks=4 --cores-per-task=2 ./script.sh
- title: Submit a named job to queue jellybelly
command: flux submit --queue=jellybelly --name=buttered-popcorn ./script.sh
- title: Submit with a dry run to see the jobspec
command: flux submit --dry-run ./highly-suspicious-job.sh
- name: Advanced job submission
items:
- title: Use flux carbon copy to submit identical jobs with different inputs
command: flux submit --cc="1-10" echo "Hello I am job {cc}"
- title: Submits scripts myscript1.sh through myscript10.sh
command: flux submit --cc=1-10 myscript{cc}.sh
- title: Bypass the key value store and write output to file with jobid
command: flux --cc=1-10 submit --output=job-{{id}}.out ./my_super_cool_job.py
- title: Make a job waitable
command: flux submit --flags waitable ./wait-for-me.sh
- title: Wait for all jobs
command: flux job wait --all
- name: flux run
groups:
- name: Basic interactive jobs
items:
- title: Run a job to print the hostname
command: flux run hostname
- title: Run an interactive sleep job
command: flux run bash -c "echo start; sleep 5; echo done"
- title: Run an MPI task with options for MPI
command: flux run -N 1 -n 4 -c 10 -g 1 -o mpi=spectrum -o cpu-affinity=per-task -o gpu-affinity=per-task my_mpi_binary
- title: Remove the entire environment except for PATH
command: flux run --env-remove=* --env=PATH ./top-secret.sh
- name: flux jobs
groups:
- name: Basic job listing tool
items:
- title: See all my flux jobs
command: flux jobs -a
- title: Get a return code for a specific job
command: flux jobs --no-header -o '{returncode}' ƒj4CgebBV
- title: Add another field, status
command: flux jobs --no-header -o '{status}:{returncode}' ƒj4CgebBV
- title: Show me the job ids in a particular state
command: flux jobs --filter=pending,running,inactive -o "{id}"
- name: flux job
groups:
- name: Basic interaction with jobs
items:
- title: Get the ID of the last submitted job
command: flux job last
- title: Get the output of the last submitted job
command: flux job attach $(flux job last)
- title: Send a signal to a specific job
command: flux job kill --signal=SIGUSR1 ƒj4CgebBV
- name: flux start
groups:
- name: Basic start of a Flux instance
items:
- title: Start a test instance of size 4
command: flux start --test-size=4
- name: flux proxy
groups:
- name: Outside a flux instance
items:
- title: Connect to a running flux instance
command: flux proxy local:///run/flux/local bash
- title: Issue a command to a running flux instance
command: flux proxy local:///run/flux/local ./script.sh
- name: Inside a flux instance
items:
- title: Get the active FLUX_URI (socket)
command: echo $FLUX_URI
- name: flux resources
groups:
- name: Inspect the resources available to you
items:
- title: View the current instance nodes and statuses
command: flux resource list
- title: View the status of the flux overlay network
command: flux overlay status
- title: How long has my flux resource been up?
command: flux uptime
- name: flux batch
groups:
- name: Run batch scripts
items:
- title: Submit a batch script wrapper in /bin/sh
command: flux batch --job-name=test-name --wrap ./batch.sh
- title: Example of wrapped batch script
command: |
#!/bin/sh
# flux: -N4 -n16
flux run -n16 hostname
- title: Example of batch script with submission directives
command: |
#flux: -N4
#flux: --job-name=name
flux run -N4 hostname
- name: flux cancel
groups:
- name: Basic job cancelling
items:
- title: Cancel a job based on ID
command: flux cancel 123456
- title: Cancel all jobs
command: flux cancelall -f
- title: Cancel jobs for user meatball
command: flux cancel --user meatball
- title: Cancel jobs in a state (e.g., running)
command: flux cancel --states=RUN
- name: flux alloc
groups:
- name: Create basic allocations
items:
- title: Create an interactive allocation with two nodes
command: flux alloc -N 2 --queue=foo
- title: Create an allocation in the background with two nodes on queue 'foo'
command: flux alloc --bg -N 2 --queue=foo
- name: flux bulksubmit
groups:
- name: Format String Examples
items:
- title: Pipe inputs into flux bulksubmit
command: seq 1 4 | flux bulksubmit echo {}
- title: "Map the same inputs on the command line using GNU parallel-style ::: separator"
command: "flux bulksubmit echo {} ::: 1 2 3 4"
- title: Remove the extension of the input string (e.g., one)
command: "flux bulksubmit echo {.%} ::: one.txt two.txt three.txt"
- title: Get the basename of the input string (e.g., path.txt)
command: "flux bulksubmit echo {./} ::: /long/file/path.txt /long/file/filename.txt"
- title: Combine the two - get the basename with extension removed (e.g., path)
command: "flux bulksubmit echo {./%} ::: /long/file/path.txt /long/file/filename.txt"
- title: Get the directory name of the input string (e.g., /long/file)
command: "flux bulksubmit echo {.//} ::: /long/file/path.txt /long/file/filename.txt"
- title: Get the input sequence number, start counting at 0
command: "flux bulksubmit echo {seq} ::: 1 2 3 4"
- title: Get the input sequence number, start counting at 1 (you monster)
command: "flux bulksubmit echo {seq1} ::: 1 2 3 4"
- title: Define a custom counter called p2
command: "flux bulksubmit --dry-run --define=p2='2**int(x)' -n {.p2} hostname \
::: $(seq 0 4)"
- name: Simple Examples
items:
- title: Compress every file under ./mydir in parallel, one process per core
command: find ./mydir | flux bulksubmit --wait xz {}
- title: Do a dry run and provide multiple inputs
command: "flux bulksubmit --dry-run /bin/bash -c 'mkdir -p ./mydir/{0}/{1}; echo created mydir/{0}/{1}' ::: a b c d ::: {1..4}"
- title: Use carbon copy to submit identical jobs with different inputs
command: "flux bulksubmit --dry-run --cc={1} echo {0} ::: a b c ::: 0-1 0-3 0-7"
- title: Similar functionality with using the seq command over a different range
command: "flux bulksubmit echo 'Hello I am job {}' ::: $(seq 1 10)"
- name: flux advanced
groups:
- name: Debugging
items:
- title: Look at flux debug messages
command: flux dmesg
- title: Look at flux debug messages in a human readable format
command: flux dmesg --human
- name: Queue and Archive
items:
- title: Stop the queue, wait for running jobs to finish, and dump an archive.
command: |
flux queue stop
flux queue idle
flux dump ./archive.tar.gz
- name: Moving Files
items:
- title: Example batch script to use filemap to stage and clean up a file
last: true
command: |
flux filemap map -C /data mpi.sif
# This skips rank 0, since the file is already there
flux exec -x 0 -r all flux filemap get -C /data
flux submit -n 4 --output /tmp/fluxout/job.out --error /tmp/fluxout/job.out --flags waitable singularity exec /data/mpi.sif /opt/mpitest
# This is important to have so we wait for jobs to finish!
flux queue idle
flux filemap unmap