1
1

Fix the ziatest to report correct times

This commit was SVN r21059.
Этот коммит содержится в:
Ralph Castain 2009-04-23 01:12:56 +00:00
родитель 3c3c306ee4
Коммит 76b6ae3b29
2 изменённых файлов: 16 добавлений и 8 удалений

Просмотреть файл

@ -33,14 +33,17 @@ int main(int argc, char* argv[])
int nnodes;
bool odd_nnodes;
bool recvit;
char *ppnstr;
if (argc < 4) {
fprintf(stderr, "a ppn value and start times must be provided\n");
if (argc < 3) {
fprintf(stderr, "start times must be provided\n");
return 1;
}
ppn = strtol(argv[1], NULL, 10);
start_sec = strtol(argv[2], NULL, 10);
start_usec = strtol(argv[3], NULL, 10);
ppnstr = getenv("OMPI_COMM_WORLD_LOCAL_SIZE");
ppn = strtol(ppnstr, NULL, 10);
start_sec = strtol(argv[1], NULL, 10);
start_usec = strtol(argv[2], NULL, 10);
MPI_Init(NULL, NULL);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@ -160,12 +163,17 @@ int main(int argc, char* argv[])
}
maxsec = timestamps[i];
maxusec = timestamps[i+1];
maxrank = i;
maxrank = i/2;
}
free(timestamps);
/* subtract starting time to get time in microsecs for test */
maxsec = maxsec - start_sec;
if (maxusec >= start_usec) {
maxusec = maxusec - start_usec;
} else {
maxsec--;
maxusec = 1000000 - start_usec + maxusec;
}
/* pretty-print the result */
seconds = maxsec + (maxusec / 1000000l);
minutes = seconds / 60l;

Просмотреть файл

@ -1,5 +1,5 @@
#!/usr/bin/perl
use Time::HiRes qw( gettimeofday );
($sec, $microsec) = gettimeofday;
$cmd = "mpirun -npernode " . @ARGV[0] . " ./ziatest " . @ARGV[0] . " " . $sec . " " . $microsec;
$cmd = "mpirun -npernode " . @ARGV[0] . " ./ziatest " . " $sec " . $microsec;
system($cmd);