1
1
openmpi/orte/test/mpi/ziatest.c
Ralph H Castain fc81d0d519 Replace asprintf with opal_asprintf
Silence the flood of warnings from ORTE

Signed-off-by: Ralph H Castain <rhc@open-mpi.org>
2018-10-06 19:32:37 +00:00

54 строки
1.0 KiB
C

/* -*- C -*-
*
* Copyright (c) 2008 Los Alamos National Security, LLC. All rights reserved.
*
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/
#include <stdio.h>
#include <stdbool.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <mpi.h>
int main(int argc, char* argv[])
{
int nppn;
struct timeval tv;
char *cmd;
/* check for proper usage */
if (2 < argc) {
printf("usage: ziatest <#procs/node>\n");
exit(1);
}
nppn = strtol(argv[1], NULL, 10);
/* THIS BEGINS THE OFFICIAL TIMING POINT */
/* get a starting time stamp */
gettimeofday(&tv, NULL);
/* form the command */
opal_asprintf(&cmd, "mpirun -npernode %d ./ziaprobe %ld %d",
nppn, (long) tv.tv_sec, tv.tv_usec);
/* execute it */
system(cmd);
/* done */
free(cmd);
return 0;
}