Debian Codegraph @

test/regression/test.py

raw
1 # -*- coding: utf-8 -*-
2 """This script compiles and verifies the output for all form files
3 found in the 'demo' directory. The verification is performed in two
4 steps. First, the generated code is compared with stored references.
5 Then, the output from all functions in the generated code is compared
6 with stored reference values.
7
8 This script can also be used for benchmarking tabulate_tensor for all
9 form files found in the 'bench' directory. To run benchmarks, use the
10 option --bench.
11
12 """
13
14 # Copyright (C) 2010-2013 Anders Logg, Kristian B. Oelgaard and Marie E. Rognes
15 #
16 # This file is part of FFC.
17 #
18 # FFC is free software: you can redistribute it and/or modify
19 # it under the terms of the GNU Lesser General Public License as published by
20 # the Free Software Foundation, either version 3 of the License, or
21 # (at your option) any later version.
22 #
23 # FFC is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU Lesser General Public License for more details.
27 #
28 # You should have received a copy of the GNU Lesser General Public License
29 # along with FFC. If not, see <http://www.gnu.org/licenses/>.
30 #
31 # Modified by Martin Sandve Alnæs, 2013-2017
32 # Modified by Johannes Ring, 2013
33 # Modified by Kristian B. Oelgaard, 2013
34 # Modified by Garth N. Wells, 2014
35
36 # FIXME: Need to add many more test cases. Quite a few DOLFIN forms
37 # failed after the FFC tests passed.
38
39 from collections import OrderedDict, defaultdict
40 import os
41 import sys
42 import shutil
43 import difflib
44 import sysconfig
45 import subprocess
46 import time
47 import logging
48 import traceback
49 from numpy import array, shape, abs, max, isnan
50 import ffc
51 from ffc.log import begin, end, info, info_red, info_green, info_blue
52 from ffc.log import ffc_logger, ERROR
53 from ufl_legacy.log import ufl_logger
54 from ffc import get_ufc_cxx_flags
55 from ffc.backends.ufc import get_include_path as get_ufc_include
56 from ufctest import generate_test_code
57
58 # Parameters
59 output_tolerance = 1e-5
60 demo_directory = "../../../../demo"
61 bench_directory = "../../../../bench"
62
63 # Global log file
64 logfile = "error.log"
65
66 # Remove old log file
67 if os.path.isfile(logfile):
68 os.remove(logfile)
69
70 class GEFilter(object):
71 """Filter messages that are greater or equal to given log level"""
72 def __init__(self, level):
73 self.__level = level
74
75 def filter(self, record):
76 return record.levelno >= self.__level
77
78 class LTFilter(object):
79 """Filter messages that are less than given log level"""
80 def __init__(self, level):
81 self.__level = level
82
83 def filter(self, record):
84 return record.levelno < self.__level
85
86
87 # Filter out error messages from std output
88 splitlevel = ERROR
89 ffc_logger.get_handler().addFilter(LTFilter(splitlevel))
90 ufl_logger.get_handler().addFilter(LTFilter(splitlevel))
91
92 # Filter out error messages to log file
93 file_handler = logging.FileHandler(logfile)
94 file_handler.addFilter(GEFilter(splitlevel))
95 ffc_logger.get_logger().addHandler(file_handler)
96 ufl_logger.get_logger().addHandler(file_handler)
97
98 # Extended quadrature tests (optimisations)
99 ext_quad = [
100 "-r quadrature -O -feliminate_zeros",
101 "-r quadrature -O -fsimplify_expressions",
102 "-r quadrature -O -fprecompute_ip_const",
103 "-r quadrature -O -fprecompute_basis_const",
104 "-r quadrature -O -fprecompute_ip_const -feliminate_zeros",
105 "-r quadrature -O -fprecompute_basis_const -feliminate_zeros",
106 ]
107
108 # Extended uflacs tests
109 # (to be extended with optimisation parameters later)
110 ext_uflacs = [
111 "-r uflacs -O -fvectorize -fpadlen=4 -falignas=32",
112 "-r uflacs -O -fno-enable_sum_factorization",
113 "-r uflacs -O -fno-enable_preintegration",
114 "-r uflacs -O -fenable_premultiplication",
115 ]
116
117 known_quad_failures = set([
118 "PoissonQuad.ufl",
119 ])
120
121 known_uflacs_failures = set([
122 "CustomIntegral.ufl",
123 "CustomMixedIntegral.ufl",
124 "CustomVectorIntegral.ufl",
125 "MetaData.ufl",
126 ])
127
128 known_tsfc_failures = set([
129 # Expected not to work
130 "CustomIntegral.ufl",
131 "CustomMixedIntegral.ufl",
132 "CustomVectorIntegral.ufl",
133 "MetaData.ufl",
134 ])
135
136
137 _command_timings = []
138
139
140 def run_command(command, verbose):
141 "Run command and collect errors in log file."
142 global _command_timings
143
144 t1 = time.time()
145 try:
146 output = subprocess.check_output(command, shell=True)
147 t2 = time.time()
148 _command_timings.append((command, t2 - t1))
149 if verbose:
150 print(output)
151 return True
152 except subprocess.CalledProcessError as e:
153 t2 = time.time()
154 _command_timings.append((command, t2 - t1))
155 if e.output:
156 log_error(e.output)
157 print(e.output)
158 return False
159
160
161 def log_error(message):
162 "Log error message."
163 ffc_logger.get_logger().error(message)
164
165
166 def clean_output(output_directory):
167 "Clean out old output directory"
168 if os.path.isdir(output_directory):
169 shutil.rmtree(output_directory)
170 os.mkdir(output_directory)
171
172
173 def generate_test_cases(bench, only_forms, skip_forms):
174 "Generate form files for all test cases."
175
176 begin("Generating test cases")
177
178 # Copy form files
179 if bench:
180 form_directory = bench_directory
181 else:
182 form_directory = demo_directory
183
184 # Make list of form files
185 form_files = [f for f in os.listdir(form_directory)
186 if f.endswith(".ufl") and f not in skip_forms]
187 if only_forms:
188 form_files = [f for f in form_files if f in only_forms]
189 form_files.sort()
190
191 for f in form_files:
192 shutil.copy(os.path.join(form_directory, f), ".")
193 info_green("Found %d form files" % len(form_files))
194
195 # Generate form files for forms
196 #info("Generating form files for extra forms: Not implemented")
197
198 # Generate form files for elements
199 if not (bench or only_forms):
200 from elements import elements
201 info("Generating form files for extra elements (%d elements)"
202 % len(elements))
203 for (i, element) in enumerate(elements):
204 with open("X_Element%d.ufl" % i, "w") as f:
205 f.write("element = %s" % element)
206
207 end()
208
209
210 def generate_code(args, only_forms, skip_forms, debug):
211 "Generate code for all test cases."
212 global _command_timings
213
214 # Get a list of all files
215 form_files = [f for f in os.listdir(".")
216 if f.endswith(".ufl") and f not in skip_forms]
217 if only_forms:
218 form_files = [f for f in form_files if f in only_forms]
219 form_files.sort()
220
221 begin("Generating code (%d form files found)" % len(form_files))
222
223 # TODO: Parse additional options from .ufl file? I.e. grep for
224 # some sort of tag like '#ffc: <flags>'.
225 special = {"AdaptivePoisson.ufl": "-e", }
226
227 failures = []
228
229 # Iterate over all files
230 for f in form_files:
231 options = [special.get(f, "")]
232 options.extend(args)
233 options.extend(["-f", "precision=8", "-f", "epsilon=1e-7", "-fconvert_exceptions_to_warnings"])
234 options.append(f)
235 options = list(filter(None, options))
236
237 cmd = sys.executable + " -m ffc " + " ".join(options)
238
239 # Generate code
240 t1 = time.time()
241 try:
242 ok = ffc.main(options)
243 except Exception as e:
244 if debug:
245 raise e
246 msg = traceback.format_exc()
247 log_error(cmd)
248 log_error(msg)
249 ok = 1
250 finally:
251 t2 = time.time()
252 _command_timings.append((cmd, t2 - t1))
253
254 # Check status
255 if ok == 0:
256 info_green("%s OK" % f)
257 else:
258 info_red("%s failed" % f)
259 failures.append(f)
260
261 end()
262 return failures
263
264
265 def validate_code(reference_dir):
266 "Validate generated code against references."
267
268 # Get a list of all files
269 header_files = sorted([f for f in os.listdir(".") if f.endswith(".h")])
270
271 begin("Validating generated code (%d header files found)"
272 % len(header_files))
273
274 failures = []
275
276 # Iterate over all files
277 for f in header_files:
278
279 # Get generated code
280 generated_code = open(f).read()
281
282 # Get reference code
283 reference_file = os.path.join(reference_dir, f)
284 if os.path.isfile(reference_file):
285 reference_code = open(reference_file).read()
286 else:
287 info_blue("Missing reference for %s" % reference_file)
288 continue
289
290 # Compare with reference
291 if generated_code == reference_code:
292 info_green("%s OK" % f)
293 else:
294 info_red("%s differs" % f)
295 difflines = difflib.unified_diff(
296 reference_code.split("\n"),
297 generated_code.split("\n"))
298 diff = "\n".join(difflines)
299 s = ("Code differs for %s, diff follows (reference first, generated second)"
300 % os.path.join(*reference_file.split(os.path.sep)[-3:]))
301 log_error("\n" + s + "\n" + len(s) * "-")
302 log_error(diff)
303 failures.append(f)
304
305 end()
306 return failures
307
308
309 def find_boost_cflags():
310 # Get Boost dir (code copied from ufc/src/utils/python/ufc_utils/build.py)
311 # Set a default directory for the boost installation
312 if sys.platform == "darwin":
313 # Use Brew as default
314 default = os.path.join(os.path.sep, "usr", "local")
315 else:
316 default = os.path.join(os.path.sep, "usr")
317
318 # If BOOST_DIR is not set use default directory
319 boost_inc_dir = ""
320 boost_lib_dir = ""
321 boost_math_tr1_lib = "boost_math_tr1"
322 boost_dir = os.getenv("BOOST_DIR", default)
323 boost_is_found = False
324 for inc_dir in ["", "include"]:
325 if os.path.isfile(os.path.join(boost_dir, inc_dir, "boost",
326 "version.hpp")):
327 boost_inc_dir = os.path.join(boost_dir, inc_dir)
328 break
329 libdir_multiarch = "lib/" + sysconfig.get_config_vars().get("MULTIARCH", "")
330 for lib_dir in ["", "lib", libdir_multiarch, "lib64"]:
331 for ext in [".so", "-mt.so", ".dylib", "-mt.dylib"]:
332 _lib = os.path.join(boost_dir, lib_dir, "lib" + boost_math_tr1_lib
333 + ext)
334 if os.path.isfile(_lib):
335 if "-mt" in _lib:
336 boost_math_tr1_lib += "-mt"
337 boost_lib_dir = os.path.join(boost_dir, lib_dir)
338 break
339 if boost_inc_dir != "" and boost_lib_dir != "":
340 boost_is_found = True
341
342 if boost_is_found:
343 boost_cflags = " -I%s -L%s" % (boost_inc_dir, boost_lib_dir)
344 boost_linkflags = "-l%s" % boost_math_tr1_lib
345 else:
346 boost_cflags = ""
347 boost_linkflags = ""
348 info_red("""The Boost library was not found.
349 If Boost is installed in a nonstandard location,
350 set the environment variable BOOST_DIR.
351 Forms using bessel functions will fail to build.
352 """)
353 return boost_cflags, boost_linkflags
354
355
356 def build_programs(bench, permissive, debug, verbose):
357 "Build test programs for all test cases."
358
359 # Get a list of all files
360 header_files = sorted([f for f in os.listdir(".") if f.endswith(".h")])
361
362 begin("Building test programs (%d header files found)" % len(header_files))
363
364 # Get UFC flags
365 ufc_cflags = "-I" + get_ufc_include() + " " + " ".join(get_ufc_cxx_flags())
366
367 # Get boost flags
368 boost_cflags, boost_linkflags = find_boost_cflags()
369
370 # Get compiler
371 compiler = os.getenv("CXX", "g++")
372
373 # Set compiler options
374 compiler_options = " -Wall"
375 if not permissive:
376 compiler_options += " -Werror -pedantic"
377
378 # Always need ufc
379 compiler_options += " " + ufc_cflags
380
381 if bench:
382 info("Benchmarking activated")
383 compiler_options += " -O3 -march=native"
384 # Workaround for gcc bug: gcc is too eager to report array-bounds warning with -O3
385 compiler_options += " -Wno-array-bounds"
386
387 if debug:
388 info("Debugging activated")
389 compiler_options += " -g -O0"
390
391 info("Compiler options: %s" % compiler_options)
392
393 failures = []
394
395 # Iterate over all files
396 for f in header_files:
397 prefix = f.split(".h")[0]
398
399 # Options for all files
400 cpp_flags = compiler_options
401 ld_flags = ""
402
403 # Only add boost flags if necessary
404 needs_boost = prefix == "MathFunctions"
405 if needs_boost:
406 info("Additional compiler options for %s: %s" % (prefix, boost_cflags))
407 info("Additional linker options for %s: %s" % (prefix, boost_linkflags))
408 cpp_flags += " " + boost_cflags
409 ld_flags += " " + boost_linkflags
410
411 # Generate test code
412 filename = generate_test_code(f)
413
414 # Compile test code
415 command = "%s %s -o %s.bin %s.cpp %s" % \
416 (compiler, cpp_flags, prefix, prefix, ld_flags)
417 ok = run_command(command, verbose)
418
419 # Store compile command for easy reproduction
420 with open("%s.build" % (prefix,), "w") as f:
421 f.write(command + "\n")
422
423 # Check status
424 if ok:
425 info_green("%s OK" % prefix)
426 else:
427 info_red("%s failed" % prefix)
428 failures.append(prefix)
429
430 end()
431 return failures
432
433
434 def run_programs(bench, debug, verbose):
435 "Run generated programs."
436
437 # This matches argument parsing in the generated main files
438 bench = 'b' if bench else ''
439
440 # Get a list of all files
441 test_programs = sorted([f for f in os.listdir(".") if f.endswith(".bin")])
442
443 begin("Running generated programs (%d programs found)" % len(test_programs))
444
445 failures = []
446
447 # Iterate over all files
448 for f in test_programs:
449 # Compile test code
450 prefix = f.split(".bin")[0]
451 ok = run_command(".%s%s.bin %s" % (os.path.sep, prefix, bench), verbose)
452
453 # Check status
454 if ok:
455 info_green("%s OK" % f)
456 else:
457 info_red("%s failed" % f)
458 failures.append(f)
459 end()
460 return failures
461
462
463 def validate_programs(reference_dir):
464 "Validate generated programs against references."
465
466 # Get a list of all files
467 output_files = sorted(f for f in os.listdir(".") if f.endswith(".json"))
468
469 begin("Validating generated programs (%d .json program output files found)"
470 % len(output_files))
471
472 failures = []
473
474 # Iterate over all files
475 for fj in output_files:
476
477 # Get generated json output
478 if os.path.exists(fj):
479 generated_json_output = open(fj).read()
480 if "nan" in generated_json_output:
481 info_red("Found nan in generated json output, replacing with 999 to be able to parse as python dict.")
482 generated_json_output = generated_json_output.replace("nan",
483 "999")
484 else:
485 generated_json_output = "{}"
486
487 # Get reference json output
488 reference_json_file = os.path.join(reference_dir, fj)
489 if os.path.isfile(reference_json_file):
490 reference_json_output = open(reference_json_file).read()
491 else:
492 info_blue("Missing reference for %s" % reference_json_file)
493 reference_json_output = "{}"
494
495 # Compare json with reference using recursive diff algorithm
496 # TODO: Write to different error file?
497 from recdiff import recdiff, print_recdiff, DiffEqual
498 # Assuming reference is well formed
499 reference_json_output = eval(reference_json_output)
500 try:
501 generated_json_output = eval(generated_json_output)
502 except Exception as e:
503 info_red("Failed to evaluate json output for %s" % fj)
504 log_error(str(e))
505 generated_json_output = None
506 json_diff = (None if generated_json_output is None else
507 recdiff(generated_json_output, reference_json_output, tolerance=output_tolerance))
508 json_ok = json_diff == DiffEqual
509
510 # Check status
511 if json_ok:
512 info_green("%s OK" % fj)
513 else:
514 info_red("%s differs" % fj)
515 log_error("Json output differs for %s, diff follows (generated first, reference second)"
516 % os.path.join(*reference_json_file.split(os.path.sep)[-3:]))
517 print_recdiff(json_diff, printer=log_error)
518 failures.append(fj)
519
520 end()
521 return failures
522
523
524 def main(args):
525 "Run all regression tests."
526
527 # Check command-line arguments TODO: Use argparse
528 only_auto = "--only-auto" in args
529 use_auto = "--skip-auto" not in args
530 use_uflacs = "--skip-uflacs" not in args
531 use_quad = "--skip-quad" not in args
532 use_tsfc = "--use-tsfc" in args
533 use_ext_quad = "--ext-quad" in args
534 use_ext_uflacs = "--ext-uflacs" in args
535
536 skip_download = "--skip-download" in args
537 skip_run = "--skip-run" in args
538 skip_code_diff = "--skip-code-diff" in args
539 skip_validate = "--skip-validate" in args
540 bench = "--bench" in args
541 debug = "--debug" in args
542 verbose = ("--verbose" in args) or debug # debug implies verbose
543
544 permissive = "--permissive" in args or bench
545 tolerant = "--tolerant" in args
546 print_timing = "--print-timing" in args
547 show_help = "--help" in args
548
549 flags = (
550 "--only-auto",
551 "--skip-auto",
552 "--skip-uflacs",
553 "--skip-quad",
554 "--use-tsfc",
555 "--ext-quad",
556 "--skip-download",
557 "--skip-run",
558 "--skip-code-diff",
559 "--skip-validate",
560 "--bench",
561 "--debug",
562 "--verbose",
563 "--permissive",
564 "--tolerant",
565 "--print-timing",
566 "--help",
567 )
568 args = [arg for arg in args if arg not in flags]
569
570 # Hack: add back --verbose for ffc.main to see
571 if verbose:
572 args = args + ["--verbose"]
573
574 if show_help:
575 info("Valid arguments:\n" + "\n".join(flags))
576 return 0
577
578 if bench or not skip_validate:
579 skip_run = False
580 if bench:
581 skip_code_diff = True
582 skip_validate = True
583 if use_ext_quad or use_ext_uflacs:
584 skip_code_diff = True
585
586 # Extract .ufl names from args
587 only_forms = set([arg for arg in args if arg.endswith(".ufl")])
588 args = [arg for arg in args if arg not in only_forms]
589
590 # Download reference data
591 if skip_download:
592 info_blue("Skipping reference data download")
593 else:
594 try:
595 cmd = "./scripts/download"
596 output = subprocess.check_output(cmd, shell=True)
597 print(output)
598 info_green("Download reference data ok")
599 except subprocess.CalledProcessError as e:
600 print(e.output)
601 info_red("Download reference data failed")
602
603 if tolerant:
604 global output_tolerance
605 output_tolerance = 1e-3
606
607 # Clean out old output directory
608 output_directory = "output"
609 clean_output(output_directory)
610 os.chdir(output_directory)
611
612 # Adjust which test cases (combinations of compile arguments) to run here
613 test_cases = []
614 if only_auto:
615 test_cases += ["-r auto"]
616 else:
617 if use_auto:
618 test_cases += ["-r auto"]
619 if use_uflacs:
620 test_cases += ["-r uflacs -O0", "-r uflacs -O"]
621 if use_quad:
622 test_cases += ["-r quadrature -O0", "-r quadrature -O"]
623 import warnings
624 from ffc.quadrature.deprecation import QuadratureRepresentationDeprecationWarning
625 warnings.simplefilter("once", QuadratureRepresentationDeprecationWarning)
626 if use_tsfc:
627 test_cases += ["-r tsfc -O0", "-r tsfc -O"]
628 # Silence good-performance messages by COFFEE
629 import coffee
630 coffee.set_log_level(coffee.logger.PERF_WARN)
631 if use_ext_quad:
632 test_cases += ext_quad
633 if use_ext_uflacs:
634 test_cases += ext_uflacs
635
636 test_case_timings = {}
637
638 fails = OrderedDict()
639
640 for argument in test_cases:
641 test_case_timings[argument] = time.time()
642 fails[argument] = OrderedDict()
643
644 begin("Running regression tests with %s" % argument)
645
646 # Clear and enter output sub-directory
647 sub_directory = "_".join(argument.split(" ")).replace("-", "")
648 clean_output(sub_directory)
649 os.chdir(sub_directory)
650
651 # Workarounds for feature lack in representation
652 if "quadrature" in argument and not only_forms:
653 skip_forms = known_quad_failures
654 info_blue("Skipping forms known to fail with quadrature:\n" + "\n".join(sorted(skip_forms)))
655 elif "uflacs" in argument and not only_forms:
656 skip_forms = known_uflacs_failures
657 info_blue("Skipping forms known to fail with uflacs:\n" + "\n".join(sorted(skip_forms)))
658 elif "tsfc" in argument and not only_forms:
659 skip_forms = known_tsfc_failures
660 info_blue("Skipping forms known to fail with tsfc:\n" + "\n".join(sorted(skip_forms)))
661 else:
662 skip_forms = set()
663
664 # Generate test cases
665 generate_test_cases(bench, only_forms, skip_forms)
666
667 # Generate code
668 failures = generate_code(args + argument.split(), only_forms, skip_forms, debug)
669 if failures:
670 fails[argument]["generate_code"] = failures
671
672 # Location of reference directories
673 reference_directory = os.path.abspath("../../ffc-reference-data/")
674 code_reference_dir = os.path.join(reference_directory, sub_directory)
675
676 # Note: We use the r_auto references for all test cases. This
677 # ensures that we continously test that the codes generated by
678 # all different representations are equivalent.
679 output_reference_dir = os.path.join(reference_directory, "r_auto")
680
681 # Validate code by comparing to code generated with this set
682 # of compiler parameters
683 if skip_code_diff:
684 info_blue("Skipping code diff validation")
685 else:
686 failures = validate_code(code_reference_dir)
687 if failures:
688 fails[argument]["validate_code"] = failures
689
690 # Build and run programs and validate output to common
691 # reference
692 if skip_run:
693 info_blue("Skipping program execution")
694 else:
695 failures = build_programs(bench, permissive, debug, verbose)
696 if failures:
697 fails[argument]["build_programs"] = failures
698
699 failures = run_programs(bench, debug, verbose)
700 if failures:
701 fails[argument]["run_programs"] = failures
702
703 # Validate output to common reference results
704 if skip_validate:
705 info_blue("Skipping program output validation")
706 else:
707 failures = validate_programs(output_reference_dir)
708 if failures:
709 fails[argument]["validate_programs"] = failures
710
711 # Go back up
712 os.chdir(os.path.pardir)
713
714 end()
715 test_case_timings[argument] = time.time() - test_case_timings[argument]
716
717 # Go back up
718 os.chdir(os.path.pardir)
719
720 # Print results
721 if print_timing:
722 info_green("Timing of all commands executed:")
723 timings = '\n'.join("%10.2e s %s" % (t, name) for (name, t)
724 in _command_timings)
725 info_blue(timings)
726
727 for argument in test_cases:
728 info_blue("Total time for %s: %.1f s" % (argument, test_case_timings[argument]))
729
730 num_failures = sum(len(failures_phase)
731 for failures_args in fails.values()
732 for failures_phase in failures_args.values())
733
734 if num_failures == 0:
735 info_green("Regression tests OK")
736 return 0
737 else:
738 info_red("Regression tests failed")
739 info_red("")
740 info_red("Long summary:")
741 for argument in test_cases:
742 if not fails[argument]:
743 info_green(" No failures with args '%s'" % argument)
744 else:
745 info_red(" Failures with args '%s':" % argument)
746 for phase, failures in fails[argument].items():
747 info_red(" %d failures in %s:" % (len(failures), phase))
748 for f in failures:
749 info_red(" %s" % (f,))
750 info_red("")
751 info_red("Short summary:")
752 phase_fails = defaultdict(int)
753 for argument in test_cases:
754 if not fails[argument]:
755 info_green(" No failures with args '%s'" % argument)
756 else:
757 info_red(" Number of failures with args '%s':" % argument)
758 for phase, failures in fails[argument].items():
759 info_red(" %d failures in %s." % (len(failures), phase))
760 phase_fails[phase] += len(failures)
761 info_red("")
762 info_red("Total failures for all args:")
763 for phase, count in phase_fails.items():
764 info_red(" %s: %d failed" % (phase, count))
765 info_red("")
766 info_red("Error messages stored in %s" % logfile)
767 return 1
768
769
770 if __name__ == "__main__":
771 sys.exit(main(sys.argv[1:]))