- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a time simulation application running a fairly large model which requires a 64-bit executable to run. Without the 64-bit executable, I get virtual memory errors. Running the model in question, I am noting that, at this point, the model has been running 6 days and yet the CPU time is only 42,000 seconds. With smaller models and runs, CPU time and real time are pretty much synchronized. What sort of thrashing is going on which is causing this discrepancy?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean by real-time?
I suppose that CPU time is the total activity of your process's thread(s).In that time interval(6 days) threads will not be running whole the time.They will be wapped out and swapped in so the total time accumulated can not be exactly equal to 6 days.For more precise measurement can you use Xperf?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Was @NotThatMatters talking about some fortran timing function CPU_TIME?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 64-bit application is using 25% of the CPU all the time. This is from task manager. However, as noted in the first post, it is connected for 7 days now and has run CPU_TIME = 49000 seconds. In a "normal" run, meaning far smaller memory footprint, the disparity between clock time and CPU time is negligible. A run which takes 49000 seconds can be left at the close of the day and on return the next morning, it will be complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that at OS-hardware level such a function like CPU_TIME relies on real clock timer exactly as Xperf.Here I mean Windows platform.On Linux it will also query real time clock but the underlying OS dependent implementation could be different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you interested in total accumulated time in seconds?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We always post "elapsed time" when running our app. Typically elapsed time and UTC are comparable. Let me just point out that I gave you some bad information. The simulation is running on a Windows 8 machine and I was unfamiliar with the "new" task manager. According to what I am now reading, I am seeing memory being eaten at nearly 100% by the app, but CPU is being used in small increments (0.4%, for example), and the "Disk" is being used 50%. I am not certain what this all means.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding memory consumption is it total process working set ? In one of my earlier posts I advised to do not rely on task manager percentage of time measurement.Because it is based on real time clock interval and sometimes your thread will run shorter than the timer interval.Better option is to mesure cpu cycles charged to your thread.It can be done by process explorer.Small increments are probably related to deficiancy of timer interval because of lower time resolution.The same is related to disk I/O percentage measurement.Better option is to look at number of I/O operation per second.Small increments are related to activity of your applications where percentage of time when cpu spent on running your app is growing as staircase function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is CPU_TIME exported by fortran.dll?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The app is a compiled exe. CPU_TIME is the generic intrinsic subroutine called from within the code to report processor time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have an expectation of how much memory your simulation requires? Is it exceeding the physical memory installed, after allowing for the memory requirement of the operating system and other processes?
There is a suspicion that you are loosing time due to I/O delays, hardware conflicts or virtual memory pageing.
In Task Manager, include "Page Faults" and "PF Delta", as these indicate paging taking place with your process/simulation.
Also "Working Set (Memory)" and "Peak Working Set (Memory)", in comparison to installed memory is another indicator.
The easy solution for this delay cause is to have sufficient physical memory installed and also check that your Vitrual memory configuration is adequate. ( on Win 7 see Control Panel > System > Advanced System Settings > Performance Settings > Advanced > Virtual Memory )
Memory is cheap and unless your new memory demand is over the top ( from your 32-bit past) this might solve your problem.
Alternatively there could be hardware clashes with other processes for I/O, such as virus checkers etc, although these should not be significant. How many simulation processes are you running ?
Task manager might not be the best measure of performance, but it should be able to identify the most likely cause.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi NotThatItMatters,
what do you mean by saying real-time because it has ambiguos meaning?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I pointed it out in my first post your code cannot fully utilize your cpu resources unless system kernel mode threads are spawn and run at elevated IRQL level = 0x2 or your thread(s) is operating at real-timepriviledge level but it is not recommended because of induced starvation which can happen to some system thread.Your application must share cpu with hundreds of threads many of them running more priviledged.Moreover on multicore system code of CPU_TIME can continue running on one core when for example part of your code can be swapped out so you will not be really measuring performance of your code.For accurate performance measurement task manager is not recommended.You can profile your application with Xperf toolkit which can provide you with the nice graphical breakdown of thread activity both operating in user mode and kernel mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Memory load and store operations(Port2 and Port3) can be performed in parallel with heavy floating point calculations.The main problem will be waiting on I/O completion(asynchronous waiting) and when you inspect your thread's call stack you will see that Kernel context switching functions are on top of stack.
As John pointed out please check for number of page fault operations occuring per second because resolving page fault is very costly and can slow down your system(significant overhead created by interrupting cpu calling default kernel mode page handler(located in IDT) and calling disk.sys driver).Moreover some AV can interfere with I/O operations starting from hooking ReadFile and WriteFile to installing filter drivers and checking the buffers beign sent and received.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I meant thread's priviledge level,not an application running in real-time(in domain of video simulations).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And how my answer differs from for example John's answer he also used technical jargon?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page