Exemplo n.º 1
0
void print_timer()
{
  if (timer_on)
  {
    stop_timer();
    printf("(%i) Elapsed Wtime: %14.6f s (%5.1f%% CPU)\n", proc_rank, wtime, 100.0 * ticks * (1.0 / CLOCKS_PER_SEC) / wtime);
    resume_timer();    
  }
  else
    printf("(%i) Elapsed Wtime: %14.6f s (%5.1f%% CPU)\n", proc_rank, wtime, 100.0 * ticks * (1.0 / CLOCKS_PER_SEC) / wtime);
}
Exemplo n.º 2
0
void print_timer()
{
  if (timer_on)
  {
    stop_timer();
    printf("Elapsed processortime: %14.6f s\n", ticks * (1.0 / CLOCKS_PER_SEC));
    resume_timer();
  }
  else
    printf("Elapsed processortime: %14.6f s\n", ticks * (1.0 / CLOCKS_PER_SEC));
}
Exemplo n.º 3
0
/* Write Timer Control Register

   $$$ From Motorola Datasheet: when resetting ta0/tb0 (set bit 4) of
       TDCRA/B the other bits in TCR must be written with their
       previous value to avoid altering the operating mode; this
       verify the fact than writting 2 times the same value in the
       predivisor does not affect its count.

   $$$ 

 */
static void mfp_put_tcr_bogo(mfp_timer_t * const ptimer,
 int v, const bogoc68_t bogoc)
{
  if (v != ptimer->tcr) {
    if (!v) {
      stop_timer(ptimer,bogoc);
    } else if (!ptimer->tcr) {
      resume_timer(ptimer, v, bogoc); /* hz=8000000*192/cpp */
    } else {
      reconf_timer(ptimer, v, bogoc);
    }
  }
}
Exemplo n.º 4
0
void Exchange_Borders()
{
  Debug("Exchange_Borders", 0);

  resume_timer();
  // all traffic in direction "top"
  MPI_Sendrecv( &phi[1][1],              // sendbuf   - initial address of send buffer (choice)
                1,                       // sendcount - number of elements in send buffer (integer)
                border_type[Y_DIR],      // sendtype  - type of elements in send buffer (handle)
                proc_top,                // dest      - rank of destination (integer)
                0,                       // sendtag   - send tag (integer)
                &phi[1][dim[Y_DIR] - 1], // recvbuf   - initial address of receive buffer (choice)
                1,                       // recvcount - number of elements in receive buffer (integer)
                border_type[Y_DIR],      // recvtype  - type of elements in receive buffer (handle)
                proc_bottom,             // source    - rank of source (integer)
                0,                       // recvtag   - receive tag (integer)
                grid_comm,               // comm      - communicator (handle)
                &status);                // status    - status object (Status).  This refers to the receive operation.


  // all traffic in direction "bottom"
  MPI_Sendrecv( &phi[1][dim[Y_DIR] - 2], // sendbuf   - initial address of send buffer (choice)
                1,                       // sendcount - number of elements in send buffer (integer)
                border_type[Y_DIR],      // sendtype  - type of elements in send buffer (handle)
                proc_bottom,             // dest      - rank of destination (integer)
                0,                       // sendtag   - send tag (integer)
                &phi[1][0],              // recvbuf   - initial address of receive buffer (choice)
                1,                       // recvcount - number of elements in receive buffer (integer)
                border_type[Y_DIR],      // recvtype  - type of elements in receive buffer (handle)
                proc_top,                // source    - rank of source (integer)
                0,                       // recvtag   - receive tag (integer)
                grid_comm,               // comm      - communicator (handle)
                &status);                // status    - status object (Status).  This refers to the receive operation.

  // all traffic in direction "left"
  MPI_Sendrecv( &phi[1][1],              // sendbuf   - initial address of send buffer (choice)
                1,                       // sendcount - number of elements in send buffer (integer)
                border_type[X_DIR],      // sendtype  - type of elements in send buffer (handle)
                proc_left,               // dest      - rank of destination (integer)
                0,                       // sendtag   - send tag (integer)
                &phi[dim[X_DIR] - 1][1], // recvbuf   - initial address of receive buffer (choice)
                1,                       // recvcount - number of elements in receive buffer (integer)
                border_type[X_DIR],      // recvtype  - type of elements in receive buffer (handle)
                proc_right,              // source    - rank of source (integer)
                0,                       // recvtag   - receive tag (integer)
                grid_comm,               // comm      - communicator (handle)
                &status);                // status    - status object (Status).  This refers to the receive operation.
  
  // all traffic in direction "right"
  MPI_Sendrecv( &phi[dim[X_DIR] - 2][1], // sendbuf   - initial address of send buffer (choice)
                1,                       // sendcount - number of elements in send buffer (integer)
                border_type[X_DIR],      // sendtype  - type of elements in send buffer (handle)
                proc_right,              // dest      - rank of destination (integer)
                0,                       // sendtag   - send tag (integer)
                &phi[0][1],              // recvbuf   - initial address of receive buffer (choice)
                1,                       // recvcount - number of elements in receive buffer (integer)
                border_type[X_DIR],      // recvtype  - type of elements in receive buffer (handle)
                proc_left,               // source    - rank of source (integer)
                0,                       // recvtag   - receive tag (integer)
                grid_comm,               // comm      - communicator (handle)
                &status);                // status    - status object (Status).  This refers to the receive operation.
  stop_timer();
  data_communicated += 2 * dim[X_DIR] + 2 * dim[Y_DIR] - 8;
}