- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经尝试了两天多,想看看我犯了什么错误,但我找不到任何东西。我不断收到以下错误:
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= EXIT CODE: 139
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions
make: *** [run] Error 139
所以问题在 MPI_BCAST
和我有 MPI_GATHER
的另一个函数中很明显。你能帮我找出问题所在吗?当我编译代码时,我输入以下内容:
/usr/bin/mpicc -I/usr/include -L/usr/lib z.main.c z.mainMR.c z.mainWR.c -o 1dcode -g -lm
对于运行:
usr/bin/mpirun -np 2 ./1dcode dat.txt o.out.txt
例如我的代码包含这个函数:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include "functions.h"
#include <mpi.h>
/*...................z.mainMR master function............. */
void MASTER(int argc, char *argv[], int nPROC, int nWRs, int mster)
{
/*... Define all the variables we going to use in z.mainMR function..*/
double tend, dtfactor, dtout, D, b, dx, dtexpl, dt, time;
int MM, M, maxsteps, nsteps;
FILE *datp, *outp;
/*.....Reading the data file "dat" then saving the data in o.out.....*/
datp = fopen(argv[1],"r"); // Open the file in read mode
outp = fopen(argv[argc-1],"w"); // Open output file in write mode
if(datp != NULL) // If data file is not empty continue
{
fscanf(datp,"%d %lf %lf %lf %lf %lf",&MM,&tend,&dtfactor,&dtout,&D,&b); // read the data
fprintf(outp,"data>>>\nMM=%d\ntend=%lf\ndtfactor=%lf\ndtout=%lf\nD=%lf\nb=%lf\n",MM,tend,dtfactor,dtout,D,b);
fclose(datp); // Close the data file
fclose(outp); // Close the output file
}
else // If the file is empty then print an error message
{
printf("There is something wrong. Maybe file is empty.\n");
}
/*.... Find dx, M, dtexpl, dt and the maxsteps........*/
dx = 1.0/ (double) MM;
M = b * MM;
dtexpl = (dx * dx) / (2.0 * D);
dt = dtfactor * dtexpl;
maxsteps = (int)( tend / dt ) + 1;
/*...Pack integers in iparms array, reals in parms array...*/
int iparms[2] = {MM,M};
double parms[4] = {dx, dt, D, b};
MPI_BCAST(iparms,2, MPI_INT,0,MPI_COMM_WORLD);
MPI_BCAST(parms, 4, MPI_DOUBLE,0, MPI_COMM_WORLD);
}
最佳答案
运行时错误是由于 MPICH 的特定特性和 C 语言的特性的不幸组合造成的。
MPICH 在单个库文件中同时提供 C 和 Fortran 接口(interface)代码:
000000000007c7a0 W MPI_BCAST
00000000000cd180 W MPI_Bcast
000000000007c7a0 W PMPI_BCAST
00000000000cd180 T PMPI_Bcast
000000000007c7a0 W mpi_bcast
000000000007c7a0 W mpi_bcast_
000000000007c7a0 W mpi_bcast__
000000000007c7a0 W pmpi_bcast
000000000007c7a0 T pmpi_bcast_
000000000007c7a0 W pmpi_bcast__
Fortran 调用以各种别名导出,以便同时支持许多不同的 Fortran 编译器,包括全部大写的 MPI_BCAST
。 MPI_BCAST
本身未在 mpi.h
中声明,但 ANSI C 允许调用函数而无需预先声明原型(prototype)。通过将 -std=c99
传递给编译器来启用 C99 会导致关于 MPI_BCAST
函数的隐式声明的警告。 -Wall
也会导致警告。代码将无法与 Open MPI 链接,Open MPI 在单独的库中提供 Fortran 接口(interface),mpicc
未链接到该库。
即使代码编译和链接正确,Fortran 函数也期望它们的所有参数都通过引用传递。此外,Fortran MPI 调用采用一个额外的输出参数,用于返回错误代码。因此段错误。
为防止以后出现此类错误,请使用-Wall -Werror
进行编译,这样可以尽早捕获类似问题。
关于c - MPI 段错误(信号 11),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33283681/
是否有等级编号对组编号的概括?对于我的代码,我想创建 MPI::COMM_WORLD 的分层分解。假设我们使用 16 个线程。我使用 MPI::COMM_WORLD.Split 创建 4 个通信器,每
能够使用多个节点执行 MPI 作业以加快流程 这是我目前使用的命令: mpirun --hostfile myhost -np 2 --map-by slot Job.x//只在第一个节点执行 mpi
我想创建一个新的通信器,它只保留处理中使用的行列,如果我有 24 个可用处理器而我只需要 10 个,那么该组应该只保留这 10 个,否则它将保留所有他们。出于某种原因,当我尝试创建一个通信器时,一切都
我正在开发一些程序,而不是在每个节点上有 4 个内核的 4 节点集群上运行。我有一个非常快的 OpenMP 版本的程序,它只在一个集群上运行,我正在尝试使用 MPI 扩展它。由于我的经验有限,我想知道
这是我尝试在 MPI 中编写经典平滑像素平均算法的代码。我几乎让它工作了,但是光晕交换发生了一些奇怪的事情,因为可以看到边缘的线条。我似乎找不到错误。我是否正确地交换了光环?我应该收集最终数组的哪一部
我有兴趣使用 MPI(消息传递接口(interface))实现一种事件驱动的调度队列。我要解决的基本问题是:我有一个主进程,它将作业插入全局队列,每个可用的从进程检索队列中的下一个作业(如果有的话)。
当我们在集群上使用命令 say mpirun -np 4 a.out 启动 MPI 程序时,然后MPI 运行时系统如何跨 CPU 分配进程? 我的意思是,假设它在集群中找到一个空闲的四核 CPU,它会
使用 mpirun 启动 MPI 作业时或 mpiexec ,我可以理解人们如何开始每个单独的过程。但是,如果没有任何编译器魔法,这些包装器可执行文件如何将安排(MPI 通信器)传达给 MPI 进程?
MPI 中的等级和进程有什么区别? 最佳答案 Here是我从中学习所有 MPI 的资源,您可能会发现它很有用。 关于你的问题:流程 是正在运行的程序的实际实例。 MPI 允许您创建逻辑 团体进程,并且
MPI 障碍的时间复杂度是多少?它们是否可以扩展到大量核心(>> 10k)? 最佳答案 屏障复杂性与实现高度相关。它可以是线性的,可以是对数的,也可以是更好或更差。某些架构为某些集体操作提供专用网络,
我正在尝试 MPI,想知道这段代码是否会导致死锁。 MPI_Comm_rank (comm, &my_rank); if (my_rank == 0) { MPI_Send (sendbuf,
我有一个简单的 MPI 代码,可以打印出进程的等级,使用 Intel 编译器和 MPI 库进行编译和链接。然后我在集群的主节点上以交互方式运行它:mpiexec -n 50 ./a.out该节点只有
我正在尝试使用 mpi run 使用扭矩调度程序来运行我的程序。虽然在我的 pbs 文件中我通过 加载了所有库 export LD_LIBRARY_PATH=/path/to/library 但它给出
我在所有等级上都有一个相同长度的数组(假设为 10)。数组中的某些值包含处理器的等级。例如 ... Proc 1: [1 0 0 0 0 1 0 0 0 1] Proc 2: [0 2 2 0 0 0
我想在集群中的每台机器上独立地轻松执行集体通信。假设我有 4 台机器,每台机器有 8 个内核,我的 MPI 程序将运行 32 个 MPI 任务。对于给定的功能,我想要的是: 在每个主机上,只有一个任务
我希望能够获得某个通信器的唯一 ID,但是当您通过 MPI_Comm_split() 调用获得此通信器时,这似乎是一项不可能完成的任务。我知道什么时候 MPI_Comm_split() 被集体调用,每
非阻塞发送/接收立即在 MPI 中返回,操作在后台完成。我看到这种情况发生的唯一方法是当前进程/线程调用/创建另一个进程/线程并将发送/接收代码的图像加载到其中并返回。然后这个新进程/线程完成这个操作
冗长的背景 我正在为心脏电生理学模拟并行处理一些代码。由于用户可以使用内置脚本语言指定他们自己的模拟,我无法知道如何在通信与计算之间进行权衡。为了解决这个问题,我正在制作一种运行时分析器,一旦看到要运
我打算做一些并行计算,我完全是这方面的初学者。我将使用 MPI 来完成并行工作,采用 Master-Slave 模型。我现在有四台机器,希望其中一台作为主节点。但是,我不知道如何指定运行该程序的其他机
我可以在我的大学使用 PelicanHPC 访问集群网络,其中运行各种 MPI 程序,但在家里我想练习编写/使用其他 MPI 程序。有没有办法在我自己的系统上运行 MPI 程序? (我在 Ubuntu
我是一名优秀的程序员,十分优秀!