def add_topology_args(parser):
    """Add arguments for specifying SpiNNaker machine topologies and their
	folding."""
    topology_group = parser.add_argument_group('machine topology dimensions')
    system_size_group = topology_group.add_mutually_exclusive_group(required
        =True)
    system_size_group.add_argument('--num-boards', '-n', type=int, metavar=
        'N', help="build the 'squarest' system with this many boards")
    system_size_group.add_argument('--triads', '-t', type=int, nargs=2,
        metavar=('W', 'H'), help=
        'build a system with the specified number of triads of boards in each dimension (yielding 3*W*H boards)'
        )
    folding_group = parser.add_argument_group('topology folding options')
    folding_group.add_argument('--transformation', '-T', choices=['shear',
        'slice'], help=
        'the transformation function to use from hexagonal torus to rectangular Cartesian grid (selected automatically if omitted)'
        )
    folding_group.add_argument('--uncrinkle-direction', choices=['columns',
        'rows'], help=
        'direction in which to uncrinkle the hexagonal mesh to form a regular grid (default: rows)'
        )
    folding_group.add_argument('--folds', '-F', type=int, nargs=2, default=
        None, metavar=('X', 'Y'), help=
        'the number of pieces to fold into in each dimension (default: (2, 2)) ignored if --transformation is not given'
        )
