pNbody/src/streelib4fbc3430dc96master
streelib
Readme
plus de topnodes plus de pseudo particles pas d'unequal softenning pas de periodic box pas de gravite adaptatif
treelib.002.c : version stable, avec plusieurs particules par noeud,
treelib.c : on essaye d'ajouter le nombre de particules permises par noeuds
see end of the file...
but : avoir un tree minimal
domain_Decomposition
domain_findExtent ok domain_determineTopTree self->TopNodes[0] domain_topsplit_local
domain_walktoptree
force_treeallocate
self->Nodes
force_treebuild
force_treebuild_single *force_create_empty_nodes (no longer necessary) * -- insert particles -- self->last = -1; /* pointe sur le dernier noeud fait */ *force_update_node_recursive
TOUT OK
implementation de la suite:
la suite :
- regarder un peu force_tree
- stoquer plusieurs particules par noeuds...
- construction
--> ok, on peut utiliser Nextnode pour cela a) on pointe sur Node => fin de la liste
- construction
how to remove topNodes ?
---> ok,done :-)
....> j'ai un treecode minmal...
- # ##############
TopNodes[no].Daughter == -1 --> pas cde cellules filles
struct topnode_data {
int Daughter; /*!< index of first daughter cell (out of 8) of top-level node */ int Pstart; /*!< for the present top-level node, this gives the index of the first node in the concatenated list of topnodes collected from all processors */ int Blocks; /*!< for the present top-level node, this gives the number of corresponding nodes in the concatenated list of topnodes collected from all processors */ int Leaf; /*!< if the node is a leaf, this gives its number when all leaves are traversed in Peano-Hilbert order */ peanokey Size; /*!< number of Peano-Hilbert mesh-cells represented by top-level node */ peanokey StartKey; /*!< first Peano-Hilbert key in top-level node */ long long Count; /*!< counts the number of particles in this top-level node */
};
si une cellule contiend plus que self->All.TotNumPart / (TOPNODEFACTOR * self->NTask * self->NTask) (dans topsplit local) particules, on l'ouvre.
extern int *DomainNodeIndex; /*!< this table gives for each leaf of the top-level tree the corresponding node of the gravitational tree */
???? quand est que DomainNodeIndex est remplis ?
- count the number of part in a node ##############
struct NODE
int count[8]; /* number of particles contained by each daughter node*/ int first[8]; /* index of first particle inside the daughter node*/ int last[8]; /* index of last particle inside the daughter node*/ !!! this requires a lot of memory !!! !!! should do this only if a daugher contains a list of particle !!! !!! .first[subnode] should be equal to .u.suns[subnode] !!! count is not necessary, can check if first=last
struct particle_data
int next;
actuellement:
Thu Oct 28 23:31:53 CEST 2010
need to test
if (self->Nodes[parent].count[subnode]>=1) --> if (self->Nodes[parent].count[subnode]>=2)
Fri Oct 29 21:30:32 CEST 2010 ok it seems to work
-> now, we need a tool to explore the tree
in python * draw the nodes * draw the particles
do it in C : tree_walk_recursive
Sat Oct 30 21:18:54 CEST 2010
-> ok, la construction du tree est ok
-> need to flag the cells
add : ListOfPartLists (size=maxpart + MAXTOPNODES) !!! bien trops grand...
do not forget : self->ListOfPartLists[-1] = -1 pour stoper
self->last = -1 (au debut)
no : node sib : ? father : noeud d'en haut
Sat Oct 30 22:33:06 CEST 2010
Sun Oct 31 21:28:42 CET 2010
suite: modifier le calcul des potentiel,
--> somme sur la liste
force_treeevaluate_local_potential
ok, semble marcher
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! il faut du calcul directe sur les particules dans la meme cellule ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
in tree_walk_recursive /* set the index of the first particle */ self->P[i].first=no;
Tue Nov 2 21:12:05 CET 2010
struct NODE {
int count[8]; /* number of particles contained by each daughter node*/ int first[8]; /* index of first particle inside the daughter node*/ int last[8]; /* index of last particle inside the daughter node*/ non ! il faut changer int count : nombre de particules dans la cellule ! int first : first de la cellule int last : last de la cellule
}
force_treebuild_single -> reecrire ok
tree_walk_recursive -> reecrire ok tree_walk -> reecrire ok
force_update_node_recursive -> reecrire ok
force_treeevaluate_local_potential -> reecrire ok
commentaires:
pas certain d'etre sur le bon chemin... si on doit redistrubuer les particules --> on cree directement 8 sous nodes ? !!! on n'a beacoups de nodes
FINAL :
- calculer les forces internes
- pour chaque feuille : calculer force_treeevaluate_local_potential
- sommer les contributions
Tree_AllPotential
--> faire mieux..., ajouter les interactions internes...
time python test02.py
1000000 65536 65 0m3.232s 1024 7090 0m7.117s 64 71913 0m6.371s 1 1000000 0m39.188s ! currieux ! a comparer avec test test00.py
time python test00.py 1000000 1 480941 1m0.543s !!!
python test02-direct.py
Tree_AllPotential
--> semble ok pour
ErrTolTheta = 0.7 MaxPartPerNode=1 --> treecode normal = ok
- boucle sur les listes
a) pour une liste, faire une sommation directe interne
force_treeevaluate_local_potential
Mon Nov 8 23:00:49 CET 2010
force_treeevaluate_local_external_potential force_treeevaluate_local_internal_potential
--> nouveaux tests
MaxPartPerNode=1 --> ok
MaxPartPerNode=1 --> ok
Tue Nov 9 22:14:36 CET 2010
python test02-direct.py
- force_treeevaluate_local_potential_npartpernode
(1) bien juger l'effet d'avoir plusieurs particules par noeud
exemple : NumPart=1 MaxPartPerNode=1 ou 4 clairement : MaxPartPerNode=8 --> 20*19 interactions MaxPartPerNode ---> j'ai toujours plus d'interactions... !!!
BON:
- ----> focaliser sur
AllPotential, + faire mieux la partie
---> copier de force_treeevaluate_local_potential_npartpernode force_treeevaluate_local_external_potential
AllPotentialNpart --> corriger ? force_treeevaluate_local_potential_npartpernode_bis
estimation des erreurs :
da = 1/N sum( a_tree - a_exact ) A(da) = 1/N sum( a_tree - a_exact - da) a = 1/N sum( a_exact )
erreur = A(da)/a