This directory was supposed to be private ... it does not have to be published on the SVN.
This commit was SVN r5819.
Этот коммит содержится в:
родитель
ca64115b14
Коммит
6740270ace
@ -1,36 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004 The Ohio State University.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
PROGS = mpi-ping
|
|
||||||
|
|
||||||
all: $(PROGS)
|
|
||||||
|
|
||||||
CC = mpicc
|
|
||||||
CFLAGS = -g
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(PROGS)
|
|
||||||
|
|
||||||
#mpi-ping-thread: mpi-ping-thread.c
|
|
||||||
# $(CC) -pthread $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) -lpthread
|
|
||||||
|
|
||||||
mpi-ping: mpi-ping.c
|
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
|
|
||||||
|
|
||||||
run-ping: mpi-ping
|
|
||||||
mpirun -np 2 ./mpi-ping
|
|
@ -1,118 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004 The Ohio State University.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ompi_config.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "mpi.h"
|
|
||||||
|
|
||||||
#define MYBUFSIZE (1<<21)
|
|
||||||
#define CHECK 0
|
|
||||||
#define PONG 1
|
|
||||||
|
|
||||||
char s_buf[MYBUFSIZE];
|
|
||||||
char r_buf[MYBUFSIZE];
|
|
||||||
int skip = 40;
|
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
char hostname[32];
|
|
||||||
|
|
||||||
int myid, numprocs, i, j;
|
|
||||||
double startwtime = 0.0, endwtime;
|
|
||||||
int namelen;
|
|
||||||
int size;
|
|
||||||
int loop;
|
|
||||||
MPI_Status stat;
|
|
||||||
int sleep = 1;
|
|
||||||
|
|
||||||
struct timeval t_start, t_end;
|
|
||||||
|
|
||||||
/*loop = 2;*/
|
|
||||||
|
|
||||||
if (argc < 2) {
|
|
||||||
fprintf (stderr, "Usage: %s msg_size\n", argv[0]);
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
size = atoi (argv[1]);
|
|
||||||
if (argc > 2)
|
|
||||||
loop = atoi (argv[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
setenv("OMPI_MCA_ptl_base_exclude", "tcp", 1);
|
|
||||||
|
|
||||||
MPI_Init (&argc, &argv);
|
|
||||||
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
|
|
||||||
MPI_Comm_rank (MPI_COMM_WORLD, &myid);
|
|
||||||
printf("the size is %d\n",numprocs);
|
|
||||||
|
|
||||||
/* touch the data */
|
|
||||||
for (i = 0; i < size; i++) {
|
|
||||||
s_buf[i] = 'A' + i%26;
|
|
||||||
}
|
|
||||||
|
|
||||||
gethostname(hostname, 32);
|
|
||||||
|
|
||||||
fprintf(stdout, "[%s:%s:%d] done with init and barrier\n",
|
|
||||||
hostname, __FUNCTION__, __LINE__);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
for (i = 0; i < loop + skip; i++) {
|
|
||||||
if (i == skip)
|
|
||||||
gettimeofday (&t_start, 0);
|
|
||||||
if (myid == 0) {
|
|
||||||
MPI_Send (s_buf, size, MPI_CHAR, 1, i, MPI_COMM_WORLD);
|
|
||||||
/*if (PONG)*/
|
|
||||||
MPI_Recv (r_buf, size, MPI_CHAR, 1, i, MPI_COMM_WORLD, &stat);
|
|
||||||
} else {
|
|
||||||
MPI_Recv (r_buf, size, MPI_CHAR, 0, i, MPI_COMM_WORLD, &stat);
|
|
||||||
/*if (PONG)*/
|
|
||||||
MPI_Send (s_buf, size, MPI_CHAR, 0, i, MPI_COMM_WORLD);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CHECK && myid != 0) {
|
|
||||||
for (j=0; j < size; j ++) {
|
|
||||||
if (r_buf[j] != 'A' + j%26) {
|
|
||||||
fprintf(stderr, "[%s:%s] error from byte %d \n",
|
|
||||||
hostname, __FUNCTION__, j);
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
r_buf[j] = '0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gettimeofday (&t_end, 0);
|
|
||||||
|
|
||||||
fprintf(stdout, "[%s:%s:%d] done with pingpong\n",
|
|
||||||
hostname, __FUNCTION__, __LINE__);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
if (myid == 0) {
|
|
||||||
double latency;
|
|
||||||
latency = ((1.0e6 * t_end.tv_sec + t_end.tv_usec)
|
|
||||||
- (1.0e6 * t_start.tv_sec + t_start.tv_usec)) / (2.0 * loop);
|
|
||||||
fprintf(stdout, "length %d latency %8f\n",
|
|
||||||
size, latency);
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
MPI_Finalize ();
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
length 0 latency 20.963000
|
|
||||||
length 1 latency 27.082500
|
|
||||||
length 2 latency 27.089000
|
|
||||||
length 4 latency 27.046000
|
|
||||||
length 8 latency 27.111500
|
|
||||||
length 16 latency 27.161500
|
|
||||||
length 32 latency 27.232500
|
|
||||||
length 64 latency 27.889500
|
|
||||||
length 128 latency 29.147000
|
|
||||||
length 256 latency 31.662000
|
|
||||||
length 512 latency 34.797000
|
|
||||||
length 1024 latency 42.762000
|
|
||||||
length 2048 latency 57.954500
|
|
||||||
length 4096 latency 77.715000
|
|
||||||
length 8192 latency 128.157500
|
|
||||||
length 16384 latency 306.884000
|
|
||||||
length 32768 latency 429.529000
|
|
||||||
length 65536 latency 666.954000
|
|
||||||
length 131072 latency 1126.890500
|
|
||||||
length 262144 latency 2084.019500
|
|
||||||
length 524288 latency 4060.802500
|
|
||||||
length 1048576 latency 8011.251500
|
|
@ -1,22 +0,0 @@
|
|||||||
length 0 latency 6.293000
|
|
||||||
length 1 latency 6.914000
|
|
||||||
length 2 latency 6.961000
|
|
||||||
length 4 latency 6.967000
|
|
||||||
length 8 latency 6.921000
|
|
||||||
length 16 latency 7.002000
|
|
||||||
length 32 latency 7.144000
|
|
||||||
length 64 latency 7.231000
|
|
||||||
length 128 latency 7.750000
|
|
||||||
length 256 latency 9.867000
|
|
||||||
length 512 latency 11.760000
|
|
||||||
length 1024 latency 14.796000
|
|
||||||
length 2048 latency 21.720000
|
|
||||||
length 4096 latency 31.352000
|
|
||||||
length 8192 latency 52.200000
|
|
||||||
length 16384 latency 213.106000
|
|
||||||
length 32768 latency 310.099000
|
|
||||||
length 65536 latency 480.808000
|
|
||||||
length 131072 latency 816.464000
|
|
||||||
length 262144 latency 1508.072000
|
|
||||||
length 524288 latency 2887.136000
|
|
||||||
length 1048576 latency 5680.983000
|
|
@ -1,48 +0,0 @@
|
|||||||
|
|
||||||
--------------------------------------------------
|
|
||||||
length 0 latency 6.276000
|
|
||||||
length 1 latency 6.863000
|
|
||||||
length 2 latency 6.876000
|
|
||||||
length 4 latency 6.870000
|
|
||||||
length 8 latency 6.880000
|
|
||||||
length 16 latency 6.994000
|
|
||||||
length 32 latency 7.096000
|
|
||||||
length 64 latency 7.202000
|
|
||||||
length 128 latency 7.731000
|
|
||||||
length 256 latency 9.877000
|
|
||||||
length 512 latency 11.703000
|
|
||||||
length 1024 latency 14.837000
|
|
||||||
length 2048 latency 21.597000
|
|
||||||
length 4096 latency 31.614000
|
|
||||||
length 8192 latency 52.728000
|
|
||||||
length 16384 latency 91.849000
|
|
||||||
length 32768 latency 169.010000
|
|
||||||
length 65536 latency 425.583000
|
|
||||||
length 131072 latency 778.310000
|
|
||||||
length 262144 latency 1466.517000
|
|
||||||
length 524288 latency 2840.390000
|
|
||||||
length 1048576 latency 5657.727000
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
length 0 latency 6.249000
|
|
||||||
length 1 latency 6.865000
|
|
||||||
length 2 latency 6.876000
|
|
||||||
length 4 latency 6.909000
|
|
||||||
length 8 latency 6.903000
|
|
||||||
length 16 latency 6.937000
|
|
||||||
length 32 latency 7.084000
|
|
||||||
length 64 latency 7.205000
|
|
||||||
length 128 latency 7.700000
|
|
||||||
length 256 latency 9.832000
|
|
||||||
length 512 latency 11.689000
|
|
||||||
length 1024 latency 14.779000
|
|
||||||
length 2048 latency 21.528000
|
|
||||||
length 4096 latency 31.625000
|
|
||||||
length 8192 latency 52.796000
|
|
||||||
length 16384 latency 91.786000
|
|
||||||
length 32768 latency 168.839000
|
|
||||||
length 65536 latency 428.174000
|
|
||||||
length 131072 latency 783.687000
|
|
||||||
length 262144 latency 1462.125000
|
|
||||||
length 524288 latency 2851.882000
|
|
||||||
length 1048576 latency 5655.458000
|
|
@ -1,149 +0,0 @@
|
|||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 0 latency 6.276500
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 1 latency 6.908500
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 2 latency 7.014000
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 4 latency 6.948500
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 8 latency 6.935500
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 16 latency 7.053500
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 32 latency 7.104000
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 64 latency 7.323000
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 128 latency 7.733500
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 256 latency 9.846000
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 512 latency 11.741500
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 1024 latency 14.823500
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 2048 latency 21.604000
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 4096 latency 31.398000
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 8192 latency 52.105500
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
[d0-mellanox:main:86] done with pingpong
|
|
||||||
length 16384 latency 212.413000
|
|
||||||
[d1-mellanox:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
[d0-mellanox:main:55] done with init and barrier
|
|
||||||
[d1-mellanox:main:55] done with init and barrier
|
|
||||||
Terminated
|
|
@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
16k Threshold 64k Threshold
|
|
||||||
(latency usecs) (latency usecs)
|
|
||||||
|
|
||||||
length 0 6.347000 6.27
|
|
||||||
length 1 6.916000 6.86
|
|
||||||
length 2 6.937000 6.87
|
|
||||||
length 4 6.948000 6.87
|
|
||||||
length 8 6.919000 6.88
|
|
||||||
length 16 6.971000 6.99
|
|
||||||
length 32 7.090000 7.09
|
|
||||||
length 64 7.230000 7.20
|
|
||||||
length 128 7.723000 7.73
|
|
||||||
length 256 9.839000 9.87
|
|
||||||
length 512 11.727000 11.70
|
|
||||||
length 1024 14.816000 14.83
|
|
||||||
length 2048 21.509000 21.59
|
|
||||||
length 4096 31.337000 31.61
|
|
||||||
length 8192 51.663000 52.72
|
|
||||||
length 16384 213.005000 91.84
|
|
||||||
length 32768 314.262000 169.01
|
|
||||||
length 65536 485.868000 425.58
|
|
||||||
length 131072 787.057000 783.62
|
|
||||||
length 262144 1464.489000 1462.16
|
|
||||||
length 524288 2871.909000 2851.17
|
|
||||||
length 1048576 5643.708000 5655.12
|
|
||||||
|
|
||||||
|
|
@ -1,198 +0,0 @@
|
|||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 0 latency 16.824000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 1 latency 20.012500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 2 latency 20.039000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 4 latency 20.038000
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 8 latency 20.031500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 16 latency 20.068000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 32 latency 19.955500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 64 latency 21.302000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 128 latency 22.708000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 256 latency 24.971000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 512 latency 28.205000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 1024 latency 35.137500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 2048 latency 49.086500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 4096 latency 70.039500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 8192 latency 117.148000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 16384 latency 292.963500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 32768 latency 419.357500
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 65536 latency 654.070000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 131072 latency 1130.282500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 262144 latency 2129.726500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 524288 latency 4156.120000
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
/home/1/santhana/ompi_gm_install/lib/
|
|
||||||
[a0:main:55] done with init and barrier
|
|
||||||
[a1:main:55] done with init and barrier
|
|
||||||
[a0:main:86] done with pingpong
|
|
||||||
length 1048576 latency 8047.606500
|
|
||||||
[a1:main:86] done with pingpong
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
||||||
Segmentation fault
|
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004 The Ohio State University.
|
|
||||||
# All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
# University of Stuttgart. All rights reserved.
|
|
||||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
# All rights reserved.
|
|
||||||
# $COPYRIGHT$
|
|
||||||
#
|
|
||||||
# Additional copyrights may follow
|
|
||||||
#
|
|
||||||
# $HEADER$
|
|
||||||
#
|
|
||||||
|
|
||||||
prog=./lat
|
|
||||||
i=$((0))
|
|
||||||
while [ $i -le $((1<<20)) ] ;
|
|
||||||
do
|
|
||||||
echo $i >&2
|
|
||||||
#prun -N 2 -B0 $prog 1000 $i
|
|
||||||
./run.sh $prog $i 500
|
|
||||||
#Allow the prun to clean up
|
|
||||||
sleep 4
|
|
||||||
if [ $i -eq 0 ] ; then
|
|
||||||
i=$((1))
|
|
||||||
else
|
|
||||||
i=$(($i*2))
|
|
||||||
fi
|
|
||||||
done
|
|
@ -1,2 +0,0 @@
|
|||||||
d0
|
|
||||||
d1
|
|
@ -1,30 +0,0 @@
|
|||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
FINISHED MPI_Comm_SIZE: size is 2
|
|
||||||
FINISHED MPI_Comm_SIZE: size is 2
|
|
||||||
mpi-ping: ping-pong (using blocking send/recv)
|
|
||||||
nprocs=2, reps=1000, min bytes=0, max bytes=1048576 inc bytes=0
|
|
||||||
0 pings 1
|
|
||||||
0 pinged 1: 0 bytes 6.28 uSec 0.00 MB/s
|
|
||||||
0 pinged 1: 1 bytes 6.93 uSec 0.14 MB/s
|
|
||||||
0 pinged 1: 2 bytes 6.93 uSec 0.29 MB/s
|
|
||||||
0 pinged 1: 4 bytes 6.96 uSec 0.57 MB/s
|
|
||||||
0 pinged 1: 8 bytes 6.94 uSec 1.15 MB/s
|
|
||||||
0 pinged 1: 16 bytes 7.01 uSec 2.28 MB/s
|
|
||||||
0 pinged 1: 32 bytes 7.12 uSec 4.49 MB/s
|
|
||||||
0 pinged 1: 64 bytes 7.26 uSec 8.82 MB/s
|
|
||||||
0 pinged 1: 128 bytes 7.74 uSec 16.54 MB/s
|
|
||||||
0 pinged 1: 256 bytes 10.01 uSec 25.57 MB/s
|
|
||||||
0 pinged 1: 512 bytes 11.82 uSec 43.32 MB/s
|
|
||||||
0 pinged 1: 1024 bytes 14.98 uSec 68.34 MB/s
|
|
||||||
0 pinged 1: 2048 bytes 21.79 uSec 93.98 MB/s
|
|
||||||
0 pinged 1: 4096 bytes 32.14 uSec 127.44 MB/s
|
|
||||||
0 pinged 1: 8192 bytes 53.68 uSec 152.60 MB/s
|
|
||||||
0 pinged 1: 16384 bytes 217.31 uSec 75.40 MB/s
|
|
||||||
0 pinged 1: 32768 bytes 319.34 uSec 102.61 MB/s
|
|
||||||
0 pinged 1: 65536 bytes 481.60 uSec 136.08 MB/s
|
|
||||||
0 pinged 1: 131072 bytes 824.24 uSec 159.02 MB/s
|
|
||||||
0 pinged 1: 262144 bytes 1506.19 uSec 174.04 MB/s
|
|
||||||
0 pinged 1: 524288 bytes 2870.90 uSec 182.62 MB/s
|
|
||||||
0 pinged 1: 1048576 bytes 5659.85 uSec 185.27 MB/s
|
|
||||||
WARNING: session directory not removed - function not implemented
|
|
@ -1,29 +0,0 @@
|
|||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
/home/1/santhana/openmpi_gm_install_d/lib/
|
|
||||||
FINISHED MPI_Comm_SIZE: size is 2
|
|
||||||
mpi-ping: ping-pong (using blocking send/recv)
|
|
||||||
nprocs=2, reps=1000, min bytes=0, max bytes=1048576 inc bytes=0
|
|
||||||
0 pings 1
|
|
||||||
FINISHED MPI_Comm_SIZE: size is 2
|
|
||||||
0 pinged 1: 0 bytes 6.27 uSec 0.00 MB/s
|
|
||||||
0 pinged 1: 1 bytes 6.93 uSec 0.14 MB/s
|
|
||||||
0 pinged 1: 2 bytes 6.95 uSec 0.29 MB/s
|
|
||||||
0 pinged 1: 4 bytes 6.95 uSec 0.58 MB/s
|
|
||||||
0 pinged 1: 8 bytes 6.93 uSec 1.15 MB/s
|
|
||||||
0 pinged 1: 16 bytes 7.04 uSec 2.27 MB/s
|
|
||||||
0 pinged 1: 32 bytes 7.12 uSec 4.49 MB/s
|
|
||||||
0 pinged 1: 64 bytes 7.27 uSec 8.80 MB/s
|
|
||||||
0 pinged 1: 128 bytes 7.74 uSec 16.53 MB/s
|
|
||||||
0 pinged 1: 256 bytes 10.01 uSec 25.56 MB/s
|
|
||||||
0 pinged 1: 512 bytes 11.84 uSec 43.25 MB/s
|
|
||||||
0 pinged 1: 1024 bytes 15.02 uSec 68.19 MB/s
|
|
||||||
0 pinged 1: 2048 bytes 21.78 uSec 94.01 MB/s
|
|
||||||
0 pinged 1: 4096 bytes 32.18 uSec 127.30 MB/s
|
|
||||||
0 pinged 1: 8192 bytes 53.69 uSec 152.58 MB/s
|
|
||||||
0 pinged 1: 16384 bytes 219.26 uSec 74.72 MB/s
|
|
||||||
0 pinged 1: 32768 bytes 318.48 uSec 102.89 MB/s
|
|
||||||
0 pinged 1: 65536 bytes 481.79 uSec 136.02 MB/s
|
|
||||||
0 pinged 1: 131072 bytes 814.28 uSec 160.97 MB/s
|
|
||||||
0 pinged 1: 262144 bytes 1506.43 uSec 174.02 MB/s
|
|
||||||
0 pinged 1: 524288 bytes 2873.05 uSec 182.48 MB/s
|
|
||||||
0 pinged 1: 1048576 bytes 5651.81 uSec 185.53 MB/s
|
|
@ -1,421 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004 The Ohio State University.
|
|
||||||
* All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
||||||
* University of Stuttgart. All rights reserved.
|
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
||||||
* All rights reserved.
|
|
||||||
* $COPYRIGHT$
|
|
||||||
*
|
|
||||||
* Additional copyrights may follow
|
|
||||||
*
|
|
||||||
* $HEADER$
|
|
||||||
*
|
|
||||||
* MPI ping program
|
|
||||||
*
|
|
||||||
* Patterned after the example in the Quadrics documentation
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ompi_config.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/select.h>
|
|
||||||
|
|
||||||
#include <getopt.h>
|
|
||||||
|
|
||||||
#include "mpi.h"
|
|
||||||
|
|
||||||
static int str2size(char *str)
|
|
||||||
{
|
|
||||||
int size;
|
|
||||||
char mod[32];
|
|
||||||
|
|
||||||
switch (sscanf(str, "%d%1[mMkK]", &size, mod)) {
|
|
||||||
case 1:
|
|
||||||
return (size);
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
switch (*mod) {
|
|
||||||
case 'm':
|
|
||||||
case 'M':
|
|
||||||
return (size << 20);
|
|
||||||
|
|
||||||
case 'k':
|
|
||||||
case 'K':
|
|
||||||
return (size << 10);
|
|
||||||
|
|
||||||
default:
|
|
||||||
return (size);
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void usage(void)
|
|
||||||
{
|
|
||||||
fprintf(stderr,
|
|
||||||
"Usage: mpi-ping [flags] <min bytes> [<max bytes>] [<inc bytes>]\n"
|
|
||||||
" mpi-ping -h\n");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void help(void)
|
|
||||||
{
|
|
||||||
printf
|
|
||||||
("Usage: mpi-ping [flags] <min bytes> [<max bytes>] [<inc bytes>]\n"
|
|
||||||
"\n" " Flags may be any of\n"
|
|
||||||
" -B use blocking send/recv\n"
|
|
||||||
" -C check data\n"
|
|
||||||
" -O overlapping pings\n"
|
|
||||||
" -W perform warm-up phase\n"
|
|
||||||
" -r number repetitions to time\n"
|
|
||||||
" -h print this info\n" "\n"
|
|
||||||
" Numbers may be postfixed with 'k' or 'm'\n\n");
|
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
MPI_Status status;
|
|
||||||
MPI_Request recv_request;
|
|
||||||
MPI_Request send_request;
|
|
||||||
char *rbuf;
|
|
||||||
char *tbuf;
|
|
||||||
int c;
|
|
||||||
int i;
|
|
||||||
int bytes;
|
|
||||||
int nproc;
|
|
||||||
int peer;
|
|
||||||
int proc;
|
|
||||||
int r;
|
|
||||||
int tag = 0x666;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* default options / arguments
|
|
||||||
*/
|
|
||||||
int reps = 10000;
|
|
||||||
int blocking = 0;
|
|
||||||
int check = 0;
|
|
||||||
int overlap = 0;
|
|
||||||
int warmup = 0;
|
|
||||||
int inc_bytes = 0;
|
|
||||||
int max_bytes = 0;
|
|
||||||
int min_bytes = 0;
|
|
||||||
|
|
||||||
setenv("OMPI_MCA_ptl_base_exclude", "tcp", 1);
|
|
||||||
|
|
||||||
MPI_Init(&argc, &argv);
|
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &proc);
|
|
||||||
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
|
|
||||||
|
|
||||||
printf("FINISHED MPI_Comm_SIZE: size is %d\n",nproc);
|
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "BCOWr:h")) != -1) {
|
|
||||||
switch (c) {
|
|
||||||
|
|
||||||
case 'B':
|
|
||||||
blocking = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'C':
|
|
||||||
check = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'O':
|
|
||||||
overlap = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'W':
|
|
||||||
warmup = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'r':
|
|
||||||
if ((reps = str2size(optarg)) <= 0) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'h':
|
|
||||||
help();
|
|
||||||
|
|
||||||
default:
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (optind == argc) {
|
|
||||||
min_bytes = 0;
|
|
||||||
} else if ((min_bytes = str2size(argv[optind++])) < 0) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (optind == argc) {
|
|
||||||
max_bytes = min_bytes;
|
|
||||||
} else if ((max_bytes = str2size(argv[optind++])) < min_bytes) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (optind == argc) {
|
|
||||||
inc_bytes = 0;
|
|
||||||
} else if ((inc_bytes = str2size(argv[optind++])) < 0) {
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nproc == 1) {
|
|
||||||
exit(EXIT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((rbuf = (char *) malloc(max_bytes ? max_bytes : 8)) == NULL) {
|
|
||||||
perror("malloc");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((tbuf = (char *) malloc(max_bytes ? max_bytes : 8)) == NULL) {
|
|
||||||
perror("malloc");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < max_bytes; i++) {
|
|
||||||
tbuf[i] = i & 255;
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (proc == 0) {
|
|
||||||
if (overlap) {
|
|
||||||
printf("mpi-ping: overlapping ping-pong\n");
|
|
||||||
} else if (blocking) {
|
|
||||||
printf("mpi-ping: ping-pong (using blocking send/recv)\n");
|
|
||||||
} else {
|
|
||||||
printf("mpi-ping: ping-pong\n");
|
|
||||||
}
|
|
||||||
if (check) {
|
|
||||||
printf("data checking enabled\n");
|
|
||||||
}
|
|
||||||
printf("nprocs=%d, reps=%d, min bytes=%d, max bytes=%d inc bytes=%d\n",
|
|
||||||
nproc, reps, min_bytes, max_bytes, inc_bytes);
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
peer = proc ^ 1;
|
|
||||||
|
|
||||||
if ((peer < nproc) && (peer & 1)) {
|
|
||||||
printf("%d pings %d\n", proc, peer);
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
if (warmup) {
|
|
||||||
|
|
||||||
if (proc == 0) {
|
|
||||||
puts("warm-up phase");
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (r = 0; r < reps; r++) {
|
|
||||||
if (peer >= nproc) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
MPI_Irecv(rbuf, max_bytes, MPI_BYTE, peer, tag, MPI_COMM_WORLD,
|
|
||||||
&recv_request);
|
|
||||||
MPI_Isend(tbuf, max_bytes, MPI_BYTE, peer, tag, MPI_COMM_WORLD,
|
|
||||||
&send_request);
|
|
||||||
MPI_Wait(&send_request, &status);
|
|
||||||
MPI_Wait(&recv_request, &status);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (proc == 0) {
|
|
||||||
puts("warm-up phase done");
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Main loop
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (bytes = min_bytes; bytes <= max_bytes;
|
|
||||||
bytes = inc_bytes ? bytes + inc_bytes : bytes ? 2 * bytes : 1) {
|
|
||||||
|
|
||||||
double t = 0.0;
|
|
||||||
double tv[2];
|
|
||||||
|
|
||||||
r = reps;
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
if (peer < nproc) {
|
|
||||||
|
|
||||||
if (overlap) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MPI_Isend / MPI_Irecv overlapping ping-pong
|
|
||||||
*/
|
|
||||||
|
|
||||||
tv[0] = MPI_Wtime();
|
|
||||||
|
|
||||||
for (r = 0; r < reps; r++) {
|
|
||||||
|
|
||||||
MPI_Irecv(rbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &recv_request);
|
|
||||||
MPI_Isend(tbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &send_request);
|
|
||||||
MPI_Wait(&send_request, &status);
|
|
||||||
MPI_Wait(&recv_request, &status);
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < bytes; i++) {
|
|
||||||
if (rbuf[i] != (i & 255)) {
|
|
||||||
puts("mpi-ping: Error: Invalid data received");
|
|
||||||
}
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tv[1] = MPI_Wtime();
|
|
||||||
|
|
||||||
} else if (blocking) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MPI_Send / MPI_Recv ping-pong
|
|
||||||
*/
|
|
||||||
|
|
||||||
tv[0] = MPI_Wtime();
|
|
||||||
|
|
||||||
if (peer < nproc) {
|
|
||||||
if (proc & 1) {
|
|
||||||
r--;
|
|
||||||
MPI_Recv(rbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &status);
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < bytes; i++) {
|
|
||||||
if (rbuf[i] != (i & 255)) {
|
|
||||||
puts("mpi-ping: Error: Invalid data received");
|
|
||||||
}
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (r-- > 0) {
|
|
||||||
|
|
||||||
MPI_Send(tbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD);
|
|
||||||
MPI_Recv(rbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &status);
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < bytes; i++) {
|
|
||||||
if (rbuf[i] != (i & 255)) {
|
|
||||||
puts("mpi-ping: Error: Invalid data received");
|
|
||||||
}
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (proc & 1) {
|
|
||||||
MPI_Send(tbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tv[1] = MPI_Wtime();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MPI_Isend / MPI_Irecv ping-pong
|
|
||||||
*/
|
|
||||||
|
|
||||||
tv[0] = MPI_Wtime();
|
|
||||||
|
|
||||||
if (peer < nproc) {
|
|
||||||
if (proc & 1) {
|
|
||||||
r--;
|
|
||||||
MPI_Irecv(rbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &recv_request);
|
|
||||||
MPI_Wait(&recv_request, &status);
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < bytes; i++) {
|
|
||||||
if (rbuf[i] != (i & 255)) {
|
|
||||||
puts("mpi-ping: Error: Invalid data received");
|
|
||||||
}
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (r-- > 0) {
|
|
||||||
|
|
||||||
MPI_Isend(tbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &send_request);
|
|
||||||
MPI_Wait(&send_request, &status);
|
|
||||||
MPI_Irecv(rbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &recv_request);
|
|
||||||
MPI_Wait(&recv_request, &status);
|
|
||||||
|
|
||||||
if (check) {
|
|
||||||
for (i = 0; i < bytes; i++) {
|
|
||||||
if (rbuf[i] != (i & 255)) {
|
|
||||||
puts("mpi-ping: Error: Invalid data received");
|
|
||||||
}
|
|
||||||
rbuf[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (proc & 1) {
|
|
||||||
MPI_Isend(tbuf, bytes, MPI_BYTE, peer, tag,
|
|
||||||
MPI_COMM_WORLD, &send_request);
|
|
||||||
MPI_Wait(&send_request, &status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tv[1] = MPI_Wtime();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate time interval in useconds (half round trip)
|
|
||||||
*/
|
|
||||||
|
|
||||||
t = (tv[1] - tv[0]) * 1000000.0 / (2 * reps);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
|
|
||||||
if ((peer < nproc) && (peer & 1)) {
|
|
||||||
printf("%3d pinged %3d: %8d bytes %9.2f uSec %8.2f MB/s\n",
|
|
||||||
proc, peer, bytes, t, bytes / (t));
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
|
||||||
MPI_Finalize();
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
mpirun -np 2 -hostfile mac -- ${PWD}/$1 $2 $3
|
|
Загрузка…
x
Ссылка в новой задаче
Block a user