53 description = "%prog constructs a DAG to re-run relatives of DAG nodes named on the command line. The scenario this is intended to address is the situation in which one or more of the parents of a job malfunction but exit with a success code (0). This can occur, for example, during a filesystem malfunction, where the job believes it wrote its output files to disk successfully, it exits with a success code, but the files never show up on the server. Because the job exited with a success code, dagman marks it done, and submitting the rescue DAG will not retry the job. This tool can be used to automate the process of rerunning one or more selected jobs, as well as their ancestor and/or descendent graphs. The old DAG is read from stdin. The new one is written to stdout."
54 )
55 parser.add_option("--themselves", "-t", action = "store_true", help = "Rerun the named nodes.")
56 parser.add_option("--ancestors-of", "-a", action = "store_true", help = "Rerun the ancestors of the named nodes.")
57 parser.add_option("--descendants-of", "-d", action = "store_true", help = "Rerun the descendents of the named nodes.")
58 parser.add_option("--verbose", "-v", action = "store_true", help = "Be verbose.")
59 options, nodenames = parser.parse_args()
60
61#
62# check that there's something to do
63#
64
65ifnot (options.themselves or options.ancestors_of or options.descendants_of):
66raise ValueError("nothing to do!")
67if options.ancestors_of and options.descendants_of andnot options.themselves:
68raise ValueError("cowardly refusing to rerun both the parents and children of the named nodes without also rerunning the named nodes themselves. must include --themselves when both --ancestors-of and --descendants-of have been selected.")