void VT_User_comment__(const char* comment)
{
  uint64_t time;

  VT_INIT;

  VT_SUSPEND_MALLOC_TRACING(VT_CURRENT_THREAD);

  time = vt_pform_wtime();
  vt_comment(VT_CURRENT_THREAD, &time, comment);

  VT_RESUME_MALLOC_TRACING(VT_CURRENT_THREAD);
}
예제 #2
0
void VT_User_comment__(const char* comment)
{
  uint64_t time;

  VT_INIT;

  VT_MEMHOOKS_OFF();

  time = vt_pform_wtime();
  vt_comment(VT_CURRENT_THREAD, &time, comment);

  VT_MEMHOOKS_ON();
}
예제 #3
0
void vt_esync(MPI_Comm comm)
{
  uint64_t time, etime;
  Sync_TsPerRun* temp_ts;
  Sync_Map* temp_map;

  VT_MPI_INT myrank;
  VT_MPI_INT numnodes;
  VT_MPI_INT partnerid, numslots;
  VT_MPI_INT i;

  VT_SUSPEND_IO_TRACING();

  /* mark begin of clock synchronization */
  time = vt_pform_wtime();
  vt_enter(&time, vt_trc_regid[VT__TRC_SYNCTIME]);
  /* ... also as comment for vtunify */
  vt_comment(&time, "__ETIMESYNC__");

  /* barrier at entry */
  PMPI_Barrier(comm);

  temp_ts = (Sync_TsPerRun*) malloc(sizeof(Sync_TsPerRun));
  if (temp_ts == NULL) vt_error();

  temp_ts->sync_phase = NULL;
  temp_ts->next       = NULL;

  if (SyncTsPerRunFirst == NULL)
  {
    SyncTsPerRunFirst = temp_ts;
    SyncTsPerRunLast  = temp_ts;
  }
  else
  {
    SyncTsPerRunLast->next = temp_ts;    
    SyncTsPerRunLast = temp_ts;
  }

  /* measure time synchronization */

  PMPI_Comm_rank(comm, &myrank);
  PMPI_Comm_size(comm, &numnodes);

  numslots = (VT_MPI_INT)ceil(log((double)(numnodes)) / log(2.0));

  for(i = 0; i < numslots; i++)
  {
    partnerid = esync_commpartner(myrank, numnodes, i);
    if( partnerid < numnodes )
    {
      if( myrank < partnerid )
      {
	esync_master(partnerid, comm, myrank);
      }
      else
      {
	esync_slave(partnerid, comm);
      }
    }
  }
   
  /* add myrank to list of map ids */

  temp_map = (Sync_Map*)malloc(sizeof(Sync_Map));
  if (temp_map == NULL) vt_error();
  temp_map->id       = myrank;
  temp_map->time     = time;
  temp_map->duration = (uint32_t) 0;
  temp_map->next     = NULL;

  if (SyncMapIdFirst == NULL)
  {
    SyncMapIdFirst = temp_map;
    SyncMapIdLast = temp_map;
  }
  else
  {
    SyncMapIdLast->next = temp_map;
    SyncMapIdLast = temp_map;
  }

  /* barrier at exit */
  PMPI_Barrier(comm);

  /* mark end of clock synchronization */
  etime = vt_pform_wtime();
  vt_exit(&etime);

  /* increment number of sync. phases */
  SyncRound++;

  /* set timestamp of next synchronization if necessary */
  if (SyncNext != (uint64_t)-1)
    SyncNext = etime + SyncIntv;

  /* calculate sync. duration */
  SyncMapIdLast->duration = etime - time;

  VT_RESUME_IO_TRACING();
}