diff --git a/examples/core_benchmark.c b/examples/core_benchmark.c index 0a87bdcad437e4578a893ae4901b02de09d44f0d..55c1e034524b80a3a3f20f09b99842893835b290 100644 --- a/examples/core_benchmark.c +++ b/examples/core_benchmark.c @@ -248,12 +248,15 @@ int main(int argc, char *argv[]) { /* Require CDOs */ before = omp_get_wtime(); + double consumer_start = before; + status = require_CDOs(cdos, num_CDOs, producers_ids, num_producers, CDO_data, size_CDO); assert(MSTRO_OK == status); after = omp_get_wtime(); require_time = (after - before) * 1000.0*1000.0; //time in us seconds - fprintf(stdout, "Throughput (declare/require): %.5f us\n", require_time/(double) num_CDOs); + fprintf(stdout, "Throughput (declare/require): %.5lf us\n", require_time/(double) num_CDOs); + fprintf(stdout, "[Consumer %d] declare-require time: %.5lf s\n", rank, after-before); /*sync producers and consumers -- avoid CDOs been withdrawn before require */ MPI_Barrier(MPI_COMM_WORLD); @@ -263,9 +266,12 @@ int main(int argc, char *argv[]) { status = demand_CDOs(cdos, num_CDOs); assert(MSTRO_OK == status); after = omp_get_wtime(); + double consumer_end = after; demand_time = (after - before) * 1000.0*1000.0; //time in us seconds - fprintf(stdout, "Throughput (demand/dispose): %.5f us\n", demand_time/(double) num_CDOs); - + fprintf(stdout, "Throughput (demand/dispose): %.5lf us\n", demand_time/(double) num_CDOs); + fprintf(stdout, "[Consumer %d] demand-dispose time: %.5lf s\n", rank,after-before); + + fprintf(stdout, "[Consumer %d] declare-dispose time: %.5lf s\n", rank,consumer_end-consumer_start); /* finalize Maestro */ status = mstro_finalize(); @@ -331,6 +337,8 @@ int main(int argc, char *argv[]) { } before = omp_get_wtime(); + double producer_start = before; + /* declare CDOs loop */ status = inject_CDOs(rank, cdos, num_CDOs, num_attributes, size_attributes, size_CDO, CDO_data); @@ -342,8 +350,9 @@ int main(int argc, char *argv[]) { declare_time = (after - before) * 1000.0*1000.0; fprintf(stdout, "#CDOs: %zu, #Threads: %zu, #Attributes: %zu, Size of attributes: %zu \n", num_CDOs, num_threads, num_attributes, size_attributes); - fprintf(stdout, "Throughput (declare/offer): %.5f us\n", declare_time/(double) num_CDOs); - + fprintf(stdout, "Throughput (declare/offer): %.5lf us\n", declare_time/(double) num_CDOs); + fprintf(stdout, "[Producer %d] declare-offer time: %.5lf s\n", rank, after-before); + /* sync producers and consumers -- avoid CDOs been withdrawn before require */ MPI_Barrier(MPI_COMM_WORLD); @@ -360,9 +369,11 @@ int main(int argc, char *argv[]) { assert(MSTRO_OK == status); after = omp_get_wtime(); - + double producer_end = after; withdraw_time = (after - before) * 1000.0*1000.0; //time in us seconds - fprintf(stdout, "Throughput (withdraw/dispose): %.5f us\n", withdraw_time/(double) num_CDOs); + fprintf(stdout, "Throughput (withdraw/dispose): %.5lf us\n", withdraw_time/(double) num_CDOs); + fprintf(stdout, "[Producer %d] withdraw-dispose time: %.5lf s\n", rank, after-before); + fprintf(stdout, "[Producer %d] declare-dispose time: %.5lf s\n", rank, producer_end- producer_start); status = mstro_finalize();