|
|
|
@@ -110,6 +110,7 @@ struct Maat_hierarchy
|
|
|
|
int thread_num;
|
|
|
|
int thread_num;
|
|
|
|
struct Maat_garbage_bin* garbage_bin;
|
|
|
|
struct Maat_garbage_bin* garbage_bin;
|
|
|
|
void* logger;
|
|
|
|
void* logger;
|
|
|
|
|
|
|
|
struct bool_expr_match *expr_match_buff;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int compare_literal_id(const void *pa, const void *pb)
|
|
|
|
int compare_literal_id(const void *pa, const void *pb)
|
|
|
|
@@ -296,6 +297,7 @@ struct Maat_hierarchy* Maat_hierarchy_new(int thread_num, void* mesa_handle_logg
|
|
|
|
hier->hash_literal_by_id=NULL;
|
|
|
|
hier->hash_literal_by_id=NULL;
|
|
|
|
hier->hash_region_by_id=NULL;
|
|
|
|
hier->hash_region_by_id=NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hier->expr_match_buff=ALLOC(struct bool_expr_match, thread_num*MAX_SCANNER_HIT_NUM);
|
|
|
|
|
|
|
|
|
|
|
|
ret=igraph_empty(&hier->group_graph, 0, IGRAPH_DIRECTED);
|
|
|
|
ret=igraph_empty(&hier->group_graph, 0, IGRAPH_DIRECTED);
|
|
|
|
assert(ret==IGRAPH_SUCCESS);
|
|
|
|
assert(ret==IGRAPH_SUCCESS);
|
|
|
|
@@ -345,6 +347,8 @@ void Maat_hierarchy_free(struct Maat_hierarchy* hier)
|
|
|
|
bool_matcher_free(hier->bm);
|
|
|
|
bool_matcher_free(hier->bm);
|
|
|
|
hier->bm=NULL;
|
|
|
|
hier->bm=NULL;
|
|
|
|
pthread_rwlock_unlock(&hier->rwlock);
|
|
|
|
pthread_rwlock_unlock(&hier->rwlock);
|
|
|
|
|
|
|
|
free(hier->expr_match_buff);
|
|
|
|
|
|
|
|
hier->expr_match_buff=NULL;
|
|
|
|
free(hier);
|
|
|
|
free(hier);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1338,8 +1342,8 @@ int Maat_hierarchy_region_compile(struct Maat_hierarchy_compile_mid* mid, int is
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int bool_match_ret=0, i=0;
|
|
|
|
int bool_match_ret=0, i=0;
|
|
|
|
struct Maat_hierarchy* hier=mid->ref_hier;
|
|
|
|
struct Maat_hierarchy* hier=mid->ref_hier;
|
|
|
|
struct Maat_hierarchy_compile* compile_array[ud_array_sz];
|
|
|
|
struct Maat_hierarchy_compile* compile_array=NULL;
|
|
|
|
struct bool_expr_match expr_match[ud_array_sz];
|
|
|
|
struct bool_expr_match *expr_match=hier->expr_match_buff+mid->thread_num*MAX_SCANNER_HIT_NUM;
|
|
|
|
|
|
|
|
|
|
|
|
size_t r_in_c_cnt=0, this_scan_region_hits=mid->this_scan_region_hit_cnt;
|
|
|
|
size_t r_in_c_cnt=0, this_scan_region_hits=mid->this_scan_region_hit_cnt;
|
|
|
|
size_t ud_result_cnt=0;
|
|
|
|
size_t ud_result_cnt=0;
|
|
|
|
@@ -1351,22 +1355,22 @@ int Maat_hierarchy_region_compile(struct Maat_hierarchy_compile_mid* mid, int is
|
|
|
|
pthread_rwlock_rdlock(&hier->rwlock);
|
|
|
|
pthread_rwlock_rdlock(&hier->rwlock);
|
|
|
|
bool_match_ret=bool_matcher_match(hier->bm, mid->thread_num,
|
|
|
|
bool_match_ret=bool_matcher_match(hier->bm, mid->thread_num,
|
|
|
|
(unsigned long long*)utarray_eltptr(mid->_all_hit_clause_array, 0), utarray_len(mid->_all_hit_clause_array),
|
|
|
|
(unsigned long long*)utarray_eltptr(mid->_all_hit_clause_array, 0), utarray_len(mid->_all_hit_clause_array),
|
|
|
|
expr_match, ud_array_sz);
|
|
|
|
expr_match, MAX_SCANNER_HIT_NUM);
|
|
|
|
for(i=0; i<bool_match_ret; i++)
|
|
|
|
for(i=0; i<bool_match_ret && ud_result_cnt<ud_array_sz; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
compile_array[i]=(struct Maat_hierarchy_compile*)expr_match[i].user_tag;
|
|
|
|
compile_array=(struct Maat_hierarchy_compile*)expr_match[i].user_tag;
|
|
|
|
assert((unsigned long long)compile_array[i]->compile_id==expr_match[i].expr_id);
|
|
|
|
assert((unsigned long long)compile_array->compile_id==expr_match[i].expr_id);
|
|
|
|
r_in_c_cnt=Maat_hierarchy_compile_mid_update_by_compile(mid, compile_array[i]);
|
|
|
|
r_in_c_cnt=Maat_hierarchy_compile_mid_update_by_compile(mid, compile_array);
|
|
|
|
if(compile_array[i]->not_clause_cnt>0 && !is_last_compile)
|
|
|
|
if(compile_array->not_clause_cnt>0 && !is_last_compile)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mid->not_clause_hitted_flag=1;
|
|
|
|
mid->not_clause_hitted_flag=1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(compile_array[i]->user_data)//For compile may be dettached by Maat_hierarchy_compile_dettach_user_data, only return non-NULL userdata.
|
|
|
|
else if(compile_array->user_data)//For compile may be dettached by Maat_hierarchy_compile_dettach_user_data, only return non-NULL userdata.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(r_in_c_cnt>0 || //compile hitted becasue of new reigon
|
|
|
|
if(r_in_c_cnt>0 || //compile hitted becasue of new reigon
|
|
|
|
this_scan_region_hits==0) //or hit a compile that refer a NOT-logic group in previous scan.
|
|
|
|
this_scan_region_hits==0) //or hit a compile that refer a NOT-logic group in previous scan.
|
|
|
|
{
|
|
|
|
{
|
|
|
|
user_data_array[ud_result_cnt]=compile_array[i]->user_data;
|
|
|
|
user_data_array[ud_result_cnt]=compile_array->user_data;
|
|
|
|
ud_result_cnt++;
|
|
|
|
ud_result_cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|