At some point job ordering was turned into a multi-layer sort. If any one key is equal, it will drop down to the next layer. I believe the order is job_sort_formula, fairshare, job_sort_key. Using these three, the only time you’ll likely get down to job_sort_key is if the fairshare entities are the same.
The reason the scheduler complains at you when you use both job_sort_formula and job_sort_key is that when the RFE was implemented, the formula was supposed to supplant job_sort_key. The scheduler complains that you shouldn’t use both together. As a note, it isn’t really supported by PBS. It just happens to work.
I checked the code and that error message is strange. It specifically checks of for a second job_sort_key before it is printed. I would have expected it to print with just one.
In any case, the direction we want to move in will be to deprecate job_sort_key. The formula can do much more that just a tiered sort on resources.
If you are using the master branch of PBS, you can embed fairshare into the formula. See this design doc
There is a slight bug in it right now. You need to to turn on fair_share in the sched_config for it to work properly.