root/orte/test/system/iof_delay.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 #include <stdio.h>
   2 #include <signal.h>
   3 #include <math.h>
   4 
   5 
   6 #include "orte/runtime/runtime.h"
   7 
   8 #define MAX_COUNT 300
   9 #define ORTE_IOF_BASE_MSG_MAX   2048
  10 
  11 
  12 int
  13 main(int argc, char *argv[]){
  14     int count;
  15     int msgsize;
  16     unsigned char msg[ORTE_IOF_BASE_MSG_MAX];
  17     int i, j, rc;
  18     double maxpower;
  19     unsigned char chr;
  20     bool readstdin;
  21 
  22     /*
  23      * Init
  24      */
  25     orte_init(&argc, &argv, ORTE_PROC_NON_MPI);
  26 
  27     if (argc >= 2) {
  28         count = atoi(argv[1]);
  29         if (count < 0) {
  30             count = INT_MAX-1;
  31         }
  32     } else {
  33         count = MAX_COUNT;
  34     }
  35 
  36 
  37     i = 1;
  38     for (j=1; j < count+1; j++) {
  39 
  40 #if 0
  41         maxpower = (double)(j%7);
  42 #endif
  43 
  44         chr = (j % 26) + 65;
  45         memset(msg, chr, ORTE_IOF_BASE_MSG_MAX);
  46         msgsize = 10;
  47         msg[msgsize-1] = '\n';
  48 
  49         if (i == 1) {
  50             i = 2;
  51         } else {
  52             i = 1;
  53         }
  54 
  55         write(i, msg, msgsize);
  56 
  57         sleep(3);
  58 
  59     }
  60 
  61     orte_finalize();
  62 
  63     return 0;
  64 }

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