예제 #1
0
void chpl_vdebug_start (const char *fileroot, double now) {
  const char * rootname;
  struct rusage ru;
  struct timeval tv;
  chpl_taskID_t startTask = chpl_task_getId();
  (void) gettimeofday (&tv, NULL);

  install_callbacks();

  chpl_vdebug = 0;

  // Close any open files.
  if (chpl_vdebug_fd >= 0)
    chpl_vdebug_stop ();
    
  // Initial call, open file and write initialization information
  
  // Get the root of the file name.
  rootname = (fileroot == NULL || fileroot[0] == 0) ? ".Vdebug" : fileroot; 
  
  // In case of an error, just return
  if (chpl_make_vdebug_file (rootname) < 0)
    return;
  
  // Write initial information to the file, including resource time
  if ( getrusage (RUSAGE_SELF, &ru) < 0) {
    ru.ru_utime.tv_sec = 0;
    ru.ru_utime.tv_usec = 0;
    ru.ru_stime.tv_sec = 0;
    ru.ru_stime.tv_usec = 0;
  }
  chpl_dprintf (chpl_vdebug_fd,
                "ChplVdebug: ver 1.2 nodes %d nid %d tid %d seq %.3lf %lld.%06ld %ld.%06ld %ld.%06ld \n",
                chpl_numNodes, chpl_nodeID, (int) startTask, now,
                (long long) tv.tv_sec, (long) tv.tv_usec,
                (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec  );

  // Dump file names
  if (chpl_nodeID == 0) {
    int ix;
    chpl_dprintf (chpl_vdebug_fd, "Tablesize: %d\n", chpl_filenameTableSize);
    for (ix = 0; ix < chpl_filenameTableSize ; ix++) {
      if (chpl_filenameTable[ix][0] == 0) {
        chpl_dprintf (chpl_vdebug_fd, "fname: 0 <unknown>\n");
      } else if (chpl_filenameTable[ix][0] == '<' &&
                 chpl_filenameTable[ix][1] == 'c') {
        chpl_dprintf (chpl_vdebug_fd, "fname: %d <command_line>\n", ix);
      } else {
        chpl_dprintf (chpl_vdebug_fd, "fname: %d %s\n", ix,
                      chpl_filenameTable[ix]);
      }
    }
  }
  
  chpl_vdebug = 1;
}
예제 #2
0
void chpl_vdebug_mark (void) {
  struct timeval tv;
  chpl_taskID_t tagTask = chpl_task_getId();
  (void) gettimeofday (&tv, NULL);
  chpl_dprintf (chpl_vdebug_fd, "VdbMark: %lld.%06ld %d %lu\n",
                (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, (unsigned long)tagTask );
}
예제 #3
0
void chpl_vdebug_stop (void) {
  struct rusage ru;  
  struct timeval tv;
  chpl_taskID_t stopTask = chpl_task_getId();

  // First, shutdown VisualDebug
  chpl_vdebug = 0;
  uninstall_callbacks();

  // Now log the stop
  if (chpl_vdebug_fd >= 0) {
    (void) gettimeofday (&tv, NULL);
    if ( getrusage (RUSAGE_SELF, &ru) < 0) {
      ru.ru_utime.tv_sec = 0;
      ru.ru_utime.tv_usec = 0;
      ru.ru_stime.tv_sec = 0;
      ru.ru_stime.tv_usec = 0;
    }
    // Generate the End record
    chpl_dprintf (chpl_vdebug_fd, "End: %lld.%06ld %ld.%06ld %ld.%06ld %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                  (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                  chpl_nodeID, (int) stopTask);
    close (chpl_vdebug_fd);
  }
}
예제 #4
0
void chpl_vdebug_mark (void) {
  struct timeval tv;
  chpl_taskID_t tagTask = chpl_task_getId();
  char buff[CHPL_TASK_ID_STRING_MAX_LEN];
  (void) gettimeofday (&tv, NULL);
  chpl_dprintf (chpl_vdebug_fd, "VdbMark: %lld.%06ld %d %s\n",
                (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, TID_STRING(buff, tagTask) );
}
예제 #5
0
void chpl_vdebug_log_fast_fork(c_nodeid_t node, c_sublocid_t subloc,
                               chpl_fn_int_t fid, void *arg, int32_t arg_size) {
  if (chpl_vdebug) {
    struct timeval tv;
    struct timezone tz = {0,0};
    (void) gettimeofday (&tv, &tz);
    chpl_dprintf (chpl_vdebug_fd, "f_fork: %lld.%06ld %d %d %d %d 0x%lx %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, node, subloc,
                  fid, (long) arg, arg_size);
  }
}
예제 #6
0
void cb_task_end (const chpl_task_cb_info_t *info) {
  struct timeval tv;
  if (!chpl_vdebug) return;
  if (chpl_vdebug_fd >= 0) {
    (void)gettimeofday(&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "Etask: %lld.%06ld %lld %lu\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long long) info->nodeID, (unsigned long) info->iu.id_only.id);
 
  }
}
예제 #7
0
void chpl_vdebug_log_fast_fork(c_nodeid_t node, c_sublocid_t subloc,
                               chpl_fn_int_t fid, void *arg, int32_t arg_size) {
  if (chpl_vdebug) {
    chpl_taskID_t forkTask = chpl_task_getId();
    struct timeval tv;
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "f_fork: %lld.%06ld %d %d %d %d 0x%lx %d %ld\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, node, subloc,
                  fid, (long) arg, arg_size, (unsigned long)forkTask);
  }
}
예제 #8
0
void  cb_comm_executeOn_nb (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    const struct chpl_comm_info_comm_executeOn *cm = &info->iu.executeOn;
    chpl_taskID_t executeOnTask = chpl_task_getId();
    struct timeval tv;
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "fork_nb: %lld.%06ld %d %d %d %d %#lx %zd %lu\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, info->localNodeID,
                  info->remoteNodeID, cm->subloc, cm->fid, (unsigned long) cm->arg, 
                  cm->arg_size, (unsigned long)executeOnTask);
  }
}
예제 #9
0
void chpl_vdebug_log_get(void* addr, c_nodeid_t node, void* raddr,
                         int32_t elemSize, int32_t typeIndex, int32_t len,
                         int ln, c_string fn) {
  if (chpl_vdebug) {
    struct timeval tv;
    struct timezone tz = {0,0};
    (void) gettimeofday (&tv, &tz);
    chpl_dprintf (chpl_vdebug_fd, "get: %lld.%06ld %d %d 0x%lx 0x%lx %d %d %d %d %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,  chpl_nodeID, node,
                  (long) addr, (long) raddr, elemSize, typeIndex, len, ln, fn);
  }
}
예제 #10
0
void cb_task_end(const chpl_task_cb_info_t *info) {
  struct timeval tv;
  struct timezone tz = {0,0};
  if (!chpl_vdebug) return;
  if (chpl_vdebug_fd >= 0) {
    (void)gettimeofday(&tv, &tz);
    chpl_dprintf (chpl_vdebug_fd, "Etask: %lld.%06ld %lld %ld\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long long) info->nodeID, (long int) info->iu.id_only.id);
 
  }
}
예제 #11
0
void chpl_vdebug_log_put(void* addr, c_nodeid_t node, void* raddr,
                         size_t size, int32_t typeIndex,
                         int ln, int32_t fn) {
  if (chpl_vdebug) {
    struct timeval tv;
    chpl_taskID_t commTask = chpl_task_getId();
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "put: %lld.%06ld %d %d %lu 0x%lx 0x%lx %d %d %d %d %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, node,
                  (unsigned long) commTask, (long) addr, (long) raddr, 1, typeIndex, (int)size,
                  ln, chpl_lookupFilename(fn));
  }
}
예제 #12
0
void cb_comm_get (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    struct timeval tv;
    const struct chpl_comm_info_comm *cm = &info->iu.comm;
    chpl_taskID_t commTask = chpl_task_getId();
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd,
                  "get: %lld.%06ld %d %d %lu %#lx %#lx %d %d %d %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,  info->localNodeID,
                  info->remoteNodeID, (unsigned long) commTask, (unsigned long) cm->addr,
                  (unsigned long) cm->raddr, 1, cm->typeIndex, (int)cm->size,
                  cm->lineno, cm->filename);
  }
}
예제 #13
0
void cb_comm_executeOn_fast (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    const struct chpl_comm_info_comm_executeOn *cm = &info->iu.executeOn;
    chpl_taskID_t executeOnTask = chpl_task_getId();
    char buff[CHPL_TASK_ID_STRING_MAX_LEN];
    struct timeval tv;
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd,
                  "f_executeOn: %lld.%06ld %d %d %d %d %#lx %zd %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, info->localNodeID,
                  info->remoteNodeID, cm->subloc, cm->fid, (unsigned long)cm->arg, 
                  cm->arg_size, TID_STRING(buff, executeOnTask));
  }
}
예제 #14
0
void chpl_vdebug_log_get_strd(void* dstaddr, void* dststrides, c_nodeid_t srcnode_id,
                              void* srcaddr, void* srcstrides, void* count,
                              int32_t stridelevels, int32_t elemSize, int32_t typeIndex,
                              int ln, c_string fn) {
  if (chpl_vdebug) {
    struct timeval tv;
    struct timezone tz = {0,0};
    (void) gettimeofday (&tv, &tz);
    chpl_dprintf (chpl_vdebug_fd, "st_get: %lld.%06ld %d %ld 0x%lx 0x%lx %d %d %d %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,  chpl_nodeID, (long) srcnode_id,
                  (long) dstaddr, (long) srcaddr, elemSize, typeIndex, ln, fn);
    // print out the srcstrides and dststrides and stridelevels?
  }
}
예제 #15
0
void chpl_vdebug_log_fork(c_nodeid_t node, c_sublocid_t subloc,
                          chpl_fn_int_t fid, void *arg, int32_t arg_size) {

  // Visual Debug Support
  chpl_taskID_t forkTask;
  forkTask = chpl_task_getId();
  // printf ("fork: fork task %llu %d->%d\n", forkTask, (int)chpl_nodeID, (int)node);
  if (chpl_vdebug) {
    struct timeval tv;
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "fork: %lld.%06ld %d %d %d %d 0x%lx %d %lu \n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, chpl_nodeID, node, subloc,
                  fid, (long) arg, arg_size, (unsigned long) forkTask);
  }
}
예제 #16
0
void chpl_vdebug_log_get_strd(void* dstaddr, void* dststrides, c_nodeid_t srcnode_id,
                              void* srcaddr, void* srcstrides, void* count,
                              int32_t stridelevels, int32_t elemSize, int32_t typeIndex,
                              int ln, int32_t fn) {
  if (chpl_vdebug) {
    struct timeval tv;
    chpl_taskID_t commTask = chpl_task_getId();
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "st_get: %lld.%06ld %d %ld %lu 0x%lx 0x%lx %d %d %d %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,  chpl_nodeID,
                  (long) srcnode_id, (unsigned long) commTask, (long) dstaddr, (long) srcaddr,
                  elemSize, typeIndex, ln, chpl_lookupFilename(fn));
    // print out the srcstrides and dststrides and stridelevels?
  }
}
예제 #17
0
void cb_task_create_begin(const chpl_task_cb_info_t *info) {
  struct timeval tv;
  struct timezone tz = {0,0};
  if (!chpl_vdebug) return;
  if (chpl_vdebug_fd >= 0) {
    (void)gettimeofday(&tv, &tz);
    chpl_dprintf (chpl_vdebug_fd, "%s: %lld.%06ld %lld %ld %s %ld %s\n",
                  (info->event_kind == chpl_task_cb_event_kind_create ? "task" : "Btask"),
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long long) info->nodeID, (long int) info->iu.full.id,
                  (info->iu.full.is_executeOn ? "O" : "L"),
                  (long int) info->iu.full.lineno,
                  (info->iu.full.filename ? info->iu.full.filename : ""));
   }
}
예제 #18
0
void cb_comm_get (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    struct timeval tv;
    const struct chpl_comm_info_comm *cm = &info->iu.comm;
    chpl_taskID_t commTask = chpl_task_getId();
    char buff[CHPL_TASK_ID_STRING_MAX_LEN];
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd,
                  VDEBUG_GETPUT_FORMAT_STRING, "get",
                  (long long) tv.tv_sec, (long) tv.tv_usec,  info->localNodeID,
                  info->remoteNodeID, TID_STRING(buff, commTask), (unsigned long) cm->addr,
                  (unsigned long) cm->raddr, (size_t)1, cm->typeIndex, cm->size,
                  cm->commID, cm->lineno, cm->filename);
  }
}
예제 #19
0
void cb_comm_get_strd (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    struct timeval tv;
    const struct chpl_comm_info_comm_strd *cm = &info->iu.comm_strd;
    chpl_taskID_t commTask = chpl_task_getId();
    (void) gettimeofday (&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd,
                  "st_get: %lld.%06ld %d %ld %lu %#lx %#lx 1 %zd %d %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec, info->localNodeID,
                  (long) info->remoteNodeID, (unsigned long) commTask, 
                  (unsigned long) cm->dstaddr, (unsigned long) cm->srcaddr, cm->elemSize,
                  cm->typeIndex, cm->lineno, cm->filename);
    // print out the srcstrides and dststrides and stridelevels and count?
  }
}
예제 #20
0
void cb_task_create(const chpl_task_cb_info_t *info) {
  struct timeval tv;
  if (!chpl_vdebug) return;
  if (chpl_vdebug_fd >= 0) {
    chpl_taskID_t taskId = chpl_task_getId();
    //printf ("taskCB: event: %d, node %d proc %s task id: %llu, new task id: %llu\n",
    //         (int)info->event_kind, (int)info->nodeID,
    //        (info->iu.full.is_executeOn ? "O" : "L"), taskId, info->iu.full.id);
    (void)gettimeofday(&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "task: %lld.%06ld %lld %ld %lu %s %ld %s\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long long) info->nodeID, (long int) info->iu.full.id,
                  (unsigned long) taskId,
                  (info->iu.full.is_executeOn ? "O" : "L"),
                  (long int) info->iu.full.lineno,
                  chpl_lookupFilename(info->iu.full.filename));
   }
}
예제 #21
0
void chpl_vdebug_tag (const char *str) {
  struct rusage ru;
  struct timeval tv;
  struct timezone tz = {0,0};

  (void) gettimeofday (&tv, &tz);
  if ( getrusage (RUSAGE_SELF, &ru) < 0) {
    ru.ru_utime.tv_sec = 0;
    ru.ru_utime.tv_usec = 0;
    ru.ru_stime.tv_sec = 0;
    ru.ru_stime.tv_usec = 0;
  }
  chpl_dprintf (chpl_vdebug_fd, "Tag: %lld.%06ld %ld.%06ld %ld.%06ld %d %d %s\n",
                (long long) tv.tv_sec, (long) tv.tv_usec,
                (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                chpl_nodeID, tag_no++, str);
  chpl_vdebug = 1;
}
예제 #22
0
void chpl_vdebug_tag (const char *str) {
  struct rusage ru;
  struct timeval tv;
  chpl_taskID_t tagTask = chpl_task_getId();

  (void) gettimeofday (&tv, NULL);
  if ( getrusage (RUSAGE_SELF, &ru) < 0) {
    ru.ru_utime.tv_sec = 0;
    ru.ru_utime.tv_usec = 0;
    ru.ru_stime.tv_sec = 0;
    ru.ru_stime.tv_usec = 0;
  }
  chpl_dprintf (chpl_vdebug_fd, "Tag: %lld.%06ld %ld.%06ld %ld.%06ld %d %d %d %s\n",
                (long long) tv.tv_sec, (long) tv.tv_usec,
                (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                chpl_nodeID, (int) tagTask, tag_no++, str);
  chpl_vdebug = 1;
}
예제 #23
0
void chpl_vdebug_pause (void) {
  struct rusage ru;
  struct timeval tv;
  struct timezone tz = {0,0};
  if (chpl_vdebug_fd >=0 && chpl_vdebug == 0) {
    (void) gettimeofday (&tv, &tz);
    if ( getrusage (RUSAGE_SELF, &ru) < 0) {
      ru.ru_utime.tv_sec = 0;
      ru.ru_utime.tv_usec = 0;
      ru.ru_stime.tv_sec = 0;
      ru.ru_stime.tv_usec = 0;
    }
    chpl_dprintf (chpl_vdebug_fd, "Pause: %lld.%06ld %ld.%06ld %ld.%06ld %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                  (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                  chpl_nodeID, tag_no-1);
    chpl_vdebug = 0;
  }
}
예제 #24
0
void cb_task_create (const chpl_task_cb_info_t *info) {
  struct timeval tv;
  if (!chpl_vdebug) return;
  if (chpl_vdebug_fd >= 0) {
    chpl_taskID_t taskId = chpl_task_getId();
    char buff[CHPL_TASK_ID_STRING_MAX_LEN];
    //printf ("taskCB: event: %d, node %d proc %s task id: %llu, new task id: %llu\n",
    //         (int)info->event_kind, (int)info->nodeID,
    //        (info->iu.full.is_executeOn ? "O" : "L"), taskId, info->iu.full.id);
    (void)gettimeofday(&tv, NULL);
    chpl_dprintf (chpl_vdebug_fd, "task: %lld.%06ld %lld %ld %s %s %ld %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long long) info->nodeID, (long int) info->iu.full.id,
                  TID_STRING(buff, taskId),
                  (info->iu.full.is_executeOn ? "O" : "L"),
                  (long int) info->iu.full.lineno,
                  info->iu.full.filename,
                  info->iu.full.fid);
   }
}
예제 #25
0
void chpl_vdebug_pause (int tagno) {
  struct rusage ru;
  struct timeval tv;
  chpl_taskID_t pauseTask = chpl_task_getId();

  if (chpl_vdebug_fd >=0 && chpl_vdebug == 1) {
    (void) gettimeofday (&tv, NULL);
    if ( getrusage (RUSAGE_SELF, &ru) < 0) {
      ru.ru_utime.tv_sec = 0;
      ru.ru_utime.tv_usec = 0;
      ru.ru_stime.tv_sec = 0;
      ru.ru_stime.tv_usec = 0;
    }
    chpl_dprintf (chpl_vdebug_fd, "Pause: %lld.%06ld %ld.%06ld %ld.%06ld %d %d %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                  (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                  chpl_nodeID, (int) pauseTask, tagno);
    chpl_vdebug = 0;
  }
}
예제 #26
0
void chpl_vdebug_tag (int tagno) {
  struct rusage ru;
  struct timeval tv;
  
  chpl_taskID_t tagTask = chpl_task_getId();
  char buff[CHPL_TASK_ID_STRING_MAX_LEN];

  (void) gettimeofday (&tv, NULL);
  if ( getrusage (RUSAGE_SELF, &ru) < 0) {
    ru.ru_utime.tv_sec = 0;
    ru.ru_utime.tv_usec = 0;
    ru.ru_stime.tv_sec = 0;
    ru.ru_stime.tv_usec = 0;
  }
  chpl_dprintf (chpl_vdebug_fd, "Tag: %lld.%06ld %ld.%06ld %ld.%06ld %d %s %d\n",
                (long long) tv.tv_sec, (long) tv.tv_usec,
                (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                chpl_nodeID, TID_STRING(buff, tagTask), tagno);
  chpl_vdebug = 1;
}
예제 #27
0
void chpl_vdebug_start (const char *fileroot, double now) {
  const char * rootname;
  struct rusage ru;
  struct timeval tv;
  chpl_taskID_t startTask = chpl_task_getId();
  (void) gettimeofday (&tv, NULL);

  install_callbacks();

  chpl_vdebug = 0;

  // Close any open files.
  if (chpl_vdebug_fd >= 0)
    chpl_vdebug_stop ();
    
  // Initial call, open file and write initialization information
  
  // Get the root of the file name.
  rootname = (fileroot == NULL || fileroot[0] == 0) ? ".Vdebug" : fileroot; 
  
  // In case of an error, just return
  if (chpl_make_vdebug_file (rootname) < 0)
    return;
  
  // Write initial information to the file, including resource time
  if ( getrusage (RUSAGE_SELF, &ru) < 0) {
    ru.ru_utime.tv_sec = 0;
    ru.ru_utime.tv_usec = 0;
    ru.ru_stime.tv_sec = 0;
    ru.ru_stime.tv_usec = 0;
  }
  chpl_dprintf (chpl_vdebug_fd,
                "ChplVdebug: ver 1.1 nodes %d nid %d tid %d seq %.3lf %lld.%06ld %ld.%06ld %ld.%06ld \n",
                chpl_numNodes, chpl_nodeID, (int) startTask, now,
                (long long) tv.tv_sec, (long) tv.tv_usec,
                (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec  );
  chpl_vdebug = 1;
}
예제 #28
0
void chpl_vdebug_stop (void) {
  struct rusage ru;  
  struct timeval tv;
  struct timezone tz = {0,0};
  if (chpl_vdebug_fd >= 0) {
    (void) gettimeofday (&tv, &tz);
    if ( getrusage (RUSAGE_SELF, &ru) < 0) {
      ru.ru_utime.tv_sec = 0;
      ru.ru_utime.tv_usec = 0;
      ru.ru_stime.tv_sec = 0;
      ru.ru_stime.tv_usec = 0;
    }
    // Generate the End record
    chpl_dprintf (chpl_vdebug_fd, "End: %lld.%06ld %ld.%06ld %ld.%06ld %d\n",
                  (long long) tv.tv_sec, (long) tv.tv_usec,
                  (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
                  (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec,
                  chpl_nodeID);
    close (chpl_vdebug_fd);
  }
  chpl_vdebug = 0;
  uninstall_callbacks();
}
예제 #29
0
void cb_comm_get_strd (const chpl_comm_cb_info_t *info) {
  if (chpl_vdebug) {
    struct timeval tv;
    size_t length;
    const struct chpl_comm_info_comm_strd *cm = &info->iu.comm_strd;
    chpl_taskID_t commTask = chpl_task_getId();
    char buff[CHPL_TASK_ID_STRING_MAX_LEN];
    (void) gettimeofday (&tv, NULL);

    length = 1;
    for (int32_t i = 0; i < cm->stridelevels; i++) {
      length *= cm->count[i];
    }

    chpl_dprintf (chpl_vdebug_fd,
                  VDEBUG_GETPUT_FORMAT_STRING, "st_get",
                  (long long) tv.tv_sec, (long) tv.tv_usec, info->localNodeID,
                  info->remoteNodeID, TID_STRING(buff, commTask),
                  (unsigned long) cm->dstaddr, (unsigned long) cm->srcaddr, cm->elemSize,
                  cm->typeIndex, length, cm->commID, cm->lineno, cm->filename);
    // print out the srcstrides and dststrides and stridelevels and count?
  }
}
예제 #30
0
void chpl_vdebug_tagname (const char* tagname, int tagno) {
  chpl_dprintf (chpl_vdebug_fd, "tname: %d %s\n", tagno, tagname);
}