Example #1
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);
  }
}
Example #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 );
}
Example #3
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) );
}
Example #4
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;
}
Example #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) {
    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);
  }
}
Example #6
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);
  }
}
Example #7
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));
  }
}
Example #8
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);
  }
}
Example #9
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));
  }
}
Example #10
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?
  }
}
Example #11
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);
  }
}
Example #12
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?
  }
}
Example #13
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);
  }
}
Example #14
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));
   }
}
Example #15
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;
}
Example #16
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);
   }
}
Example #17
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;
}
Example #18
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;
  }
}
Example #19
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;
}
Example #20
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?
  }
}
Example #21
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();
  char buff[CHPL_TASK_ID_STRING_MAX_LEN];
  (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.3 nodes %d nid %d tid %s seq %.3lf %lld.%06ld %ld.%06ld %ld.%06ld \n",
                chpl_numNodes, chpl_nodeID, TID_STRING(buff, 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 directory names, file names and function names
  if (chpl_nodeID == 0) {
    int ix;
    int numFIDnames;

    chpl_dprintf (chpl_vdebug_fd, "CHPL_HOME: %s\n", CHPL_HOME);
    chpl_dprintf (chpl_vdebug_fd, "DIR: %s\n", chpl_compileDirectory);
    chpl_dprintf (chpl_vdebug_fd, "SAVEC: %s\n", chpl_saveCDir);

    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]);
      }
    }
    for (numFIDnames = 0; chpl_finfo[numFIDnames].name != NULL; numFIDnames++);
    chpl_dprintf (chpl_vdebug_fd, "FIDNsize: %d\n", numFIDnames);
    for (ix = 0; ix < numFIDnames; ix++)
      chpl_dprintf (chpl_vdebug_fd, "FIDname: %d %d %d %s\n", ix,
                    chpl_finfo[ix].lineno, chpl_finfo[ix].fileno,
                    chpl_finfo[ix].name);
  }
  
  chpl_vdebug = 1;
}