Skip to content

Commit f5d4733

Browse files
committed
Add a dry_run option to toast_run
1 parent 5795d76 commit f5d4733

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/toast/scripts/toast_run.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import argparse
2424
import datetime
2525
import os
26+
import pprint
2627

2728
import toast
2829
import toast.config
@@ -80,6 +81,13 @@ def main(opts=None):
8081
default="main",
8182
help="The operator to run as the 'main'",
8283
)
84+
parser.add_argument(
85+
"--dry_run",
86+
required=False,
87+
default=False,
88+
action="store_true",
89+
help="If True, log the job config and exit",
90+
)
8391

8492
# The operators and templates we want to configure from the command line
8593
# or a parameter file.
@@ -112,6 +120,11 @@ def main(opts=None):
112120
group_size = 1
113121
else:
114122
group_size = comm.size
123+
124+
if otherargs.dry_run:
125+
pprint.pprint(job)
126+
return
127+
115128
toast_comm = toast.Comm(world=comm, groupsize=group_size)
116129
data = toast.Data(comm=toast_comm)
117130

@@ -129,6 +142,7 @@ def main(opts=None):
129142
log.info_rank(f"End of the workflow: {mem}", comm=comm)
130143
log.info_rank("Workflow completed in", comm=comm, timer=timer)
131144

145+
# Cleanup
132146
data.clear()
133147
del data
134148
toast_comm.close()

0 commit comments

Comments
 (0)