MPI_Bcast分段错误

rkr*_*ara 3 c parallel-processing mpi

我正在播放一个指向数组的指针

MPI_Bcast(&xd_sim_send, Nooflines_Sim, MPI_FLOAT, root, MPI_COMM_WORLD);
Run Code Online (Sandbox Code Playgroud)

从进程0开始,从0以外的进程接收此广播

MPI_Bcast(&xd_sim_recv, Nooflines_Sim, MPI_FLOAT, root, MPI_COMM_WORLD);
Run Code Online (Sandbox Code Playgroud)

当我尝试读取接收到的值时,我得到分段错误11.像这样

for(i=0; i<Numlines_Sim; i++)
printf("%f\n",xd_sim_recv[i]);fflush(stdout);
Run Code Online (Sandbox Code Playgroud)

这有什么不对,请你帮我解决一下吗?

Ram*_*uri 5

它没有发送指针,因为该指针在其他并行进程中将无效,而是发送缓冲区:

MPI_Bcast(xd_sim_send, Nooflines_Sim, MPI_FLOAT, root, MPI_COMM_WORLD);
Run Code Online (Sandbox Code Playgroud)