timeout.c

来自「mpi并行计算的c++代码 可用vc或gcc编译通过 可以用来搭建并行计算试验环」· C语言 代码 · 共 21 行

C
21
字号
/* -*- Mode: C; c-basic-offset:4 ; -*- *//* *  (C) 2001 by Argonne National Laboratory. *      See COPYRIGHT in top-level directory. */#include "mpi.h"/* This is a program that tests the ability of mpiexec to timeout a process   after no more than 3 minutes.  By default, it will run for 5 minutes */int main( int argc, char *argv[] ){    double t1;    double deltaTime = 300;    MPI_Init( 0, 0 );    t1 = MPI_Wtime();    while (MPI_Wtime() - t1 < deltaTime) ;    MPI_Finalize( );    return 0;}

⌨️ 快捷键说明

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