I would like to have any direct control of CPU core clocks. Is this possible on new MacBooks and macOS ?
Underclocking in Mathematica
While running some specific calculations in Mathematica it happens that the CPU gets underclocked from 2.9G to 2.3G in serial and even to 1.5G during parallel computations. This might be Mathematica related, but so far I see no reason for underclocking so heavily. At the start of computation the Turbo Boost is acting, the clock speed is higher and then after about a minute it abruptly reduces, simultaneously after the CPU temperature touches 100C. The average temperature is probably 80C, but with Turbo Boost adjusting the clock, at some point temperature touches 100C and the CPU gets underclocked. The temperature reduces to ~60C, but until the end of computation this process never gets higher CPU nor Turbo Boost. After some more time (5-10 minutes) it will underclock for the second time, although the temperature is stable.
However, if I run another application on the side, the Intel Power Gadget can read higher core frequency (it shows just the average or the maximum, not per core/thread). Also the total core power increases, but only while this second process is running, as if the Mathematica process is forbidden to use CPU on higher clock. It's like the OS does not allow higher CPU frequency for the "dangerous" thread, although the temperature can decrease eventually to <50C.
Mathematica task is long but does not change in nature, it multiplies big matrices over and over again just with different numbers.
All of this is followed with fans running on higher than default speeds, because I increase them with the Control tool. I am absolutely sure the system could support higher CPU frequency during this, but it does not go for it. My suspicion is on OS, since CPU does not even reach to throttle and there is a clear process preference. Increasing the process' priority did not make a change.
I am not sure about what is happening here, which is the reason I give longer description of the problem. Also because there might be a different solution to it other than changing the frequency manually, especially if this is impossible to do.