1. A method implemented in a high performance computing (HPC) environment including a plurality of compute nodes interconnected via a plurality of switches and links, the method comprising: identifying a set of compute nodes from among the plurality of compute nodes to participate in a collective group to perform collective operations; configuring a spanning tree comprising a plurality of nodes including the set of compute nodes and a set of switches interconnected by a plurality of links, the set of switches including edge switches connected to compute nodes and one or more levels of core switches including a core switch at the root of the spanning tree, wherein the spanning tree is configured such that each node in the spanning tree is enabled to communicate with each of the other nodes via a single respective specified route comprising at least one link segment; configuring each switch in the spanning tree to be aware of specified routes involving that switch and one or more message identifiers to be included in collective operation messages used to perform the collective operations; and at each switch, identifying collective operation messages and their destinations and forwarding the collective operations messages along link segments of the specified routes connected to that switch.