Assembla home | Assembla project page
 

Ticket #142 (new task)

Opened 2 months ago

Last modified 2 months ago

Check FLOP calculations

Reported by: phillicl Assigned to: joaander
Priority: trivial Milestone:
Component: Analyzers Keywords:
Cc:

Description

Looking at the the FLOP calculations in the harmonic bond calculation, it looks like some of the numbers may be off (unless I am missing something, like is it assumed that the compiler is smart enough to not do two identical calculations). So the numbers being fed to the profiler is slightly inaccurate.

//I count 15, not 14

// FLOPS: 14 / MEM TRANSFER: 2 Scalars Scalar rsq = dx*dx+dy*dy+dz*dz; // 5 Scalar r = sqrt(rsq); //1 Scalar forcemag_divr = m_K[bond.type] * (m_r_0[bond.type] / r - Scalar(1.0)); //3 Scalar bond_eng = Scalar(0.5) * Scalar(0.5) * m_K[bond.type] * (m_r_0[bond.type] - r) * (m_r_0[bond.type] - r); //6

Carolyn - does the 1.0/6.0 not count? I count 3 FLOPS.

// calculate the virial (FLOPS: 2) Scalar bond_virial = -Scalar(1.0/6.0) * rsq * forcemag_divr;

Attachments

Change History

09/22/08 17:05:24 changed by joaander

1.0/6.0 and 0.5 * 0.5 are operations on compile time literals. The compiler's constant propagation optimizer will most certainly perform these operations at compile time.


Add/Change #142 (Check FLOP calculations)