MPI与OpenMP并行计算的实验报告及源程序


MPI与OpenMP的一些并行计算代码和实验报告
资源截图
代码片段和文件信息
#include
#include“mpi.h“

int main(int argc char** argv)
{
        int taskid ntasks;
        int ierr;
        MPI_Init(&argc &argv);
        MPI_Comm_rank(MPI_COMM_WORLD &taskid);
        MPI_Comm_size(MPI_COMM_WORLD &ntasks);

        if(taskid == 0) { printf(“

“); }
        ierr = MPI_Barrier(MPI_COMM_WORLD);
        if(taskid == 0) { printf(“一“); fflush(stdout);}
        if(taskid == 1) { printf(“二“); fflush(stdout);}
        if(taskid == 2) { printf(“三“); fflush(stdout);}
        if(taskid == 3) { printf(“四“); fflush(stdout);}

        ierr = MPI_Barrier(MPI_COMM_WORLD);
        if(taskid == 0) { printf(“ (无序)
“); fflush(stdout);}
        if(taskid == 0) { printf(“一“); fflush(stdout);}
        ierr = MPI_Barrier(MPI_COMM_WORLD);

        if(taskid == 1) { printf(“二“); fflush(stdout);}
        ierr = MPI_Barrier(MPI_COMM_WORLD);

        if(taskid == 2) { printf(“三“); fflush(stdout);}
        ierr = MPI_Barrier(MPI_COMM_WORLD);

        if(taskid == 3) { printf(“四“); fflush(stdout);}
        ierr = MPI_Barrier(MPI_COMM_WORLD);

        if(taskid == 0) { printf(“ (有序)

“);}
        MPI_Finalize();
        return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    2001000  2016-12-20 19:06  源程序MPIa.txt

     文件    2001000  2016-12-20 19:07  源程序MPI.txt

     文件       1183  2016-12-23 22:22  源程序MPIarrier.c

     文件       2956  2016-12-25 20:25  源程序MPIjacobi.c

     文件        472  2016-12-20 15:03  源程序MPIMPI_hello.c

     文件        977  2016-12-21 16:58  源程序MPIMPI_pi.c

     文件    3890362  2016-12-24 12:41  源程序MPI
um.txt

     文件       5204  2016-12-24 12:05  源程序MPIsort.c

     文件        224  2016-12-24 12:40  源程序MPI创建num.c

     文件        212  2016-12-18 20:48  源程序MPI创建矩阵.c

     文件       3827  2016-12-23 22:41  源程序MPI矩阵乘.c

     文件        393  2016-12-19 21:38  源程序openmpmphello.c

     文件        432  2016-12-19 16:23  源程序openmp积分求pi.c

     文件        834  2016-12-24 13:32  源程序openmp蒙特卡洛求pi.c

     文件     356352  2016-12-25 17:10  MPI实验报告.doc

     文件     138752  2016-12-25 20:20  OpenMP多线程编程实验.doc

    ..AD...         0  2016-12-26 14:02  源程序MPI

    ..AD...         0  2016-12-26 14:02  源程序openmp

    ..AD...         0  2016-12-26 14:02  源程序

----------- ---------  ---------- -----  ----

              8404180                    19


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)