Add a test for loop over bcast
This commit was SVN r21560.
Этот коммит содержится в:
родитель
91c4869cdc
Коммит
2fbdea0273
@ -1,4 +1,4 @@
|
||||
PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn reduce-hang ziaprobe ziatest
|
||||
PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spawn concurrent_spawn spawn_multiple mpi_spin delayed_abort loop_spawn loop_child bad_exit pubsub hello_barrier segv accept connect hello_output hello_show_help crisscross read_write ziatest slave_spawn slave cell_spawn reduce-hang ziaprobe ziatest bcast_loop
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
|
36
orte/test/mpi/bcast_loop.c
Обычный файл
36
orte/test/mpi/bcast_loop.c
Обычный файл
@ -0,0 +1,36 @@
|
||||
#include <mpi.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int myid, nprocs, tag;
|
||||
int i, m, nt;
|
||||
MPI_Status status;
|
||||
double workarray1[561], workarray2[561];
|
||||
const int numm = 50000;
|
||||
const int numt = 142;
|
||||
|
||||
MPI_Init(NULL, NULL);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
|
||||
|
||||
for (m = 0; m < numm; ++m) {
|
||||
if (0 == (m % 1000)) {
|
||||
printf("rank %d, m = %d\n", myid, m);
|
||||
}
|
||||
for (nt = 0; nt <= numt; ++nt) {
|
||||
if (0 == myid) {
|
||||
for (i = 0; i < 561; ++i) {
|
||||
workarray1[i] = numm * numt * i;
|
||||
workarray2[i] = numm * numt * (i + 1);
|
||||
}
|
||||
}
|
||||
MPI_Bcast(workarray1, 561, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
||||
MPI_Bcast(workarray2, 561, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
||||
}
|
||||
}
|
||||
MPI_Finalize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user