Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Janek Kozicki
Vincent Richefeu said: (by the date of Fri, 3 Jul 2009 16:29:28 +0200)

> Janek,
> 
> Could you please remind me where I could include the code to perform  
> special treatment for the serialization?
> I hope my question is claire enough.
> Practically, I would like to do something like this:
> 
> if (the type of my object is 'GroupRelationData')
>   {
> I write what I want in xml format
>   }
> 
> I think that a more elegant solution could be to create a template  
> class inherited from the template class DynLibDispatcher. Somethink  
> like the MetaEngine2D.
> What is your opinion about that?


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector<> and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array and pointer counting.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Janek Kozicki
Vincent Richefeu said: (by the date of Fri, 3 Jul 2009 16:29:28 +0200)

> Janek,
> 
> Could you please remind me where I could include the code to perform  
> special treatment for the serialization?
> I hope my question is claire enough.
> Practically, I would like to do something like this:
> 
> if (the type of my object is 'GroupRelationData')
>   {
> I write what I want in xml format
>   }
> 
> I think that a more elegant solution could be to create a template  
> class inherited from the template class DynLibDispatcher. Somethink  
> like the MetaEngine2D.
> What is your opinion about that?


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector<> and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Adding new files to source

2009-07-06 Thread Janek Kozicki
Anton Gladky said: (by the date of Fri, 3 Jul 2009 10:46:27 +0200)

> It seems, I have done it! :)
> There were some problems in berlios yesterday.

after creating an account you have to wait one day, before the
database gets updated. It happened with everyone that I wanted to
give SVN access.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] Distant interractions vs. ElasticContactLaw

2009-07-06 Thread Bruno Chareyre


I confirm that the current behaviour of ElasticContactLaw (requesting 
deletion of interactions as soon as contact is lost), disable capillary 
forces between distant grains.


I'm about to implement a "interactionDetectionFactor" in the same way as 
in InteractingSphere2InteractingSphere4SpheresContactGeometry, and 
delete interaction only if distance is larger than (r1+r2)*factor.


Anybody (Vaçlav?) has a better idea?

Previous behavior : CapillaryLaw coming after ElasticLaw in the loop, 
could set isReal=True(/False when meniscii was lost) for distant 
capillary interactions.


Bruno

--

___
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Adding new files to source

2009-07-06 Thread Janek Kozicki
Anton Gladky said: (by the date of Fri, 3 Jul 2009 10:46:27 +0200)

> It seems, I have done it! :)
> There were some problems in berlios yesterday.

after creating an account you have to wait one day, before the
database gets updated. It happened with everyone that I wanted to
give SVN access.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Janek Kozicki
Vincent Richefeu said: (by the date of Fri, 3 Jul 2009 16:29:28 +0200)

> Janek,
> 
> Could you please remind me where I could include the code to perform  
> special treatment for the serialization?
> I hope my question is claire enough.
> Practically, I would like to do something like this:
> 
> if (the type of my object is 'GroupRelationData')
>   {
> I write what I want in xml format
>   }
> 
> I think that a more elegant solution could be to create a template  
> class inherited from the template class DynLibDispatcher. Somethink  
> like the MetaEngine2D.
> What is your opinion about that?


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector<> and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array and pointer counting.

-- 
Janek Kozicki |

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


[Yade-dev] Questions on profiling

2009-07-06 Thread Bruno Chareyre

I just ran a profiling job, and I have a questionning result.

45% of cpu time is used for the function "mcount" from libc.

According to some googling :

"gcc inserts calls to mcount() at the start and end of functions if 
profiling (-p) is enabled."


That is good, it seems this operation will not take time if profiling is 
disabled (and it takes so much time because of function calls like 
"iterator++" or "body::byId(i)").


But then I have two questions in mind :
1. How comes valgrind/kcachegrind is not removing the time for mcount 
from results? It would make sense.
2. Why could I profile for years without option -p and I could get 
(apparently) consistent results?


Just asking in case somebody knows the answer already.

Bruno

--

___
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Vincent Richefeu


Le 6 juil. 09 à 12:11, Janek Kozicki a écrit :


Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector<> and it will work straight away.


The class I want to serialize is GroupRelationData.
The problem come with a vector.


otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array.


I could 'register' a vector > > but last time  
you said me that it didn't work...


At this moment, I'm testing an alternative solution (currently, yade  
is compiling):
I added the private string commands_ in the class GroupRelationData.  
Only this string is 'REGISTER_ATTRIBUTED' .
In fact, the string is a kind of 'command stream' that can be  
interpreted by the class to set the variables.


example of string:
"ngrp 2 ;  parameter kn ; set all kn 1e6 ; parameter mu ; set mu 1 1  
0.5 ; set mu 0 1 0.0"








___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Vincent Richefeu

When a string is serialized, all space characters become  
Is this normal?
How can I do to avoid this?

thanks,
VR

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Adding new files to source

2009-07-06 Thread Anton Gladky
Thank you! It works already.
__
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy


2009/7/6 Janek Kozicki 

> Anton Gladky said: (by the date of Fri, 3 Jul 2009 10:46:27 +0200)
>
> > It seems, I have done it! :)
> > There were some problems in berlios yesterday.
>
> after creating an account you have to wait one day, before the
> database gets updated. It happened with everyone that I wanted to
> give SVN access.
>
> --
> Janek Kozicki |
>
> ___
> Mailing list: 
> https://launchpad.net/~yade-dev
> Post to : yade-dev@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Questions on profiling

2009-07-06 Thread Václav Šmilauer


1. How comes valgrind/kcachegrind is not removing the time for mcount 
from results? It would make sense.
See answer to 2. mcount() and -p is orthogonal to valgrind profiling 
technique.
2. Why could I profile for years without option -p and I could get 
(apparently) consistent results?
Valgrind uses different profiling technique (dynamic code 
translation/instrumentation), whereas profiling with -p inserts special 
call at the beginning (and end, I assume) of every function at compile 
time. -p is used if compiling with profile=1. Valgrind does not need 
recompilation.


Vaclav

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Václav Šmilauer



When a string is serialized, all space characters become  
Is this normal?
Yes, they are translated so that special characters in string don't 
confuse the parser. They are translated back to unescaped characters 
when reading the stream automatically. No need to avoid that.


V.


___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] [deprecated list] Special serialization treatment

2009-07-06 Thread Václav Šmilauer



Are you trying to serialize a C array? It's not supported. And won't
ever be. You don't want to add support for it. Easiest if you switch
to std::vector<>  and it will work straight away.

otherwise I don't see what is the problem. REGISTER_ATTRIBUTE works
for every type, except C array and pointer counting.

   
Vincent, you can have a look at 
InteractionContainer::preProcessAttributes and postProcessAttributes. It 
feeds interactions (stored in an implementation-defined way) in a 
vector, which is serializable, then at deserialization, loads them from 
the vector the the timplementetion-defined memory structures.


You should be able to do the same with GroupRelationData. Transform 
vector to linear vector  and few other parameters that 
are serializable (for instance), do the same fror bool** act.


It shold work just fine.

Vaclav

___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-dev] Questions on profiling

2009-07-06 Thread Bruno Chareyre
I can confirm that yade is about 30% faster when profiling is disabled, 
and that callgring still give similar results (except that it is a lot 
more readable since you don't have to mentaly remove time spent in 
mcount). No debug symbols needed either.


Bruno



Bruno Chareyre a écrit :

I just ran a profiling job, and I have a questionning result.

45% of cpu time is used for the function "mcount" from libc.

According to some googling :

"gcc inserts calls to mcount() at the start and end of functions if 
profiling (-p) is enabled."


That is good, it seems this operation will not take time if profiling 
is disabled (and it takes so much time because of function calls like 
"iterator++" or "body::byId(i)").


But then I have two questions in mind :
1. How comes valgrind/kcachegrind is not removing the time for mcount 
from results? It would make sense.
2. Why could I profile for years without option -p and I could get 
(apparently) consistent results?


Just asking in case somebody knows the answer already.

Bruno




--

___
Chareyre Bruno
Maitre de conference

Grenoble INP
Laboratoire 3SR - bureau E145
BP 53 - 38041, Grenoble cedex 9 - France
Tél : 33 4 56 52 86 21
Fax : 33 4 76 82 70 43



___
Mailing list: https://launchpad.net/~yade-dev
Post to : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp