How can I determine which switch the Infiniband subnet manager is running on?

Solution 1:

If your infrastructure servers can run OpenSM, they may also have the OFED stack utilities installed as well. If the commands are available, ibstat will tell you the SM's LID. Then use the LID in smpquery ND -L <LID> to get the node description of the node running the SM.

Solution 2:

If you have an OFED installed in your system and the package infiniband-diags you can use the command sminfo to list running subnet managers in the Infiniband network:

~ # sminfo 
sminfo: sm lid 18 sm guid 0x0000000, activity count 55554951 priority 0 state 3 SMINFO_MASTER      

It will list all known subnet managers for that node and the master subnet manager.