util.c

来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· C语言 代码 · 共 27 行

C
27
字号
#include <stdio.h>#include "mpi.h"extern int __NUMNODES, __MYPROCID;/*   Utility programs for mpptest *//*     T1 is time to send len1,    T2 is time to send len2,     len is lenght we'd like the number of repititions for    reps (input) is the default to use */int GetRepititions( T1, T2, Len1, Len2, len, reps )double T1, T2;int    Len1, Len2, len, reps;{    if (__MYPROCID == 0) {	if (T1 > 0 && T2 > 0) 	    reps = ComputeGoodReps( T1, Len1, T2, Len2, len );    }    MPI_Bcast(&reps, 1, MPI_INT, 0, MPI_COMM_WORLD );    return reps;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?