root/orte/test/mpi/ziatest.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /* -*- C -*-
   2  *
   3  * Copyright (c) 2008 Los Alamos National Security, LLC.  All rights reserved.
   4  *
   5  * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
   6  * Copyright (c) 2018      Intel, Inc.  All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  *
  13  */
  14 #include <stdio.h>
  15 #include <stdbool.h>
  16 #include <sys/types.h>
  17 #include <unistd.h>
  18 #include <stdlib.h>
  19 #include <time.h>
  20 #include <sys/time.h>
  21 
  22 #include <mpi.h>
  23 
  24 int main(int argc, char* argv[])
  25 {
  26     int nppn;
  27     struct timeval tv;
  28     char *cmd;
  29 
  30     /* check for proper usage */
  31     if (2 < argc) {
  32         printf("usage: ziatest <#procs/node>\n");
  33         exit(1);
  34     }
  35 
  36     nppn = strtol(argv[1], NULL, 10);
  37 
  38     /* THIS BEGINS THE OFFICIAL TIMING POINT */
  39 
  40     /* get a starting time stamp */
  41     gettimeofday(&tv, NULL);
  42 
  43     /* form the command */
  44     opal_asprintf(&cmd, "mpirun -npernode %d ./ziaprobe %ld %d",
  45              nppn, (long) tv.tv_sec, tv.tv_usec);
  46 
  47     /* execute it */
  48     system(cmd);
  49 
  50     /* done */
  51     free(cmd);
  52     return 0;
  53 }

/* [<][>][^][v][top][bottom][index][help] */