
并行程序设计
文章平均质量分 71
koastal
这个作者很懒,什么都没留下…
展开
-
LU分解
由以上知识可以推导出:程序代码:#include int main(){ double a[5][5]={{0,0,0,0,0},{0,4,2,1,5},{0,8,7,2,10},{0,4,8,3,6},{0,6,8,4,9}}; double l[5][5]={0},u[5][5]={0}; //输出a printf("a:\n"); for(int i=1;i<5原创 2015-12-29 12:43:04 · 922 阅读 · 1 评论 -
采用 MPI_Send 和 MPI_Recv 编写代码来实现 MPI_Allgather 的功能
MPI_Allgather实现#include "stdio.h"#include "mpi.h"int main( int argc, char* argv[] ){ int i; int rank, nproc; int isend, irecv[32]; double start_time, end_time, time, cputime;原创 2016-01-20 15:29:21 · 3535 阅读 · 1 评论 -
LU 分解,采用行连续划分方式下的 MPI 实现
#include "stdio.h"#include "stdlib.h"#include "mpi.h"#define a(x,y) a[x*M+y]/*A为M*M矩阵*/#define A(x,y) A[x*M+y]#define l(x,y) l[x*M+y]#define u(x,y) u[x*M+y]#define floatsize sizeof(float)#def原创 2016-01-20 15:30:57 · 2554 阅读 · 1 评论 -
矩阵相乘FOX算法的mpi实现
#include "mpi.h"#include #include #include const int root_id = 0;const int max_procs_size = 16;int main(int argc,char *argv[]){ double start_time, end_time, time; int procs_id, procs_原创 2016-01-20 15:34:24 · 2749 阅读 · 2 评论 -
for编译制导语句
#include #include #define N 100#define CHUNKSIZE 10double a[N], b[N], c[N];int main () { int i, chunk; /* Some initializations */ for (i=0; i < N; i++) a[i]原创 2015-12-27 20:59:15 · 1247 阅读 · 0 评论 -
php多进程使用场景
安装pcntl扩展php多进程模块依赖pcntl扩展,官方手册介绍:http://php.net/manual/zh/book.pcntl.php Note: 1. 此扩展在 Windows 平台上不可用。 2. 进程控制不能被应用在Web服务器环境,当其被用于Web服务环境时可能会带来意外的结果。因此,不能再PHP Web开发中使用多进程。# 通过pecl安装pcntl扩展s原创 2017-09-04 12:39:16 · 6146 阅读 · 0 评论