📄 copy.c
字号:
#include <stdio.h>#include "mpi.h"#include "mpptest.h"#if HAVE_STDLIB_H#include <stdlib.h>#endif/* Test of single process memcpy. ctx is ignored for this test.*/double memcpy_rate(int reps, int len, void *ctx){ double elapsed_time; int i; char *sbuffer,*rbuffer; double t0, t1; sbuffer = (char *)malloc(len); rbuffer = (char *)malloc(len); elapsed_time = 0; *(&t0)=MPI_Wtime(); for(i=0;i<reps;i++){ memcpy( rbuffer, sbuffer, len ); } *(&t1)=MPI_Wtime(); elapsed_time = *(&t1 )-*(&t0); free(sbuffer); free(rbuffer); return(elapsed_time);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -