Open Yidasvc opened 10 months ago
您好!我执行example中的例子,会出现以它为首的错误:
PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument
查看源码,我看到sampler.cpp中的函数
void SamplerImpl::Setup()
:void SamplerImpl::Setup() { TRY(PAPI_library_init(PAPI_VER_CURRENT), PAPI_VER_CURRENT); TRY(PAPI_thread_init(pthread_self), PAPI_OK); }
其中,
PAPI_VERSION
为0x07010000
:#define PAPI_VERSION PAPI_VERSION_NUMBER(7,1,0,0) #define PAPI_VER_CURRENT (PAPI_VERSION & 0xffff0000)
我执行
papi_avail
查看PAPI版本,与PAPI_VERSION一致:> papi_avail Available PAPI preset and user defined events plus hardware information. -------------------------------------------------------------------------------- PAPI version : 7.1.0.0 Operating system : Linux 6.2.0-39-generic ...
因此,我似乎没找到错误原因,因此向您请教为什么会出现下列错误。 完整输出:
> python3 ./pag_validation.py /home/ubuntu/demo/PerFlow/build/example/AE/pag_validation/cg.B.x-8p-20231227-183126/static_data/cg.B.x.pag 0.18user 0.09system 0:00.10elapsed 271%CPU (0avgtext+0avgdata 79360maxresident)k 256inputs+744outputs (30major+17419minor)pagefaults 0swaps original_GOMP_parallel = 0x7f1385e769d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f524050b9d0 original_GOMP_parallel = 0x7fb6552769d0 original_GOMP_parallel = 0x7fa3702b69d0 original_GOMP_parallel = 0x7fbc5730b9d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f862de769d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f17bf90b9d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7fc84e2c29d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7fd4e18c29d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7fbc57c23960 in ??? #1 0x7fbc57c22ac5 in ??? #2 0x7fbc5784251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fbc57b31d2b in ??? #4 0x7fbc58015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fbc58015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fbc58015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x562f9e498a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x562f9e498b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x562f9e49627e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fb655c23960 in ??? #1 0x7fb655c22ac5 in ??? #2 0x7fb65584251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fb655b31d2b in ??? #0 0x7fa370823960 in ??? #1 0x7fa370822ac5 in ??? #2 0x7fa37044251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fa370731d2b in ??? #4 0x7fb656015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fb656015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fb656015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x561c6d00aa71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x561c6d00ab4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x561c6d00827e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #4 0x7fa370c15b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fa370c15bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fa370c15c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x5629a6491a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x5629a6491b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x5629a648f27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7f17c0223960 in ??? #1 0x7f17c0222ac5 in ??? #2 0x7f17bfe4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f17c0131d2b in ??? #4 0x7f17c0615b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f17c0615bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f17c0615c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x5600b6a1ea71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x5600b6a1eb4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x5600b6a1c27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fc84ec23960 in ??? #1 0x7fc84ec22ac5 in ??? #2 0x7fc84e84251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fc84eb31d2b in ??? #4 0x7fc84f015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fc84f015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fc84f015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x558c25332a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x558c25332b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x558c2533027e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7f5240e23960 in ??? #1 0x7f5240e22ac5 in ??? #2 0x7f5240a4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f5240d31d2b in ??? #0 0x7f862e823960 in ??? #1 0x7f862e822ac5 in ??? #2 0x7f862e44251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f862e731d2b in ??? #4 0x7f5241215b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f5241215bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f5241215c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #4 0x7f862ec15b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f862ec15bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f862ec15c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x55fc7f738a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55fc7f738b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55fc7f73627e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #7 0x55b032a76a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55b032a76b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55b032a7427e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fd4e2223960 in ??? #1 0x7fd4e2222ac5 in ??? #2 0x7fd4e1e4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fd4e2131d2b in ??? #4 0x7fd4e2615b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fd4e2615bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fd4e2615c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x55f4772aea71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55f4772aeb4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55f4772ac27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 -------------------------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. -------------------------------------------------------------------------- -------------------------------------------------------------------------- mpirun noticed that process rank 5 with PID 0 on node miracle24 exited on signal 11 (Segmentation fault). -------------------------------------------------------------------------- PAPI_stop(EventSet, NULL), ErrCode: No such EventSet available $BAGUA_DIR/build/builtin/comm_dep_approxi_analysis 8 cg.B.x-8p-20231227-183126 cg.B.x.dep Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID0.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID1.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID2.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID3.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID4.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID5.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID6.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID7.TXT file time $BAGUA_DIR/build/builtin/tools/mpi_pag_generation cg.B.x cg.B.x-8p-20231227-183126 8 0 cg.B.x.dep Reading CFG costs 0.005416 seconds. Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+0.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+1.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+2.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+3.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+4.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+5.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+6.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+7.TXT Reading perf data costs 8.5e-05 seconds. Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+0.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+1.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+2.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+3.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+4.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+5.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+6.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+7.TXT [..lysis/graph_perf.cpp:138 (GenerateDynAddrDebugInfo)] binary_name = "cg.B.x" (std::string&) [..lysis/graph_perf.cpp:138 (GenerateDynAddrDebugInfo)] binary_name = "cg.B.x" (std::string&) Processing dynamic perf data costs 0.000109 seconds. Reading and generating PCG cost 0.004015 seconds. Generating PAG costs 4.2e-05 seconds. Data embedding costs 0 seconds. Convert reduced data to percent costs 0.000148 seconds. Pruning costs 3.4e-05 seconds. Dumpping pag & pag perf data costs 0.000156 seconds. Generating MPAG costs 0.000239 seconds. Adding comm edges costs 1e-06 seconds. Dumpping pag-mpag map costs 3.2e-05 seconds. Dumpping mpag perf data costs 2.2e-05 seconds. 0.000000 Reduce data costs 0.000612 seconds. Dumpping mpag costs 0.000531 seconds. 0.01user 0.00system 0:00.02elapsed 95%CPU (0avgtext+0avgdata 19968maxresident)k 0inputs+48outputs (0major+1646minor)pagefaults 0swaps Traceback (most recent call last): File "/home/ubuntu/demo/PerFlow/build/example/AE/pag_validation/./pag_validation.py", line 12, in <module> tdpag, ppag = pflow.run(binary = "cg.B.x", cmd = "mpirun -np 8 ./cg.B.x", nprocs = 8) File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 231, in run self.readPag() File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 180, in readPag self.getPpagToTdpagMap() File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 186, in getPpagToTdpagMap for tdpag_v_str, pid_to_ppag in self.tdpag_to_ppag_map.items(): AttributeError: 'NoneType' object has no attribute 'items'
你好,很高兴关注PerFlow,目前的状态看起来已经过了静态分析部分,动态分析部分有问题。
我在AMD和Intel的cpu上用PAPI-5.,6.,7.1都可以运行,我怀疑是平台问题,请问您用的是什么平台?虚拟机?
另外,因为cg.B.x是我这边编好的binary,请确认直接运行mpirun -np 8 ./cg.B.x是否可以执行。
你好,感谢回复。我直接运行mpirun -np 8 ./cg.B.x可以执行,我看到了:
Benchmark completed
VERIFICATION SUCCESSFUL
我的CPU是AMD Ryzen 7 3800XT 8-Core Processor,开启超线程,非虚拟机。 操作系统信息如下(uname -a):
Linux ubuntu 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
您好!我执行example中的例子,会出现以它为首的错误:
PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument
查看源码,我看到sampler.cpp中的函数
void SamplerImpl::Setup()
:void SamplerImpl::Setup() { TRY(PAPI_library_init(PAPI_VER_CURRENT), PAPI_VER_CURRENT); TRY(PAPI_thread_init(pthread_self), PAPI_OK); }
其中,
PAPI_VERSION
为0x07010000
:#define PAPI_VERSION PAPI_VERSION_NUMBER(7,1,0,0) #define PAPI_VER_CURRENT (PAPI_VERSION & 0xffff0000)
我执行
papi_avail
查看PAPI版本,与PAPI_VERSION一致:> papi_avail Available PAPI preset and user defined events plus hardware information. -------------------------------------------------------------------------------- PAPI version : 7.1.0.0 Operating system : Linux 6.2.0-39-generic ...
因此,我似乎没找到错误原因,因此向您请教为什么会出现下列错误。 完整输出:
> python3 ./pag_validation.py /home/ubuntu/demo/PerFlow/build/example/AE/pag_validation/cg.B.x-8p-20231227-183126/static_data/cg.B.x.pag 0.18user 0.09system 0:00.10elapsed 271%CPU (0avgtext+0avgdata 79360maxresident)k 256inputs+744outputs (30major+17419minor)pagefaults 0swaps original_GOMP_parallel = 0x7f1385e769d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f524050b9d0 original_GOMP_parallel = 0x7fb6552769d0 original_GOMP_parallel = 0x7fa3702b69d0 original_GOMP_parallel = 0x7fbc5730b9d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f862de769d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7f17bf90b9d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7fc84e2c29d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available original_GOMP_parallel = 0x7fd4e18c29d0 PAPI_library_init(PAPI_VER_CURRENT), ErrCode: Invalid argument PAPI_thread_init(pthread_self), ErrCode: PAPI hasn't been initialized yet SET sampling interval to 3100000 cycles PAPI_create_eventset(&(EventSet)), ErrCode: PAPI hasn't been initialized yet PAPI_add_events(EventSet, (int *)Events, NUM_EVENTS), ErrCode: No such EventSet available PAPI_overflow(EventSet, PAPI_TOT_CYC, this->cyc_sample_count, 0, _papi_overflow_handler), ErrCode: No such EventSet available PAPI_start(EventSet), ErrCode: No such EventSet available Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7fbc57c23960 in ??? #1 0x7fbc57c22ac5 in ??? #2 0x7fbc5784251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fbc57b31d2b in ??? #4 0x7fbc58015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fbc58015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fbc58015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x562f9e498a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x562f9e498b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x562f9e49627e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fb655c23960 in ??? #1 0x7fb655c22ac5 in ??? #2 0x7fb65584251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fb655b31d2b in ??? #0 0x7fa370823960 in ??? #1 0x7fa370822ac5 in ??? #2 0x7fa37044251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fa370731d2b in ??? #4 0x7fb656015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fb656015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fb656015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x561c6d00aa71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x561c6d00ab4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x561c6d00827e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #4 0x7fa370c15b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fa370c15bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fa370c15c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x5629a6491a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x5629a6491b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x5629a648f27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7f17c0223960 in ??? #1 0x7f17c0222ac5 in ??? #2 0x7f17bfe4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f17c0131d2b in ??? #4 0x7f17c0615b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f17c0615bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f17c0615c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x5600b6a1ea71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x5600b6a1eb4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x5600b6a1c27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fc84ec23960 in ??? #1 0x7fc84ec22ac5 in ??? #2 0x7fc84e84251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fc84eb31d2b in ??? #4 0x7fc84f015b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fc84f015bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fc84f015c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x558c25332a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x558c25332b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x558c2533027e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7f5240e23960 in ??? #1 0x7f5240e22ac5 in ??? #2 0x7f5240a4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f5240d31d2b in ??? #0 0x7f862e823960 in ??? #1 0x7f862e822ac5 in ??? #2 0x7f862e44251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7f862e731d2b in ??? #4 0x7f5241215b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f5241215bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f5241215c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #4 0x7f862ec15b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7f862ec15bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7f862ec15c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x55fc7f738a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55fc7f738b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55fc7f73627e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #7 0x55b032a76a71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55b032a76b4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55b032a7427e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 #0 0x7fd4e2223960 in ??? #1 0x7fd4e2222ac5 in ??? #2 0x7fd4e1e4251f in ??? at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 #3 0x7fd4e2131d2b in ??? #4 0x7fd4e2615b94 in MPI_Init at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:460 #5 0x7fd4e2615bf5 in MPI_Init_fortran_wrapper at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:470 #6 0x7fd4e2615c90 in mpi_init_ at /home/ubuntu/demo/PerFlow/builtin/src/hybrid_collector/dynamic/mpi_tracer.cpp:486 #7 0x55f4772aea71 in initialize_mpi_ at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:504 #8 0x55f4772aeb4a in cg at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:88 #9 0x55f4772ac27e in main at /home/jinyuyang/APP/NPB3.4.2/NPB3.4-MPI/CG/cg.f90:53 -------------------------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. -------------------------------------------------------------------------- -------------------------------------------------------------------------- mpirun noticed that process rank 5 with PID 0 on node miracle24 exited on signal 11 (Segmentation fault). -------------------------------------------------------------------------- PAPI_stop(EventSet, NULL), ErrCode: No such EventSet available $BAGUA_DIR/build/builtin/comm_dep_approxi_analysis 8 cg.B.x-8p-20231227-183126 cg.B.x.dep Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID0.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID1.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID2.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID3.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID4.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID5.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID6.TXT file Failed to open cg.B.x-8p-20231227-183126/dynamic_data/MPID7.TXT file time $BAGUA_DIR/build/builtin/tools/mpi_pag_generation cg.B.x cg.B.x-8p-20231227-183126 8 0 cg.B.x.dep Reading CFG costs 0.005416 seconds. Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+0.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+1.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+2.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+3.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+4.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+5.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+6.TXT Failed to open cg.B.x-8p-20231227-183126/dynamic_data/SAMPLE+7.TXT Reading perf data costs 8.5e-05 seconds. Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+0.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+1.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+2.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+3.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+4.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+5.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+6.TXT Failed to opencg.B.x-8p-20231227-183126/dynamic_data/SOMAP+7.TXT [..lysis/graph_perf.cpp:138 (GenerateDynAddrDebugInfo)] binary_name = "cg.B.x" (std::string&) [..lysis/graph_perf.cpp:138 (GenerateDynAddrDebugInfo)] binary_name = "cg.B.x" (std::string&) Processing dynamic perf data costs 0.000109 seconds. Reading and generating PCG cost 0.004015 seconds. Generating PAG costs 4.2e-05 seconds. Data embedding costs 0 seconds. Convert reduced data to percent costs 0.000148 seconds. Pruning costs 3.4e-05 seconds. Dumpping pag & pag perf data costs 0.000156 seconds. Generating MPAG costs 0.000239 seconds. Adding comm edges costs 1e-06 seconds. Dumpping pag-mpag map costs 3.2e-05 seconds. Dumpping mpag perf data costs 2.2e-05 seconds. 0.000000 Reduce data costs 0.000612 seconds. Dumpping mpag costs 0.000531 seconds. 0.01user 0.00system 0:00.02elapsed 95%CPU (0avgtext+0avgdata 19968maxresident)k 0inputs+48outputs (0major+1646minor)pagefaults 0swaps Traceback (most recent call last): File "/home/ubuntu/demo/PerFlow/build/example/AE/pag_validation/./pag_validation.py", line 12, in <module> tdpag, ppag = pflow.run(binary = "cg.B.x", cmd = "mpirun -np 8 ./cg.B.x", nprocs = 8) File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 231, in run self.readPag() File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 180, in readPag self.getPpagToTdpagMap() File "/home/ubuntu/demo/PerFlow/python/perflow.py", line 186, in getPpagToTdpagMap for tdpag_v_str, pid_to_ppag in self.tdpag_to_ppag_map.items(): AttributeError: 'NoneType' object has no attribute 'items'
你好,很高兴关注PerFlow,目前的状态看起来已经过了静态分析部分,动态分析部分有问题。
我在AMD和Intel的cpu上用PAPI-5.,6.,7.1都可以运行,我怀疑是平台问题,请问您用的是什么平台?虚拟机?
另外,因为cg.B.x是我这边编好的binary,请确认直接运行mpirun -np 8 ./cg.B.x是否可以执行。
你好,感谢回复。我直接运行mpirun -np 8 ./cg.B.x可以执行,我看到了:
Benchmark completed
VERIFICATION SUCCESSFUL
我的CPU是AMD Ryzen 7 3800XT 8-Core Processor,开启超线程,非虚拟机。 操作系统信息如下(uname -a):
Linux ubuntu 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
您好!我执行example中的例子,会出现以它为首的错误:
查看源码,我看到sampler.cpp中的函数
void SamplerImpl::Setup()
:其中,
PAPI_VERSION
为0x07010000
:我执行
papi_avail
查看PAPI版本,与PAPI_VERSION一致:因此,我似乎没找到错误原因,因此向您请教为什么会出现下列错误。 完整输出: