Skip to content
Snippets Groups Projects
Commit f784b477 authored by Ali Mohammed's avatar Ali Mohammed Committed by Ali Mohammed
Browse files

report full consumers and producers times

parent 302e95d8
No related branches found
No related tags found
1 merge request!53Resolve "Need CI-test using 'installed' maestro"
...@@ -248,12 +248,15 @@ int main(int argc, char *argv[]) { ...@@ -248,12 +248,15 @@ int main(int argc, char *argv[]) {
/* Require CDOs */ /* Require CDOs */
before = omp_get_wtime(); before = omp_get_wtime();
double consumer_start = before;
status = require_CDOs(cdos, num_CDOs, producers_ids, num_producers, CDO_data, size_CDO); status = require_CDOs(cdos, num_CDOs, producers_ids, num_producers, CDO_data, size_CDO);
assert(MSTRO_OK == status); assert(MSTRO_OK == status);
after = omp_get_wtime(); after = omp_get_wtime();
require_time = (after - before) * 1000.0*1000.0; //time in us seconds 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 */ /*sync producers and consumers -- avoid CDOs been withdrawn before require */
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
...@@ -263,9 +266,12 @@ int main(int argc, char *argv[]) { ...@@ -263,9 +266,12 @@ int main(int argc, char *argv[]) {
status = demand_CDOs(cdos, num_CDOs); status = demand_CDOs(cdos, num_CDOs);
assert(MSTRO_OK == status); assert(MSTRO_OK == status);
after = omp_get_wtime(); after = omp_get_wtime();
double consumer_end = after;
demand_time = (after - before) * 1000.0*1000.0; //time in us seconds 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 */ /* finalize Maestro */
status = mstro_finalize(); status = mstro_finalize();
...@@ -331,6 +337,8 @@ int main(int argc, char *argv[]) { ...@@ -331,6 +337,8 @@ int main(int argc, char *argv[]) {
} }
before = omp_get_wtime(); before = omp_get_wtime();
double producer_start = before;
/* declare CDOs loop */ /* declare CDOs loop */
status = inject_CDOs(rank, cdos, num_CDOs, num_attributes, size_attributes, size_CDO, CDO_data); status = inject_CDOs(rank, cdos, num_CDOs, num_attributes, size_attributes, size_CDO, CDO_data);
...@@ -342,7 +350,8 @@ int main(int argc, char *argv[]) { ...@@ -342,7 +350,8 @@ int main(int argc, char *argv[]) {
declare_time = (after - before) * 1000.0*1000.0; 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, "#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 */ /* sync producers and consumers -- avoid CDOs been withdrawn before require */
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
...@@ -360,9 +369,11 @@ int main(int argc, char *argv[]) { ...@@ -360,9 +369,11 @@ int main(int argc, char *argv[]) {
assert(MSTRO_OK == status); assert(MSTRO_OK == status);
after = omp_get_wtime(); after = omp_get_wtime();
double producer_end = after;
withdraw_time = (after - before) * 1000.0*1000.0; //time in us seconds 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(); status = mstro_finalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment