Ordering of Nodes

We are trying to work out a method so that nodes will be used in the order we’d like.
To try and illustrate this we have 3 groups lets call them: group1, group2 and group3.
group1 is made up of some nodes and also includes group3.
group2 is made up of a different set of nodes.

When jobs are submitted they should be placed on group1 nodes or group2 nodes roughly equally balancing between the two, i.e. if there are 4 jobs using 4 nodes. They should take 8 nodes from group1 and 8 nodes from group2.
group1 nodes should use all nodes that are NOT in group3 first, leaving group3 to be the last nodes selected.
Their should also be a method of selecting group3 either by specifying resource or a queue.

We have created resources for group1 and group2, and would submit with -l place=vscatter:excl:group=group

What we are struggling with is the group3 nodes only to be used last in group1.

Any ideas, would be most appreciated.

You can assign different priorities to nodes, like

set node <nodename> priority = <value>

Within each group, set equal priorities. Nodes belonging to groups with higher priority will get jobs first.