forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple bugs associated with %pl format code

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Fri Jan 28, 2011 5:54 pm    Post subject: Multiple bugs associated with %pl format code Reply with quote

Here is a bug report I have just submitted to Silverfrost, which should be of interest to anyone using the automatic mode of access to SIMPLEPLOT. "This is by far the easiest way to access the SIMPLEPLOT library from ClearWin+", says the manual, and whilst I can't argue with that as a literal statement, I will note only that accessing it and getting it to work correctly are not at all the same thing, as I have spent the last few days finding out ...

Hello again Robert,

I have been wrestling with Simpleplot the last few days, and getting strange results, so I set out to see if I could reproduce any of the problems in a short segment of code. It turned out to be surprisingly easy to isolate and illustrate a couple of misbehaviours.

Bug report code 1 is a cunning basis for plotting more than one graph when the x values are different for each graph (at the cost of being increasingly wasteful of storage as the number of graphs increases). Unfortunately, it invariably plots the last point of the first series as the first point of the second series. Click Plot a few times to see that this is so. I have not investigated what happens with more than two graphs.

To get to this stage, I had to simplify a feature of the code that I had not expected to be of importance. When I started writing this little illustration, x, y1 and y2 were allocatable, and n1 and n2 could be changed in the UI, to give two graphs each with a different number of points every time. However, this proved unexpectedly troublesome, and so I simplified to static arrays, not because I thought it was the problem, simply in order to achieve simpler illustrative code. However, I have now revisited this aspect, and am able to illustrate additional latent problems with the %pl format code.

Bug report code 2 is expanded from bug report code 1. The only difference is that the arrays are allocatable rather than static. As submitted below, if the code is built and run, the /RELEASE build gives a runtime error, whereas the /DEBUG and /CHECKMATE builds give an access violation. Judging by the runtime error traceback, the underlying problem is related to the one associated with the %sh format code which I reported at the start of this week. Once again, I can not isolate the line of code that triggers the problem.

This problem can be made to go away by uncommenting the three commented-out lines of code in the main program. However, this introduces other problems, particularly interesting because all of the /RELEASE, /DEBUG and /CHECKMATE builds now behave incorrectly in a different way! One feature they all have in common is that when they do plot the data apparently correctly, in fact the plots have the same problem as bug report code 1. I'll call this "correct" for short.
- The /RELEASE build initial plot has the x axis incorrect, and the wrong number of points. The first replot is "correct". Subsequent replots alternate between these two modes.
- The /DEBUG build initial plot is "correctly". The first attempt to replot causes the debugger to highlight the call to simpleplot_redraw@ and declare an invalid floating point operation.
- The /CHECKMATE build initial plot has the x axis scaled incorrectly, but in a different way to the /RELEASE build. It also has just a single spurious data point at the origin. This plot does not change as it is repeatedly redrawn.

Small wonder I have been having problems getting my real code to work considering that it features multiple sheets with a %pl region on each that is trying to plot allocatable arrays ...

Andy

-----

Bug report code 1
[code:1:c9a03f894e]
program multpltest
use callbax
character (len = 100) chapel
integer iodial
chapel = '%pl[n_graphs=2,style=1,colour=black,style=1,colour=red,x_array,y_min=0.0,y_max=1.0]&'
iodial = winio@ ('%ca[Testing multiple plots]&')
iodial = winio@ ('%sc&', plotme)
iodial = winio@ 
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Feb 02, 2011 11:46 am    Post subject: Reply with quote

Andy

If you have sent the source code to Silverfrost then I will be able to look at it shortly. However, we don't have access to the SimpePlot library so I can only make changes to the ClearWin+ interface to SimplePlot.
Back to top
View user's profile Send private message AIM Address
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Wed Feb 02, 2011 1:10 pm    Post subject: Re: Reply with quote

Hi Paul,

Yes, I understand that. I submitted the code in the expectation that at least some of the issues will indeed be in the ClearWin+ interface to Simpleplot. Simpleplot can't know whether data arrays are allocatable or static, or what type of build of exe it is being summoned from, so if the output depends on such differences it seems to me these must be issues with the interface.

Andy
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Feb 16, 2011 12:59 pm    Post subject: Reply with quote

I have now investigated the sample that you sent directly to Silverfrost and this reveals a %ps bug that I have now fixed for the next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group