Intel VTune Profiler shows __mulq is a computationally expensive function in a fortran code

Viewed 129

I'm trying to perform an audit on a rather complicated multi-physics model I'm working on and have been using Intel VTune Profiler to identify expensive subroutines. The most expensive function is a function called __mulq which is not something within the source code. I can see which subroutines are calling it, but I cannot figure out what exactly it is. I'm using the Intel fortran compiler. I have also tried using grep to search for __mulq within the directory containing all the code, and the only mentions of __mulq are within binary files. Can someone identify what this __mulq function may be? Thank you so much for your help!

1 Answers

By using the Bottom up pane in vtune you would be able to figure out the call stack, and traversing through source code and assembly, get to know which library or module makes use of the mulq function

From x86 guides it could be seen mulq instructions store the result of multiplying two 64-bit values—the first as given by the source operand, and the second from register %rax. As mulq instructions are low level in the assembly and these might be from a library or any module you are using in code. If you are able to figure out the function/module which makes use of mulq function, you could try making changes to the module to either use a diff implementation or reduce calls which reslut in mulq instruction. FOr eg if this is a third party library you could look for optimised alternatives.

Related