Beispiel #1
0
  //global barrier for spi
  void spi_global_barrier()
  {
#ifdef SPI_BARRIER
    if(MUSPI_GIBarrierEnter(&spi_barrier)) crash("while entering spi barrier");
    if(MUSPI_GIBarrierPollWithTimeout(&spi_barrier,60UL*1600000000)) crash("while waiting for barrier to finish");
#else
    MPI_Barrier(MPI_COMM_WORLD);
#endif
  }
Beispiel #2
0
void global_barrier() {
    int rc = 0;
    uint64_t timeoutCycles = 60UL * 1600000000UL; // about 60 sec at 1.6 ghz
    rc = MUSPI_GIBarrierEnter ( &GIBarrier );
    if (rc) {
        printf("MUSPI_GIBarrierEnter failed returned rc = %d\n", rc);
        exit(1);
    }

    // Poll for completion of the barrier.
    rc = MUSPI_GIBarrierPollWithTimeout ( &GIBarrier, timeoutCycles);
    if( rc ) {
        printf("MUSPI_GIBarrierPollWithTimeout failed returned rc = %d\n", rc);
        DelayTimeBase (200000000000UL);
        exit(1);
    }
    return;
}