15#ifndef TREE_NUM_BEFORE_NODESPLIT
16#define TREE_NUM_BEFORE_NODESPLIT 3
19#define TREE_MODE_BRANCH 0
20#define TREE_MODE_TOPLEVEL 1
22#define MAX_TREE_ALLOC_FACTOR 30.0
24#define TREE_MAX_ITER 100
28#include "../domain/domain.h"
29#include "../mpi_utils/shared_mem_handler.h"
30#include "../sort/peano.h"
31#include "../system/system.h"
89template <
typename node,
typename partset,
typename po
int_data,
typename foreign_po
int_data>
218 node_bit_field oldval = nop->flag_already_fetched.fetch_or(mybit);
220 if((oldval & mybit) == 0)
321 int treebuild(
int ninsert,
int *indexlist);
338 if(no < MaxPart + D->NTopnodes)
352 if(no < MaxPart + D->NTopnodes)
357 nop = &Nodes_shmrank[no];
390 unsigned char level = 0;
391 unsigned char rotation = 0;
393#if defined(PMGRID) && defined(PLACEHIGHRESREGION)
394 Tp->P[i].InsideOutsideFlag =
Tp->check_high_res_point_location(
Tp->P[i].IntPos);
398 while(
D->TopNodes[no].Daughter >= 0)
400 unsigned char pix = (((
unsigned char)((xxb & mask) >> (shiftx--))) | ((
unsigned char)((yyb & mask) >> (shifty--))) |
401 ((
unsigned char)((zzb & mask) >> (shiftz--))));
407 no =
D->TopNodes[no].Daughter + subnode;
410 no =
D->TopNodes[no].Leaf;
411 task =
D->TaskOfLeaf[no];
417 int treebuild_construct(
void);
418 int treebuild_insert_group_of_points(
int num, index_data *index_list,
int th,
unsigned char level,
int sibling);
423 static inline bool compare_index_data_subnode(
const index_data &a,
const index_data &b) {
return a.subnode < b.subnode; }
int * GetGhostRankForSimulCommRank
int TreeSharedMem_ThisTask
void tree_export_node_threads(int no, int i, thread_data *thread, offset_tuple off=0)
void treeallocate_share_topnode_addresses(void)
long long sum_NumForeignPoints
workstack_data * WorkStack
point_data * get_pointsp(int no, unsigned char shmrank)
sph_particle_data * get_SphPp(int n, unsigned char shmrank)
void cleanup_shared_memory_access(void)
foreign_point_data * get_foreignpointsp(int n, unsigned char shmrank)
subfind_data * get_PSp(int n, unsigned char shmrank)
MPI_Comm TreeSharedMemComm
void treeallocate(int max_partindex, partset *Pptr, domain< partset > *Dptr)
unsigned char * NodeLevel
ptrdiff_t * TreeNodes_offsets
pdata get_Pp(int n, unsigned char shmrank)
static bool compare_workstack(const workstack_data &a, const workstack_data &b)
ptrdiff_t * TreePS_offsets
ptrdiff_t * TreeNextnode_offsets
virtual void exchange_topleafdata(void)=0
int * get_nextnodep(unsigned char shmrank)
long long sum_NumForeignNodes
virtual void report_log_message(void)=0
ptrdiff_t * TreeP_offsets
ptrdiff_t * TreePoints_offsets
static bool compare_ghostrank(const fetch_data &a, const fetch_data &b)
virtual void update_node_recursive(int no, int sib, int mode)=0
void tree_fetch_foreign_nodes(enum ftype fetch_type)
void prepare_shared_memory_access(void)
foreign_point_data * Foreign_Points
fetch_data * StackToFetch
virtual void fill_in_export_points(point_data *exp_point, int i, int no)=0
int AllocWorkStackBaseHigh
void ** TreeSharedMemBaseAddr
node * get_nodep(int no, unsigned char shmrank)
void tree_add_to_fetch_stack(node *nop, int nodetoopen, unsigned char shmrank)
int treebuild(int ninsert, int *indexlist)
void tree_add_to_work_stack(int target, int no, unsigned char shmrank, int mintopleafnode)
void tree_initialize_leaf_node_access_info(void)
int AllocWorkStackBaseLow
ptrdiff_t * TreeForeign_Nodes_offsets
void tree_get_node_and_task(int i, int &no, int &task)
ptrdiff_t * TreeForeign_Points_offsets
ptrdiff_t * TreeSphP_offsets
void tree_export_node_threads_by_task_and_node(int task, int nodeindex, int i, thread_data *thread, offset_tuple off=0)
#define BITS_FOR_POSITIONS
unsigned char peano_incremental_key(unsigned char pix, unsigned char *rotation)
unsigned char nextnode_shmrank
std::atomic< unsigned char > cannot_be_opened_locally
std::atomic< node_bit_field > flag_already_fetched
vector< MyIntPosType > center
unsigned char sibling_shmrank