Commit 40feff07 authored by Camille Coti's avatar Camille Coti
Browse files

Timers

parent a403e776
...@@ -134,10 +134,10 @@ gi::ex multiply_1level_master_addslave( tensor3D_t& T, unsigned int size, MPI_Co ...@@ -134,10 +134,10 @@ gi::ex multiply_1level_master_addslave( tensor3D_t& T, unsigned int size, MPI_Co
Tens = add_expressions( results, symbols ); Tens = add_expressions( results, symbols );
double t5 = getTime(); double t5 = getTime();
std::cout << "Init: " << t2 - t1 << std::endl; std::cout << t2 - t1 << std::endl;
std::cout << "Loop: " << t3 - t2 << std::endl; std::cout << "\t " << t3 - t2 << std::endl;
std::cout << "Fini: " << t4 - t3 << std::endl; std::cout << "\t " << t4 - t3 << std::endl;
std::cout << "Add: " << t5 - t4 << std::endl; std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
std::cout << "Received " << receivedresults << " results" << std::endl; std::cout << "Received " << receivedresults << " results" << std::endl;
......
...@@ -412,10 +412,10 @@ gi::ex multiply_1level_master_addslave4( tensor3D_t& T, unsigned int size, MPI_C ...@@ -412,10 +412,10 @@ gi::ex multiply_1level_master_addslave4( tensor3D_t& T, unsigned int size, MPI_C
Tens = add_expressions_parall( results, symbols, pzero, comm ); Tens = add_expressions_parall( results, symbols, pzero, comm );
double t5 = getTime(); double t5 = getTime();
std::cout << "Init: " << t2 - t1 << std::endl; std::cout << t2 - t1 << std::endl;
std::cout << "Loop: " << t3 - t2 << std::endl; std::cout << "\t " << t3 - t2 << std::endl;
std::cout << "Fini: " << t4 - t3 << std::endl; std::cout << "\t " << t4 - t3 << std::endl;
std::cout << "Add: " << t5 - t4 << std::endl; std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
std::cout << "Received " << receivedresults << " results" << std::endl; std::cout << "Received " << receivedresults << " results" << std::endl;
......
...@@ -76,7 +76,9 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm ...@@ -76,7 +76,9 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm
std::vector<parameters_2_1_t> input; std::vector<parameters_2_1_t> input;
std::vector<std::string> results; /* length and char* */ std::vector<std::string> results; /* length and char* */
/* Build a list of argument sets */ double t1 = getTime();
/* Build a list of argument sets */
for( a4 = 0 ; a4 < N ; a4++ ){ for( a4 = 0 ; a4 < N ; a4++ ){
for( a2 = 0; a2 < N ; a2++ ){ for( a2 = 0; a2 < N ; a2++ ){
...@@ -90,6 +92,8 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm ...@@ -90,6 +92,8 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm
symbols = all_symbols_3D( size ); symbols = all_symbols_3D( size );
double t2 = getTime();
/* Distribute the work */ /* Distribute the work */
while( input.size() > 0 ) { while( input.size() > 0 ) {
...@@ -101,6 +105,8 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm ...@@ -101,6 +105,8 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm
} }
double t3 = getTime();
/* Wait until everyone is done */ /* Wait until everyone is done */
running = np - 1; // all the slaves are running running = np - 1; // all the slaves are running
...@@ -112,10 +118,18 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm ...@@ -112,10 +118,18 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm
running--; running--;
} }
double t4 = getTime();
/* Take part of the tree */ /* Take part of the tree */
add_tree( Tens, symbols, comm ); add_tree( Tens, symbols, comm );
double t5 = getTime();
std::cout << t2 - t1 << std::endl;
std::cout << "\t " << t3 - t2 << std::endl;
std::cout << "\t " << t4 - t3 << std::endl;
std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
std::cout << "Received " << receivedresults << " results" << std::endl; std::cout << "Received " << receivedresults << " results" << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment