Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5286 ディスカッション

the difference between the source function and function

去你的
ビギナー
3,945件の閲覧回数

Hi. 

I am trying using vtune to analysis the my code. When I use the microarchitecture analysis. It shows my code is terrible.

_0-1713135474237.png

Then I go to the bottom-up windows. Trying to see the which function causes this problem. When I choose Function/stack in group:

_1-1713135556869.png

It shows my four function run very well.(My four functions is update_slack ....)

But when I choose source / function / Call stack in group

It shows that:

_2-1713135676598.png

It seems that these functions cause my problem. But actually I even not use this function in my code!!.

I have two problem:
1, What is the difference between the source function and function.

2, I never use this function. How these functions appears in my profilers?

Best,

lzxdjb

 

 

0 件の賞賛
12 返答(返信)
yuzhang3_intel
モデレーター
3,884件の閲覧回数

Eigen is a C++ template library for linear algebra,  if your functions call these library functions? By default, the child processes will be analyzed by the VTune, if the functions are called by the processes? From the VTune result, the bottlenecks should be located in the library.

 

Hotspots analysis type with call stack can tell you the callers of the library functions.

去你的
ビギナー
3,881件の閲覧回数

I never call Eigen::internal::function;

In fact, These kind of functions even never appears in the Eigen library!

yuzhang3_intel
モデレーター
3,871件の閲覧回数

It is interesting.  Did you launch one application or profile system? Please post your command line.

去你的
ビギナー
3,869件の閲覧回数

I actually run a binary file in the VTune-gui. I do not run any command line. I think I just launch one application, put the binary file into it, and I run microarchitecture analysis.

yuzhang3_intel
モデレーター
3,867件の閲覧回数

Please share the binary if possible. I can try it locally.

去你的
ビギナー
3,855件の閲覧回数

This is the binary's zip. 

去你的
ビギナー
3,849件の閲覧回数

MY code actually use four function: update_slack update_primal update_dual update_linear_cost. I think this four functions should be the top of time. But actually I even could not find them since they cost so short time compare to those Eigen::internal  .... , that even not appear in Eigen library!

yuzhang3_intel
モデレーター
3,827件の閲覧回数

It looks like the binary is based on Mac OS? I can't run it on Windows and Ubuntu. Actually, VTune doesn't support Mac OS anymore.

去你的
ビギナー
3,803件の閲覧回数

I run it in ubuntu. I guess because binary can only run in local machine.

here is the source code:

you can first :

mkdir build

cd build

cmake ..

make

and the binary file is in the ../build/examples/original_tine_profile.

yuzhang3_intel
モデレーター
3,782件の閲覧回数

Failed to build.

yuzhang3@yuzhang3-10710:~/workspace/isvc_jira_ips/TinyMPC/build$ make
[ 16%] Building CXX object src/tinympc/CMakeFiles/tinympc.dir/admm.cpp.o
In file included from /home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/include/Eigen/Eigen.h:61,
from /home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/src/tinympc/types.hpp:3,
from /home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/src/tinympc/admm.hpp:3,
from /home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/src/tinympc/admm.cpp:4:
/home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/include/Eigen/Eigen/Core:39:52: error: missing binary operator before token "("
39 | #if EIGEN_COMP_MINGW && EIGEN_GNUC_STRICT_LESS_THAN(6,0,0)
| ^
/home/yuzhang3/workspace/isvc_jira_ips/TinyMPC/include/Eigen/Eigen/Core:185:10: fatal error: src/Core/arch/Default/ConjHelper.h: No such file or directory
185 | #include "src/Core/arch/Default/ConjHelper.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/tinympc/CMakeFiles/tinympc.dir/build.make:76: src/tinympc/CMakeFiles/tinympc.dir/admm.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:118: src/tinympc/CMakeFiles/tinympc.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

去你的
ビギナー
3,771件の閲覧回数

It is very strange though. 

_0-1713325860101.png

Try this one?

yuzhang3_intel
モデレーター
3,740件の閲覧回数

Built success. I captured one hotspot as attached. You can see the call stack information about Eigen.

yuzhang3_intel_0-1713340640516.png

 

返信