Commit 303627ad authored by Camille Coti's avatar Camille Coti
Browse files

Time measurements

parent 40feff07
...@@ -134,9 +134,9 @@ gi::ex multiply_1level_master_addslave( tensor3D_t& T, unsigned int size, MPI_Co ...@@ -134,9 +134,9 @@ 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 << t2 - t1 << std::endl; std::cout << t2 - t1 ;
std::cout << "\t " << t3 - t2 << std::endl; std::cout << "\t " << t3 - t2;
std::cout << "\t " << t4 - t3 << std::endl; std::cout << "\t " << t4 - t3;
std::cout << "\t " << t5 - t4 << std::endl; std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
......
...@@ -412,9 +412,9 @@ gi::ex multiply_1level_master_addslave4( tensor3D_t& T, unsigned int size, MPI_C ...@@ -412,9 +412,9 @@ 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 << t2 - t1 << std::endl; std::cout << t2 - t1;
std::cout << "\t " << t3 - t2 << std::endl; std::cout << "\t " << t3 - t2;
std::cout << "\t " << t4 - t3 << std::endl; std::cout << "\t " << t4 - t3;
std::cout << "\t " << t5 - t4 << std::endl; std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
......
...@@ -24,8 +24,11 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD ) ...@@ -24,8 +24,11 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD )
MPI_Comm_size( comm, &size ); MPI_Comm_size( comm, &size );
MPI_Comm_rank( comm, &rank ); MPI_Comm_rank( comm, &rank );
std::vector<double> times;
step = 0; step = 0;
if( 0 == rank ) times.push_back( getTime() );
while( ( 0x1 << step ) < size ) { while( ( 0x1 << step ) < size ) {
if( 0 == ( rank % ( 0x1 << ( step + 1 ) ) ) ) { if( 0 == ( rank % ( 0x1 << ( step + 1 ) ) ) ) {
...@@ -36,6 +39,7 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD ) ...@@ -36,6 +39,7 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD )
if( buddy < size ) { if( buddy < size ) {
/* receive the result and add it */ /* receive the result and add it */
Tens += recv_result( buddy, symbols, comm ); Tens += recv_result( buddy, symbols, comm );
if( 0 == rank ) times.push_back( getTime() );
} }
} else { } else {
...@@ -48,6 +52,14 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD ) ...@@ -48,6 +52,14 @@ gi::ex add_tree( gi::ex mine, gi::lst symbols, MPI_Comm comm = MPI_COMM_WORLD )
} }
step++; step++;
} }
if( 0 == rank ) {
for( auto t: times ){
std::cout << t - times[0] << "\t" ;
}
std::cout << std::endl;
}
return Tens; return Tens;
} }
...@@ -125,9 +137,9 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm ...@@ -125,9 +137,9 @@ gi::ex multiply_1level_master_local( tensor3D_t& T, unsigned int size, MPI_Comm
add_tree( Tens, symbols, comm ); add_tree( Tens, symbols, comm );
double t5 = getTime(); double t5 = getTime();
std::cout << t2 - t1 << std::endl; std::cout << t2 - t1;
std::cout << "\t " << t3 - t2 << std::endl; std::cout << "\t " << t3 - t2;
std::cout << "\t " << t4 - t3 << std::endl; std::cout << "\t " << t4 - t3;
std::cout << "\t " << t5 - t4 << std::endl; std::cout << "\t " << t5 - t4 << std::endl;
#if DEBUG #if DEBUG
......
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