我一直在尝试测试网络性能,但有一个问题
static public void main(String[] args)
{
MPI.Init(args);
int myrank = MPI.COMM_WORLD.Rank();
int tag = 99;
int maxlen = 104857600;
int minlen = 1; //1kb ?
char [] sendbuff = new char [maxlen];
char [] recvbuff = new char [maxlen];
long speedKbps;
long speedMbps;
if (myrank == 0)
{
for (int len = minlen; len <= maxlen; len *= 2)
{ //len=*2 doubles the ping size each time
long startTime = System.nanoTime();
MPI.COMM_WORLD.Send(sendbuff, 0, len, MPI.CHAR, 1, tag);
MPI.COMM_WORLD.Recv(recvbuff, 0, len, MPI.CHAR, 1, tag);
long endTime = System.nanoTime();
long duration = endTime - startTime;
System.out.println("Time for the ping to be sent and recived of " + len + " kb is " + duration + " nanoseconds");
double transferRate = (len/ duration ) ; //amount of data in kilobytes transferred in 1 second
System.out.println("transferRate: " + transferRate + "KB per second");
}
}
}
,这minlen = 1
是什么大小,是 1 KB,1 位,1 字节吗?
谢谢