[GRASS5] 100% cpu mouse bug

Hi,

A plea:

It's probably about time to get some closure on the long-standing GRASS
6 uses 100% cpu during mouse ops. issue.

My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

For a year GRASS can't be used on thin clients which totally goes
against its original design intentions. This sucks.

I'd like for the upcoming 6.1.0 release to be a good one, and this is an
obvious wart. If substatial development of the d.* modules are to cease
after 6.2 is released, we should remember that it will probably be used
and in maintenance mode for a long time, so probably is a more than most
release to get "right". We need to start moving in that direction now.

rah rah,
Hamish

Hamish, All,

I personally don't notice any significant CPU over-use during d.*
commands involving mouse anymore, while it was a horrible and obvious
pain before. I have already mentioned this on the list but nobody
confirmed/denied. Please do.

Using 6.1 CVS 2006-04-05 I see d.zoom, d.what.rast and d.what.vect -x
don't lead to a noticable increase in CPU usage. It always stays below
few percent on a non-busy machine now. While they used to eat up to 100%
only few weeks ago. So the relevant change must be fairly fresh. These
are "details" I can provide. Who fixed that?

Yet, using d.what.vect in FORM mode, and v.digit, DOES still load the
CPU a lot. According to top the form takes 40-60 % of total CPU and
Xorg takes 20-40%. However, the good news is that even despite this
high CPU load, d.what.vect -e response time is fairly decent and
stable now. At last it is possible to edit attributes in d.what.vect -e
quite comfortebly, while it used to be a hard pain few weeks ago (one
had to wait a long time for cursor to responded to key strokes,
often the form completely freezed).

It would be great if form could be fixed to use less CPU, but I
want to let you know things are better than they used to be.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

Hamish wrote:

A plea:

It's probably about time to get some closure on the long-standing GRASS
6 uses 100% cpu during mouse ops. issue.

My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

My feelings are similar.

Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
the R_get_location_* stuff can be discarded altogether (no other
module is important enough to stand in the way of that change).

Unfortunately, I don't think anyone other than Radim understands the
vector API well enough to perform the necessary enhancements to
v.{in,out}.ascii (topology support).

--
Glynn Clements <glynn@gclements.plus.com>

On Sun, Apr 23, 2006 at 03:39:32PM +0100, Glynn Clements wrote:

Hamish wrote:

> A plea:
>
> It's probably about time to get some closure on the long-standing GRASS
> 6 uses 100% cpu during mouse ops. issue.
>
> My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

My feelings are similar.

Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
the R_get_location_* stuff can be discarded altogether (no other
module is important enough to stand in the way of that change).

Unfortunately, I don't think anyone other than Radim understands the
vector API well enough to perform the necessary enhancements to
v.{in,out}.ascii (topology support).

Time to better document it?

sorry, I couldn't resist...

Markus

On Sun, 23 Apr 2006 15:39:32 +0100
Glynn Clements <glynn@gclements.plus.com> wrote:

Hamish wrote:

> A plea:
>
> It's probably about time to get some closure on the long-standing
> GRASS 6 uses 100% cpu during mouse ops. issue.
>
> My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

My feelings are similar.

Gentlemen,

Are you reffering to the bug
http://intevation.de/rt/webrt?serial_num=3087?

I'm asking because the discussion is going on in this thread like if
nobody read my post from yesterday, in which I said that d.* modules
that use mouse (d.zoom, d.what.vext -x, d.measure) no longer utilize
100% CPU. Although they used to, only few weeks ago. Looks like the bug
is solved, though I can't find any relevant entry in the commit list,
and even Hamish seems to still have this bug (as he started the
thread).

Only v.digit and d.what.vect in FORM mode still load CPU significantly,
yet even with them the situation is _a_lot_better_ - now it is
possible to normally enter and edit attributes, not having to pray
for the form to cooperate - even though the CPU is hot.

As nobody comments on my observations, I'm wondering if I'm the only
one to notice the change for better. I think it isn't about my
particular setup, nothing special has changed in my system for over
half a year, I guess.

May I ask you for any feedback on this? How do the d.zoom and
d.what.vect work for you now?

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

When I saw your note about the recent change, I tried d.zoom. Wow! Now I don't have to worry about pausing in the middle of zooming around when I get distracted by something else.

I used to build the snapshots every week, but these days I just watch the changelog, and build a snapshot if I have time. I haven't seen anything about this being fixed either. The snapshot I just tried is 2006-4-1. Mac OS X 10.4.6.

+1 verified it's better now.

On Apr 23, 2006, at 1:05 PM, Maciek Sieczka wrote:

On Sun, 23 Apr 2006 15:39:32 +0100
Glynn Clements <glynn@gclements.plus.com> wrote:

Hamish wrote:

A plea:

It's probably about time to get some closure on the long-standing
GRASS 6 uses 100% cpu during mouse ops. issue.

My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

My feelings are similar.

Gentlemen,

Are you reffering to the bug
http://intevation.de/rt/webrt?serial_num=3087?

I'm asking because the discussion is going on in this thread like if
nobody read my post from yesterday, in which I said that d.* modules
that use mouse (d.zoom, d.what.vext -x, d.measure) no longer utilize
100% CPU. Although they used to, only few weeks ago. Looks like the bug
is solved, though I can't find any relevant entry in the commit list,
and even Hamish seems to still have this bug (as he started the
thread).

Only v.digit and d.what.vect in FORM mode still load CPU significantly,
yet even with them the situation is _a_lot_better_ - now it is
possible to normally enter and edit attributes, not having to pray
for the form to cooperate - even though the CPU is hot.

As nobody comments on my observations, I'm wondering if I'm the only
one to notice the change for better. I think it isn't about my
particular setup, nothing special has changed in my system for over
half a year, I guess.

May I ask you for any feedback on this? How do the d.zoom and
d.what.vect work for you now?

Maciek

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

> > It's probably about time to get some closure on the long-standing
> > GRASS 6 uses 100% cpu during mouse ops. issue.

..

Are you reffering to the bug
http://intevation.de/rt/webrt?serial_num=3087?

Yes.

I'm asking because the discussion is going on in this thread like if
nobody read my post from yesterday,

Sometimes it takes a while for the emails to get through the system and
read..

in which I said that d.* modules that use mouse (d.zoom, d.what.vext
-x, d.measure) no longer utilize 100% CPU. Although they used to, only
few weeks ago. Looks like the bug is solved, though I can't find any
relevant entry in the commit list, and even Hamish seems to still have
this bug (as he started the thread).

I posted without checking. As you noticed for most modules it is gone.
Brilliant.

Only v.digit and d.what.vect in FORM mode still load CPU
significantly, yet even with them the situation is _a_lot_better_ -
now it is possible to normally enter and edit attributes, not having
to pray for the form to cooperate - even though the CPU is hot.

As nobody comments on my observations, I'm wondering if I'm the only
one to notice the change for better. I think it isn't about my
particular setup, nothing special has changed in my system for over
half a year, I guess.

May I ask you for any feedback on this? How do the d.zoom and
d.what.vect work for you now?

It seems that Radim is the silent hero,
  http://grass.itc.it/pipermail/grass-commit/2006-March/021143.html
  http://grass.itc.it/pipermail/grass-commit/2006-March/021144.html
(etc.)

Maybe the same solution could be used in the form lib?

Hamish

Maciek,

I'm mainly on a Mac and so haven't had nearly as much problem with this as
others--especially those on Cygwin where it was so bad as to make things
unusable. I'm also exclusively using the new GIS Manager where this is a
moot issue.

So I really can't evaluate it. But I'm glad that it IS working better. I
haven't had time to seek out a Cygwin user and ask if it's better for them
too.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Maciek Sieczka <werchowyna@epf.pl>
Date: Sun, 23 Apr 2006 20:05:57 +0200
To: Glynn Clements <glynn@gclements.plus.com>
Cc: <hamish_nospam@yahoo.com>, <grass5@grass.itc.it>, <neteler@itc.it>
Subject: Re: [GRASS5] 100% cpu mouse bug

On Sun, 23 Apr 2006 15:39:32 +0100
Glynn Clements <glynn@gclements.plus.com> wrote:

Hamish wrote:

A plea:

It's probably about time to get some closure on the long-standing
GRASS 6 uses 100% cpu during mouse ops. issue.

My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.

My feelings are similar.

Gentlemen,

Are you reffering to the bug
http://intevation.de/rt/webrt?serial_num=3087?

I'm asking because the discussion is going on in this thread like if
nobody read my post from yesterday, in which I said that d.* modules
that use mouse (d.zoom, d.what.vext -x, d.measure) no longer utilize
100% CPU. Although they used to, only few weeks ago. Looks like the bug
is solved, though I can't find any relevant entry in the commit list,
and even Hamish seems to still have this bug (as he started the
thread).

Only v.digit and d.what.vect in FORM mode still load CPU significantly,
yet even with them the situation is _a_lot_better_ - now it is
possible to normally enter and edit attributes, not having to pray
for the form to cooperate - even though the CPU is hot.

As nobody comments on my observations, I'm wondering if I'm the only
one to notice the change for better. I think it isn't about my
particular setup, nothing special has changed in my system for over
half a year, I guess.

May I ask you for any feedback on this? How do the d.zoom and
d.what.vect work for you now?

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko
najlepsze z nich!
http://katalog.panoramainternetu.pl/

On Mon, Apr 24, 2006 at 03:27:16PM +1200, Hamish wrote:

Maciek wrote:

...

> I'm asking because the discussion is going on in this thread like if
> nobody read my post from yesterday,

Sometimes it takes a while for the emails to get through the system and
read..

We have 428 subscribers to the developers list!
:slight_smile:

Some have opted for 'no-mail' currently, but it is still
a significant number.

The new server should be faster to process Mailman list
requests but still all mails have to be sent.

cheers

Markus

On 4/23/06, Maciek Sieczka <werchowyna@epf.pl> wrote:

On Sun, 23 Apr 2006 15:39:32 +0100
Glynn Clements <glynn@gclements.plus.com> wrote:

>
> Hamish wrote:
>
> > A plea:
> >
> > It's probably about time to get some closure on the long-standing
> > GRASS 6 uses 100% cpu during mouse ops. issue.
> >
> > My feeling: Rip. Shred. Tear. Do what needs to be done. Do it now.
>
> My feelings are similar.

Gentlemen,

Are you reffering to the bug
http://intevation.de/rt/webrt?serial_num=3087?

I'm asking because the discussion is going on in this thread like if
nobody read my post from yesterday, in which I said that d.* modules
that use mouse (d.zoom, d.what.vext -x, d.measure) no longer utilize
100% CPU. Although they used to, only few weeks ago. Looks like the bug
is solved, though I can't find any relevant entry in the commit list,
and even Hamish seems to still have this bug (as he started the
thread).

Only v.digit and d.what.vect in FORM mode still load CPU significantly,
yet even with them the situation is _a_lot_better_ - now it is
possible to normally enter and edit attributes, not having to pray
for the form to cooperate - even though the CPU is hot.

As nobody comments on my observations, I'm wondering if I'm the only
one to notice the change for better. I think it isn't about my
particular setup, nothing special has changed in my system for over
half a year, I guess.

May I ask you for any feedback on this? How do the d.zoom and
d.what.vect work for you now?

Yes, I fixed first the modules which dont need to update TclTk GUI
(d.zoom, d.what.rast,d.what.vect -x) and I thought that I fixed
also the v.digit and d.what.vect. Now I see that there is still problem with
the form. Note however that R_get_location_* are fixed and the only problem
is in form.

Radim

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

On 4/23/06, Glynn Clements <glynn@gclements.plus.com> wrote:

Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
the R_get_location_* stuff can be discarded altogether (no other
module is important enough to stand in the way of that change).

Unfortunately, I don't think anyone other than Radim understands the
vector API well enough to perform the necessary enhancements to
v.{in,out}.ascii (topology support).

All you need to modify a vector is Vect_write_line(),
Vect_rewrite_line() and Vect_delete_line().

Radim

--
Glynn Clements <glynn@gclements.plus.com>

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

> Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
> the R_get_location_* stuff can be discarded altogether (no other
> module is important enough to stand in the way of that change).
>
> Unfortunately, I don't think anyone other than Radim understands the
> vector API well enough to perform the necessary enhancements to
> v.{in,out}.ascii (topology support).

All you need to modify a vector is Vect_write_line(),
Vect_rewrite_line() and Vect_delete_line().

Is "v.build option=dump" a good starting point for a format to use
to describe any vector's topology?

Hamish

On 4/27/06, Hamish <hamish_nospam@yahoo.com> wrote:

> > Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
> > the R_get_location_* stuff can be discarded altogether (no other
> > module is important enough to stand in the way of that change).
> >
> > Unfortunately, I don't think anyone other than Radim understands the
> > vector API well enough to perform the necessary enhancements to
> > v.{in,out}.ascii (topology support).
>
> All you need to modify a vector is Vect_write_line(),
> Vect_rewrite_line() and Vect_delete_line().

Is "v.build option=dump" a good starting point for a format to use
to describe any vector's topology?

What do you want to do exactly? option=dump is only for debugging.
You dont need to care about topology, you just write/delete lines
the topology is create automaticaly.

Radim

Hamish

Radim Blazek wrote:

> > > Ideally, someone would produce a Tcl/Tk replacement for v.digit, then
> > > the R_get_location_* stuff can be discarded altogether (no other
> > > module is important enough to stand in the way of that change).
> > >
> > > Unfortunately, I don't think anyone other than Radim understands the
> > > vector API well enough to perform the necessary enhancements to
> > > v.{in,out}.ascii (topology support).
> >
> > All you need to modify a vector is Vect_write_line(),
> > Vect_rewrite_line() and Vect_delete_line().
>
>
> Is "v.build option=dump" a good starting point for a format to use
> to describe any vector's topology?

What do you want to do exactly? option=dump is only for debugging.
You dont need to care about topology, you just write/delete lines
the topology is create automaticaly.

What I want to do exactly is extract vector maps from GRASS to a
textual format which can be read by e.g. Tcl/Tk programs, modify the
data, write it out in a textual format and import it back into GRASS,
all without loss of information.

v.out.ascii doesn't include the topology information, so if you want
to draw filled polygons, you have to build the topology yourself.

An example might help. I've attached a Tcl/Tk script which displays a
vector map in a Tk canvas. Sample usage (in spearfish):

  wish vect.tcl fields

It uses v.out.pov, because that was the only obvious way to extract a
vector map in a textual format with topology information. However,
v.out.pov doesn't export everything which makes up the map, only
enough to draw it. For a more general export tool, the textual format
needs to contain everything, so that the export/import cycle doesn't
lose anything.

v.out.ascii has all of the information, but not the topology (for a
while, I thought that it was omitting data, until I realised that the
boundary segments didn't define complete polygons).

Whilst I could probably figure out how to modify v.out.pov to behave a
bit more like v.out.ascii (i.e. dump out "raw" data), the main problem
is that, in order to avoid trashing users' data (which I'd really like
to avoid), you need to be sure to include /everything/ in the exported
data. Which essentially requires that you understand what you are
doing, rather than just dumping out whatever data you can find and
hoping that you haven't missed anything.

--
Glynn Clements <glynn@gclements.plus.com>

(attachments)

vect.tcl (3.06 KB)

v.out.ascii has all of the information, but not the topology (for a
while, I thought that it was omitting data, until I realised that the
boundary segments didn't define complete polygons).

Boundaries usually do not have a category number, v.out.ascii only
exports features with a category number?

I am not sure if that is correct, but many modules work that way so I
wouldn't be surprised if it were true for v.out.ascii as well.

Hamish

On 4/27/06, Glynn Clements <glynn@gclements.plus.com> wrote:

What I want to do exactly is extract vector maps from GRASS to a
textual format which can be read by e.g. Tcl/Tk programs, modify the
data, write it out in a textual format and import it back into GRASS,
all without loss of information.

v.out.ascii doesn't include the topology information, so if you want
to draw filled polygons, you have to build the topology yourself.

An example might help. I've attached a Tcl/Tk script which displays a
vector map in a Tk canvas. Sample usage (in spearfish):

        wish vect.tcl fields

It uses v.out.pov, because that was the only obvious way to extract a
vector map in a textual format with topology information. However,
v.out.pov doesn't export everything which makes up the map, only
enough to draw it. For a more general export tool, the textual format
needs to contain everything, so that the export/import cycle doesn't
lose anything.

v.out.ascii has all of the information, but not the topology (for a
while, I thought that it was omitting data, until I realised that the
boundary segments didn't define complete polygons).

Whilst I could probably figure out how to modify v.out.pov to behave a
bit more like v.out.ascii (i.e. dump out "raw" data), the main problem
is that, in order to avoid trashing users' data (which I'd really like
to avoid), you need to be sure to include /everything/ in the exported
data. Which essentially requires that you understand what you are
doing, rather than just dumping out whatever data you can find and
hoping that you haven't missed anything.

Now I understand, but I don't believe that would be a good solution.
It is not problem to export everything you want (but v.in/out.ascii
imports/exports everything).

The problem is that you need to reimplement big part of
the vector library in TclTk. For example, if an end vertex of boundary is moved,
the topology of neighbour areas have to be rebuild in order to redraw
lboundaries with oppropriate symbology. Without topological symbology
editing of topological format is nightmare. Similarly for centroids,
nodes etc. You will also need to reimplement spatial index
otherwise redraw of a bit larger file (zoomed in) will be terribly slow
as well as selection of existing lines/vertices.

Why dont you want to use C API from TclTk?

Radim

Radim Blazek wrote:

> Whilst I could probably figure out how to modify v.out.pov to behave a
> bit more like v.out.ascii (i.e. dump out "raw" data), the main problem
> is that, in order to avoid trashing users' data (which I'd really like
> to avoid), you need to be sure to include /everything/ in the exported
> data. Which essentially requires that you understand what you are
> doing, rather than just dumping out whatever data you can find and
> hoping that you haven't missed anything.

Now I understand, but I don't believe that would be a good solution.
It is not problem to export everything you want (but v.in/out.ascii
imports/exports everything).

The problem is that you need to reimplement big part of
the vector library in TclTk. For example, if an end vertex of boundary is moved,
the topology of neighbour areas have to be rebuild in order to redraw
lboundaries with oppropriate symbology. Without topological symbology
editing of topological format is nightmare. Similarly for centroids,
nodes etc. You will also need to reimplement spatial index
otherwise redraw of a bit larger file (zoomed in) will be terribly slow
as well as selection of existing lines/vertices.

Right; I hadn't considered the issue of modifying portions of large
maps. That would probably be a killer.

Why dont you want to use C API from TclTk?

Partly the effort involved in creating all of the bindings, but mostly
because it negates one of the main advantages to using Tcl/Tk, namely
the fact that you can modify the program without having to re-compile
anything (as well as eliminating compilation issues).

Also, the Tk canvas (or any similar "retained mode" graphics system)
isn't particularly well suited to editing data which is held in or
synchronised with some other system. It's designed for the case where
you let the canvas keep track of the data.

In retrospect, it would probably be better to just replace the use of
the GRASS display architecture in the existing v.digit with a
conventional GUI toolkit. I'm not sure which one; ideally something
which runs natively on MacOSX (by which, I mean "doesn't use X11").
AFAICT, that means either Qt or wxWidgets.

--
Glynn Clements <glynn@gclements.plus.com>

On 4/26/06, Radim Blazek <radim.blazek@gmail.com> wrote:

Yes, I fixed first the modules which dont need to update TclTk GUI
(d.zoom, d.what.rast,d.what.vect -x) and I thought that I fixed
also the v.digit and d.what.vect. Now I see that there is still problem with
the form. Note however that R_get_location_* are fixed and the only problem
is in form.

I added select() also to the form, everything (d.what.vect, v.digit)
should be now fixed.

Radim

> Yes, I fixed first the modules which dont need to update TclTk GUI
> (d.zoom, d.what.rast,d.what.vect -x) and I thought that I fixed
> also the v.digit and d.what.vect. Now I see that there is still
> problem with the form. Note however that R_get_location_* are fixed
> and the only problem is in form.

I added select() also to the form, everything (d.what.vect, v.digit)
should be now fixed.

d.what.vect (with an without -e) is fixed for me. Great.

v.digit still goes to 100% when I open the settings page or deselect a
tool with the right mouse button.

Almost there... once done & well tested should this be backported to
the 6.0.x line or are the changes too invasive?

Hamish

On 5/3/06, Hamish <hamish_nospam@yahoo.com> wrote:

> > Yes, I fixed first the modules which dont need to update TclTk GUI
> > (d.zoom, d.what.rast,d.what.vect -x) and I thought that I fixed
> > also the v.digit and d.what.vect. Now I see that there is still
> > problem with the form. Note however that R_get_location_* are fixed
> > and the only problem is in form.
>
> I added select() also to the form, everything (d.what.vect, v.digit)
> should be now fixed.

d.what.vect (with an without -e) is fixed for me. Great.

v.digit still goes to 100% when I open the settings page or deselect a
tool with the right mouse button.

I added nanosleep for TOOL_NOTHING if available.

Radim

Almost there... once done & well tested should this be backported to
the 6.0.x line or are the changes too invasive?

Hamish