Commit 493e779847dd36345af68cc043bda7db3c393a08
- Diff rendering mode:
- inline
- side by side
sailfish/lbm.py
(6 / 1)
|   | |||
| 93 | 93 | grids = [x.__name__ for x in sym.KNOWN_GRIDS if x.dim == geo_class.dim] | |
| 94 | 94 | default_grid = grids[0] | |
| 95 | 95 | ||
| 96 | supported_backends = get_backends() | ||
| 97 | |||
| 98 | if not supported_backends: | ||
| 99 | raise ValueError('There are no supported compute backends on your system. Make sure pycuda or pyopencl are correctly installed.') | ||
| 100 | |||
| 96 | 101 | parser = OptionParser() | |
| 97 | 102 | ||
| 98 | 103 | parser.add_option('-q', '--quiet', dest='quiet', help='reduce verbosity', action='store_true', default=False) | |
| … | … | ||
| 126 | 126 | parser.add_option_group(group) | |
| 127 | 127 | ||
| 128 | 128 | group = OptionGroup(parser, 'Run mode settings') | |
| 129 | group.add_option('--backend', dest='backend', help='backend', type='choice', choices=get_backends(), default=get_backends()[0]) | ||
| 129 | group.add_option('--backend', dest='backend', help='backend', type='choice', choices=supported_backends, default=supported_backends[0]) | ||
| 130 | 130 | group.add_option('--benchmark', dest='benchmark', help='benchmark mode, implies no visualization', action='store_true', default=False) | |
| 131 | 131 | group.add_option('--max_iters', dest='max_iters', help='number of iterations to run in benchmark/batch mode', action='store', type='int', default=0) | |
| 132 | 132 | group.add_option('--batch', dest='batch', help='run in batch mode, with no visualization', action='store_true', default=False) |

