我试图在我的一个使用电围栏的程序中找到一些内存错误。我的程序使用 OpenMPI,当我尝试运行它时,它会出现以下回溯:
Program received signal SIGSEGV, Segmentation fault.
2001 ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: No such file or directory.
__memcpy_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2001
(gdb) bt
#0 __memcpy_ssse3_back ()
at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:2001
#1 0x00007ffff72d6b7f in ompi_ddt_copy_content_same_ddt ()
from /usr/lib/libmpi.so.0
#2 0x00007ffff72d4d0d in ompi_ddt_sndrcv () from /usr/lib/libmpi.so.0
#3 0x00007ffff72dd5b3 in PMPI_Allgather () from /usr/lib/libmpi.so.0
#4 0x00000000004394f1 in ppl::gvec<unsigned int>::gvec (this=0x7fffffffdd60,
length=1) at qppl/gvec.h:32
#5 0x0000000000434a35 in TreeBuilder::TreeBuilder (this=0x7fffffffdc60,
octree=..., mygbodytab=..., mylbodytab=..., cellpool=0x7fffef705fc8,
---Type <return> to continue, or q <return> to quit---
leafpool=0x7fffef707fc8, bodypool=0x7fffef6bdfc0) at treebuild.cxx:93
#6 0x000000000042fb6b in BarnesHut::BuildOctree (this=0x7fffffffde50)
at barnes.cxx:155
#7 0x000000000042af52 in BarnesHut::Run (this=0x7fffffffde50)
at barnes.cxx:386
#8 0x000000000042b164 in main (argc=1, argv=0x7fffffffe118) at barnes.cxx:435
我的代码的相关部分是:
me = spr_locale_id();
world_size = spr_num_locales();
my_elements = std::shared_ptr<T>(new T[1]);
world_element_pointers = std::shared_ptr<T*>(new T*[world_size]);
MPI_Allgather(my_elements.get(), sizeof(T*), MPI_BYTE,
world_element_pointers.get(), sizeof(T*), MPI_BYTE,
MPI_COMM_WORLD);
我不确定为什么 __memcpy_ssse3_back 会导致段错误。当我在没有电围栏的情况下运行时,这部分程序不会出现段错误。有谁知道发生了什么?我正在使用 openmpi 版本 1.4.3