Commit d4b11de4 by Camille Coti

### Beginning of the implementation of a combined algorithm

parent 42445948
 ... ... @@ -31,7 +31,7 @@ gi::ex multiply_1level_master( tensor3D_t& T, matrix_int_t& J, unsigned int size expr_c = NULL; expr_c = (char*) malloc( 3279 ); // TMP int i, j; int i, j; i = 0; j = 0; ... ... @@ -45,18 +45,18 @@ gi::ex multiply_1level_master( tensor3D_t& T, matrix_int_t& J, unsigned int size for( a1 = 0 ; a1 < size; a1++ ){ i=i+1; for( a2 = 0; a2 < size ; a2++ ){ j=j+1; for( a3 = 0 ; a3 < size ; a3++ ){ A = T[a1][a2][a3]; for( b1 = 0 ; b1 < size ; b1++ ){ parameters_t p( A, a1, a2, a3, b1 ); input.push_back( p ); } } for( a2 = 0; a2 < size ; a2++ ){ j=j+1; for( a3 = 0 ; a3 < size ; a3++ ){ A = T[a1][a2][a3]; for( b1 = 0 ; b1 < size ; b1++ ){ parameters_t p( A, a1, a2, a3, b1 ); input.push_back( p ); } } } } /* Compute the set of symbols */ /* Could be done while the first slave is working */ ... ...
 ... ... @@ -7,6 +7,7 @@ #include "parall_constants.h" #include "parall_internal.h" #include "utils.h" #include "profiling.h" namespace gi = GiNaC; ... ... @@ -149,18 +150,22 @@ void multiply_1level_slave_addslave( tensor3D_t& T, matrix_int_t& J, unsigned in int rank; MPI_Comm_rank( comm, &rank ); /* Compute the set of symbols */ gi::lst symbols = all_symbols_3D( size ); double t_start, t_wait, t_compute; /* Ask for some work */ MPI_Send( &len, 1, MPI_UNSIGNED, ROOT, TAG_PULL, comm ); /* Compute the set of symbols */ gi::lst symbols = all_symbols_3D( size ); while( true ){ /* Receive a set of parameters */ t_start = rdtsc(); MPI_Recv( ¶ms, 1, DT_PARAMETERS, ROOT, MPI_ANY_TAG, comm, &status ); t_wait = rdtsc() - t_start; if( status.MPI_TAG == TAG_WORK ){ a1 = params.a1; ... ... @@ -168,8 +173,13 @@ void multiply_1level_slave_addslave( tensor3D_t& T, matrix_int_t& J, unsigned in a3 = params.a3; b1 = params.b1; gi::symbol A( std::string( params.A ) ); t_start = rdtsc(); Tens = one_level1_product( &T, &J, A, size, a1, a2, a3, b1 ); t_compute = rdtsc() - t_start; /* TODO if we waited for too long */ if( t_wait > t_compute ) {} send_result( Tens ); ... ...