473,883 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating MFLOPS

Hi,

Can someone tell me how to calculate MFLOPS for the following C# code
(on a Pentium 4 2.0 Ghz)?

for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
for (k=0; k<n; k++)
{
C[i,j] = C[i,j] + A[i,k] * B[k,j];
}
}
}

Thanks!

Miller

Nov 15 '05 #1
3 5350
What's the point of calculating MFLOPS? What does it show us when
normally we can't get the maximum amount of floating point operations,
as we should. What can we normally tell with such a measure? I'm sure
two different compilers (doing different things) would give separate
results... so can we then predict how good or bad one is from the other?

Thanks

James

Anders Forsgren wrote:
If the process takes a fair amount of time, you can use the tick count or
current time to measure the time for completion. i.e. The number of
operations is
2*n^3 then divide by one million times the number of seconds to get the
approximate MFLOP count. Your processor model and clock really only matters
if you assume the thread is the only thread executing, which is not that
likely.

System.DateTime start = System.DateTime .Now;

for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
for (k=0; k<n; k++)
{
C[i,j] = C[i,j] + A[i,k] * B[k,j];
}
}
}

System.DateTime end = System.DateTime .Now;

double dt = now.Subtract(st art).TotalSecon ds;

double mflops = (2*n*n*n) / (1e6 *dt);

System.Diagnost ics.Debug.Write Line("Time : "+dt+" seconds, MFLOPS:
"+mflops);

Note however that this needs the time dt to be fairly long (i.e. n needs to
be fairly large).

/A



Nov 15 '05 #2

"James" <sn****@jamison .snort> wrote in message
news:3f******** @clarion.carno. net.au...
What's the point of calculating MFLOPS? What does it show us when
normally we can't get the maximum amount of floating point operations,
as we should. What can we normally tell with such a measure? I'm sure
two different compilers (doing different things) would give separate
results... so can we then predict how good or bad one is from the other?


The MegaFLOP (million floating point operations per second) is an old
measure of supercomputer performance, dating from the days when
supercomputers ran at 50 MHz.

Many operating systems let you measure the CPU time of an individual thread.
That's how it was normally done, although I occasionally saw MFLOP ratings
based on "wall clock time" instead. In that case you'd do your best to keep
other threads from running during the test.
Nov 15 '05 #3

"Michael A. Covington" <Mi*****@Coving tonInnovations. com> wrote in
message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..

"James" <sn****@jamison .snort> wrote in message
news:3f******** @clarion.carno. net.au...
What's the point of calculating MFLOPS? What does it show us when
normally we can't get the maximum amount of floating point operations, as we should. What can we normally tell with such a measure? I'm sure two different compilers (doing different things) would give separate
results... so can we then predict how good or bad one is from the
other?
The MegaFLOP (million floating point operations per second) is an old
measure of supercomputer performance, dating from the days when
supercomputers ran at 50 MHz.


Or you're desperately trying to sell Apple computers, in which
case you might as well claim it goes "1,000,000 MPH"

:)

-c
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8813
by: Ron Adam | last post by:
Hi, I'm having fun learning Python and want to say thanks to everyone here for a great programming language. Below is my first Python program (not my first program) and I'd apreciate any feedback on how I might do things differently to make it either more consice, readable, or faster. ie... are there better ways to do it in Python? It won't break any records for calculating pi, that wasn't my goal, learning Python was. But it might...
0
2279
by: Kasp | last post by:
Hi there, I am trying to make an OLAP cube on a table having two columns (datetime, Number_of_times_an_event_occured). My dimension is time and I want to measure the Min and Max times an event occured over time. I have no problem in calculating Maximum occurance of events over time. However, I have some NULL values in my Number_of_times_an_event_occured column, due to which I don't see any result when I try to calculate
1
3355
by: Joe Bongiardina | last post by:
What does the message "calculating...." mean in the lower left status area of a form? I have a form with no calculated, concatenated or lookup fields, yet it displays this msg. The form takes forever to open and I'm wondering what it's "calculating" and if that's the bottleneck. Thanks.
1
2381
by: jlm | last post by:
I have a form which feeds table (TblEmpLeave) of Employee Leave Time (time taken off for Administrative, Annual, Sick, Compensation leave). I have EmpID, LeaveDate, LeaveType, LeaveHours fields on this form. Any employee can have multiple entries in the table (key fields are EmpID and LeaveID) for multiple dates (John Doe can take 3 days annual leave, then take 3 days sick leave in any given month. I have a BeginningBalance of hours that...
0
1794
by: robin9876 | last post by:
In an Access 2000 database on some forms 'Calculating...' is continuously displayed in the status bar window and the text of the control is automatically selected. The only workaround is switching to another application and back between each field that data is entered. I have tried this database on pc's that have office 2000 SP1a and SP3. How do investigate what is causing this calculating issue and how do I resolve it?
5
11956
by: sugaray | last post by:
Hi, my problem with calculating the size of an array is when I pass an array as a parameter to a function which perform the calculation, the result never comes right, like below: int SizeOfArray(int a) { return (sizeof(a)/sizeof(a)); } main() { int a={1,2,3}; printf("%d\n",SizeOfArray(a));
1
1286
by: Michael | last post by:
Is it possible to make a 1992 flops.c program by Al Alburto which compiled in VC++ 6.0 on Windows XP work on a Pocket PC with windows mobile 2003 second edition. I haven't programmed for a long time. Is it required to have .net compact framework to transfer to PPC 2003? If you know the Mflops for a Dell Axim 30 at 624 Mhz, Please state instead of how to make C program work on Dell Axim.
25
5036
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for learning advanced C.thx.
1
2436
by: laredotornado | last post by:
Hi, Can anyone recommend a free script for calculating UPS shipping? I am familiar with the script written in 2000 by Jason Costomiris, but UPS is using an XML interface and I wondered if there's anything more updated. The pages I located on Google turned up broken links. Thanks, - Dave
0
9948
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10767
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9588
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6008
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3242
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.