View Issue Details

IDProjectCategoryView StatusLast Update
0000460ascendpygtk guipublic2011-04-11 21:48
Reporterjohn 
Assigned Tojohn 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version0.9.7 
Target Version1.0Fixed in Version0.9.8 
Summary0000460: 'time to build system' gives nonsense info
DescriptionWhen ASCEND loads a model in the PyGTK GUI, the 'time to build system' reported is often something like '10^-18', which is nonsense in any system of units. It should be fixed or removed.
TagsNo tags attached.

Relationships

Activities

ujjavalverma10

2011-04-09 03:56

reporter   ~0000717

Last edited: 2011-04-09 04:17

View 2 revisions

Replacing Line 91 in /ascend/system/system.c file by the following line of code solves the problem. I have uploaded the modified system.c file. I hope this helps.
-- code --
 
FPRINTF(stderr,"Time to build system = %.4lf s (outputs zero for very small build time)\n", ((tm_cpu_time() - comptime)>=0.00001)?(tm_cpu_time()-comptime):0);

-- code ends --

ujjavalverma10

2011-04-09 04:16

reporter  

system.c (3,681 bytes)

john

2011-04-09 13:30

administrator   ~0000721

I believe that simply rounding off the value is not the solution here. Compiling a model should take a certain non-zero number of milliseconds, I would have expected. I suspect that the wrong time-elapsed functions are being used here.

john

2011-04-09 13:31

administrator   ~0000722

Again, please contribute your fixes in the form of a patch, eg

svn diff > ujjaval-bug460.patch

ujjavalverma10

2011-04-11 03:57

reporter  

ujjaval-issue460.patch (506 bytes)
Index: ascend/system/system.c
===================================================================
--- ascend/system/system.c	(revision 3336)
+++ ascend/system/system.c	(working copy)
@@ -88,7 +88,7 @@
   slv_set_instance(sys,inst);
 
 #if DOTIME
-  FPRINTF(stderr,"Time to build system = %g\n", (tm_cpu_time() - comptime));
+  FPRINTF(stderr,"Time to build system = %g s (outputs zero for build time < 1ms )\n", ((tm_cpu_time() - comptime)>=0.00001)?(tm_cpu_time()-comptime):0);
 #endif
   return(sys);
 }

ujjavalverma10

2011-04-11 04:03

reporter   ~0000723

I tested the unmodified code for many models. It actually works fine for large models that take more than a few Milli Seconds to solve. For eg : ascend/models/johnpye/absorber.a4c or other more complex models. Garbage values are printed only for very simple models. I have uploaded the patch file that takes care of complex as well as very simple models whose solving time is less than the precision limit of the time functions being used.

john

2011-04-11 21:48

administrator   ~0000726

Fixed in changeset 3365. Timing is now shown on the console only.

Issue History

Date Modified Username Field Change
2010-05-31 11:41 john New Issue
2011-02-22 17:34 john Target Version => 1.0
2011-04-09 03:56 ujjavalverma10 Note Added: 0000717
2011-04-09 04:16 ujjavalverma10 File Added: system.c
2011-04-09 04:17 ujjavalverma10 Note Edited: 0000717 View Revisions
2011-04-09 13:30 john Note Added: 0000721
2011-04-09 13:31 john Note Added: 0000722
2011-04-11 03:57 ujjavalverma10 File Added: ujjaval-issue460.patch
2011-04-11 04:03 ujjavalverma10 Note Added: 0000723
2011-04-11 21:48 john Note Added: 0000726
2011-04-11 21:48 john Status new => resolved
2011-04-11 21:48 john Fixed in Version => 0.9.8
2011-04-11 21:48 john Resolution open => fixed
2011-04-11 21:48 john Assigned To => john