int measure_ibarrier_overlap(nbctest_params_t *params, nbctest_result_t *result) { #ifdef HAVE_NBC double starttime, endtime; int rc; static MPI_Request req; starttime = timeslot_startsync(); result->inittime = hpctimer_wtime(); rc = MPI_Ibarrier(params->comm, &req); result->inittime = hpctimer_wtime() - result->inittime; nbcbench_simulate_computing(params, &req, result); result->waittime = hpctimer_wtime(); rc = MPI_Wait(&req, MPI_STATUS_IGNORE); result->waittime = hpctimer_wtime() - result->waittime; endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { result->totaltime = endtime - starttime; return MEASURE_SUCCESS; } #endif return MEASURE_FAILURE; }
/* measure_sendrecv_sync: */ int measure_sendrecv_sync(pt2pttest_params_t *params, double *time) { double starttime, endtime; int rc = 0; starttime = timeslot_startsync(); if (rank == 0) { rc = MPI_Sendrecv(mempool_alloc(sbuf, sizeof(char) * params->count), params->count, MPI_BYTE, 1, 0, mempool_alloc(rbuf, sizeof(char) * params->count), params->count, MPI_BYTE, 1, 0, params->comm, MPI_STATUS_IGNORE); } else if (rank == 1) { rc = MPI_Sendrecv(mempool_alloc(sbuf, sizeof(char) * params->count), params->count, MPI_BYTE, 0, 0, mempool_alloc(rbuf, sizeof(char) * params->count), params->count, MPI_BYTE, 0, 0, params->comm, MPI_STATUS_IGNORE); } endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { *time = endtime - starttime; return MEASURE_SUCCESS; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_FAILURE; }
int measure_ireduce_overlap(nbctest_params_t *params, nbctest_result_t *result) { #ifdef HAVE_NBC double starttime, endtime; int rc; static MPI_Request req; starttime = timeslot_startsync(); result->inittime = hpctimer_wtime(); rc = MPI_Ireduce(mempool_alloc(sbufpool, sbufsize), mempool_alloc(rbufpool, sbufsize), params->count, MPI_DOUBLE, MPI_SUM, root, params->comm, &req); result->inittime = hpctimer_wtime() - result->inittime; nbcbench_simulate_computing(params, &req, result); result->waittime = hpctimer_wtime(); rc = MPI_Wait(&req, MPI_STATUS_IGNORE); result->waittime = hpctimer_wtime() - result->waittime; endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { result->totaltime = endtime - starttime; return MEASURE_SUCCESS; } #endif return MEASURE_FAILURE; }
/* measure_sendrecv_sync: */ double measure_sendrecv_sync(bench_t *bench) { double starttime, endtime; int rc = 0, count, rank; starttime = timeslot_startsync(); count = bench->paramseq_getcurrent(bench); if ((rank = bench->getrank(bench)) == 0) { rc = MPI_Sendrecv(mempool_alloc(sbufpool, sizeof(char) * count), count, MPI_BYTE, 1, 0, mempool_alloc(rbufpool, sizeof(char) * count), count, MPI_BYTE, 1, 0, bench->getcomm(bench), MPI_STATUS_IGNORE); } else if (rank == 1) { rc = MPI_Sendrecv(mempool_alloc(sbufpool, sizeof(char) * count), count, MPI_BYTE, 0, 0, mempool_alloc(rbufpool, sizeof(char) * count), count, MPI_BYTE, 0, 0, bench->getcomm(bench), MPI_STATUS_IGNORE); } endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }
/* measure_waitpatternnull_sync: */ double measure_waitpatternnull_sync(bench_t *bench) { double starttime, endtime; starttime = timeslot_startsync(); /* Empty */ endtime = timeslot_stopsync(); if (starttime > 0.0 && endtime > 0.0) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }
/* measure_bcast_sync: */ double measure_bcast_sync(bench_t *bench) { double starttime, endtime; int rc; starttime = timeslot_startsync(); rc = MPI_Bcast(mempool_alloc(bufpool, bufsize), count, MPI_BYTE, root, comm); endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }
/* measure_allreduce_sync: */ double measure_allreduce_sync(bench_t *bench) { double starttime, endtime; int rc; starttime = timeslot_startsync(); rc = MPI_Allreduce(mempool_alloc(sbufpool, sbufsize), mempool_alloc(rbufpool, rbufsize), count, MPI_DOUBLE, MPI_SUM, comm); endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }
/* measure_gatherv_sync: */ int measure_gatherv_sync(colltest_params_t *params, double *time) { double starttime, endtime; int rc; starttime = timeslot_startsync(); rc = MPI_Gatherv(mempool_alloc(sbufpool, sbufsize), params->count, MPI_BYTE, mempool_alloc(rbufpool, rbufsize), recvcounts, displs, MPI_BYTE, root, params->comm); endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { *time = endtime - starttime; return MEASURE_SUCCESS; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_FAILURE; }
/* measure_waitpatternup_sync: */ double measure_waitpatternup_sync(bench_t *bench) { double starttime, endtime, deadline; starttime = timeslot_startsync(); for (deadline = hpctimer_wtime() + (rank + 1) * 1e-6; hpctimer_wtime() < deadline; ) { /* Wait */ } endtime = timeslot_stopsync(); if (starttime > 0.0 && endtime > 0.0) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }
/* measure_send_sync: */ double measure_send_sync(bench_t *bench) { double starttime, endtime; int rc = 0; starttime = timeslot_startsync(); if (comm_rank == 0) { rc = MPI_Send(mempool_alloc(buf, bufsize), count, MPI_BYTE, 1, 0, comm); } else if (comm_rank == 1) { rc = MPI_Recv(mempool_alloc(buf, bufsize), count, MPI_BYTE, 0, 0, comm, MPI_STATUS_IGNORE); } endtime = timeslot_stopsync(); if ((rc == MPI_SUCCESS) && (starttime > 0.0) && (endtime > 0.0)) { return endtime - starttime; } else if (starttime < 0.0) { return MEASURE_STARTED_LATE; } else if (endtime < 0.0) { return MEASURE_TIME_TOOLONG; } return MEASURE_TIME_INVVAL; }