Commit 0e4ebad2 authored by Camille Coti's avatar Camille Coti
Browse files

Stuff missing from the previous commit

parent 9729a08f
......@@ -10,88 +10,7 @@ namespace gi = GiNaC;
* Big multiplication *
*******************************************************************************/
gi::ex multiply_seq( tensor3D_t& T, matrix_int_t& J, int size ) { // simpler: same dimension everywhere
gi::ex Tens = 0;
int a1, a2, a3, b1, b2, b3, c1, c2, c3, d1, d2, d3;
gi::ex TAB, TABB, TABC, TABCC, TABCD, TABCDD;
gi::ex A;
int i, j;
i = 0;
j = 0;
const char timerA[] = "A";
const char timerB[] = "B";
const char timeradd[] = "add";
double timeA, timeB;
uint64_t t_start, t_end;
for( a1 = 0 ; a1 < size; a1++ ){
i=i+1;
// std::cout << "Tens: " << Tens << std::endl;
// printf("i = %d\n", i);
for( a2 = 0; a2 < size ; a2++ ){
j=j+1;
// printf("j = %d\n", j);
for( a3 = 0 ; a3 < size ; a3++ ){
TAU_START( timerA );
A = T[a1][a2][a3];
/* Beyond this point, a2 and a3 are only used in the simplectic matrix */
for( b1 = 0 ; b1 < size ; b1++ ){
TAB = J[a1][b1];
for( b2 = 0 ; b2 < size ; b2++ ){
for( b3 = 0 ; b3 < size ; b3++ ){
TAU_START( timerB );
/* Beyond this point, b1 is not used anymore */
TABB = TAB * A*T[b1][b2][b3];
for( c1 = 0 ; c1 < size ; c1++ ){
for( c2 = 0 ; c2 < size ; c2++ ){
TABC = TABB * J[a2][c2];
for( c3 = 0 ; c3 < size ; c3++ ){
TABCC = TABC * T[c1][c2][c3] * J[b3][c3] ;
for( d1 = 0 ; d1 < size ; d1++ ){
TABCD = TABCC * J[c1][d1];
for( d2 = 0 ; d2 < size ; d2++ ){
TABCDD = TABCD * J[b2][d2];
for( d3 = 0 ; d3 < size ; d3++ ){
TAU_START( timeradd );
t_start = rdtsc();
Tens = Tens + TABCDD * T[d1][d2][d3]*J[a3][d3];
t_end = rdtsc();
TAU_STOP( timeradd );
#ifdef TAUPROF
// std::cout << "add " << getTimeSpent( timeradd ) << " len " << Tens.nops() << std::endl;
printf( "add %lf %lu len %d\n", getTimeSpent( timeradd ), t_end - t_start, Tens.nops() );
// std::cout << Tens << std::endl;
#endif // TAUPROF
}
}
}
}
}
}
TAU_STOP( timerB );
#ifdef TAUPROF
std::cout << "B " << getTimeSpent( timeradd ) << " len " << Tens.nops() << std::endl;
#endif // TAUPROF
}
}
}
TAU_STOP( timerA );
#ifdef TAUPROF
std::cout << "A " << getTimeSpent( timeradd ) << " len " << Tens.nops() << std::endl;
#endif // TAUPROF
}
}
}
return Tens;
}
gi::ex multiply_seq2( tensor3D_t& T, matrix_int_t& J, int size ) {
gi::ex multiply_seq( tensor3D_t& T, matrix_int_t& J, int size ) {
gi::ex Tens = 0;
int a1, a2, a3, a4, a5, a6;
......
......@@ -127,8 +127,6 @@ int main( int argc, char** argv ){
init_simplectic( J, N, N );
gi::ex Tpar2;
/* Compute it in parallel */
tv_start = getTime();
......
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