Avogadro extension processing

Hi all,

I have a question about the “paint time” processing (for example, when the
paint() method of a Tool extension is called), and a “work time” processing
(to substitute an atom by a molecule and other stuff while others extensions
work).
I am working with the Avogadro version 1.0.3 under Windows Seven (in debug
mode), and, sometime, I have big slowdown. And it seems that is neither “my
work time”, nor “my paint time”, but all process which manages the “paint
time”.

But there is some mechanism (Qt and Avogadro) that I don’t sure. For
example :
In a plugin of tool type (like drawTool) :
- When the mouse is downed, manipulation and calculation are realized to
manipulate the molecule and some Qt object (it can’t work in a thread ?) ;
- In the same class/extension, the paint() method works when the
previous manipulations are finished.

Do they work in the same “main thread” ?
When the mouse is downed, the “main thread” lets this method works
immediately ? Or the “signal” is queued ?
Same questions for GLWidget.update() and the paint() method of drawTool ?
About the other extensions, do they work in the same thread ? Or they work
in different threads ?

If someone knows where I can have this information (I don’t know what
mechanism works : specific to Qt, specific to Avogadro, both ?)

Thanks,
Regards.

Mickaël Gadroy
Ingénieur d’Etudes / Consulting engineer

Université de Reims Champagne-Ardenne
Département de Mathématiques et Informatique
UFR Sciences Exactes et Naturelles
Campus du Moulin de la Housse
BP 1039 - 51687 REIMS Cedex 2 - France
www.univ-reims.fr / www.univ-reims.eu

Hi,

On Sun, Aug 28, 2011 at 6:12 PM, Mickaël Gadroy
mickael.gadroy@gmail.com wrote:

Hi all,

I have a question about the “paint time” processing (for example, when the
paint() method of a Tool extension is called), and a “work time” processing
(to substitute an atom by a molecule and other stuff while others extensions
work).
I am working with the Avogadro version 1.0.3 under Windows Seven (in debug
mode), and, sometime, I have big slowdown. And it seems that is neither “my
work time”, nor “my paint time”, but all process which manages the “paint
time”.

But there is some mechanism (Qt and Avogadro) that I don’t sure. For
example :
In a plugin of tool type (like drawTool) :
- When the mouse is downed, manipulation and calculation are realized to
manipulate the molecule and some Qt object (it can’t work in a thread ?) ;
- In the same class/extension, the paint() method works when the
previous manipulations are finished.

Do they work in the same “main thread” ?
When the mouse is downed, the “main thread” lets this method works
immediately ? Or the “signal” is queued ?
Same questions for GLWidget.update() and the paint() method of drawTool ?
About the other extensions, do they work in the same thread ? Or they work
in different threads ?

If someone knows where I can have this information (I don’t know what
mechanism works : specific to Qt, specific to Avogadro, both ?)

We use the Qt signals and slots to coordinate most of this work. Most
things are happening in the main GUI thread, paint must happen in the
main GUI thread. On Windows there are some major slowdowns associated
with the STL etc when building in Debug mode that is outside of our
control. There are some compiler defines you can add to minimize this.

If you do not see the slowdowns in Release mode I would assume this is
your major cause of slowdowns, and that simply switching to Release
mode will fix it. Hope that helps.

Marcus

Thanks for the information.

If I want to limit some work in the main GUI thread, I would like to use
Molecule.addAtom() (& co) in an other thread :
Can it work ?
Is Molecule->lock()->tryLockForWrite() enough like mutex ?
Have you some advice for the thread processing in Avogadro (priority, action
not to do, action can’t be realize …) ?

Regards,
Mickaël Gadroy

2011/8/31 Marcus D. Hanwell mhanwell@gmail.com

Hi,

On Sun, Aug 28, 2011 at 6:12 PM, Mickaël Gadroy
mickael.gadroy@gmail.com wrote:

Hi all,

I have a question about the “paint time” processing (for example, when
the
paint() method of a Tool extension is called), and a “work time"
processing
(to substitute an atom by a molecule and other stuff while others
extensions
work).
I am working with the Avogadro version 1.0.3 under Windows Seven (in
debug
mode), and, sometime, I have big slowdown. And it seems that is neither
"my
work time”, nor “my paint time”, but all process which manages the “paint
time”.

But there is some mechanism (Qt and Avogadro) that I don’t sure. For
example :
In a plugin of tool type (like drawTool) :
- When the mouse is downed, manipulation and calculation are realized
to
manipulate the molecule and some Qt object (it can’t work in a thread ?)
;
- In the same class/extension, the paint() method works when the
previous manipulations are finished.

Do they work in the same “main thread” ?
When the mouse is downed, the “main thread” lets this method works
immediately ? Or the “signal” is queued ?
Same questions for GLWidget.update() and the paint() method of drawTool ?
About the other extensions, do they work in the same thread ? Or they
work
in different threads ?

If someone knows where I can have this information (I don’t know what
mechanism works : specific to Qt, specific to Avogadro, both ?)

We use the Qt signals and slots to coordinate most of this work. Most
things are happening in the main GUI thread, paint must happen in the
main GUI thread. On Windows there are some major slowdowns associated
with the STL etc when building in Debug mode that is outside of our
control. There are some compiler defines you can add to minimize this.

If you do not see the slowdowns in Release mode I would assume this is
your major cause of slowdowns, and that simply switching to Release
mode will fix it. Hope that helps.

Marcus