我一直在尝试编译和运行 LULESH 基准测试
https://codesign.llnl.gov/lulesh.php
https://codesign.llnl.gov/lulesh/lulesh2.0.3.tgz
使用 gprof 但我总是遇到段错误。我在 Makefile 中更新了这些说明:
CXXFLAGS = -g -pg -O3 -I. -Wall
LDFLAGS = -g -pg -O3
[andrestoga@n01 lulesh2.0.3]$ mpirun -np 8 ./lulesh2.0 -s 16 -p -i 10
--------------------------------------------------------------------------
mpirun noticed that process rank 2 with PID 30557 on node n01 exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------
在 gprof 的网页上说如下:
If you are running the program on a system which supports shared libraries you may run into problems with the profiling support code in a shared library being called before that library has been fully initialised. This is usually detected by the program encountering a segmentation fault as soon as it is run. The solution is to link against a static version of the library containing the profiling support code, which for gcc users can be done via the
-static' or
-static-libgcc' command line option. For example:gcc -g -pg -static-libgcc myprog.c utils.c -o myprog
我添加了 -static 命令行选项,但我也遇到了段错误。
我找到了一个 pdf,他们通过添加命令行选项 -pg 更新 Makefile 来分析 LULESH。虽然他们没有说他们所做的改变。
http://periscope.in.tum.de/releases/latest/pdf/PTF_Best_Practices_Guide.pdf
第 11 页
有人能帮帮我吗?
最好的,
最佳答案
确保加载所有库:
- openmpi(您已经完成)
- 海湾合作委员会
您可以尝试使用参数来确定问题是否出在您的机器的资源方面。如果机器不支持这样数量的进程,请通过查看架构拓扑查看它支持多少进程(MPI 或不支持 MPI)。这将使您能够确定可以在系统中启动的作业/进程的正确数量。
非常快的运行:
mpirun -np 1 ./lulesh2.0 -s 1 -p -i 1
Running problem size 1^3 per domain until completion
Num processors: 1
Num threads: 2
Total number of elements: 1
To run other sizes, use -s <integer>.
To run a fixed number of iterations, use -i <integer>.
To run a more or less balanced region set, use -b <integer>.
To change the relative costs of regions, use -c <integer>.
To print out progress, use -p
To write an output file for VisIt, use -v
See help (-h) for more options
cycle = 1, time = 1.000000e-02, dt=1.000000e-02
Run completed:
Problem size = 1
MPI tasks = 1
Iteration count = 1
Final Origin Energy = 4.333329e+02
Testing Plane 0 of Energy Array on rank 0:
MaxAbsDiff = 0.000000e+00
TotalAbsDiff = 0.000000e+00
MaxRelDiff = 0.000000e+00
Elapsed time = 0.00 (s)
Grind time (us/z/c) = 518 (per dom) ( 518 overall)
FOM = 1.9305019 (z/s)
关于c++ - 将 gprof 与 LULESH 基准结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33745565/