src/h5core/h5t_*

- cleanup
This commit is contained in:
2015-09-11 14:12:01 +02:00
parent cc719d116c
commit 3d8ce28609
2 changed files with 48 additions and 93 deletions
+18 -81
View File
@@ -1182,39 +1182,7 @@ read_elems (
H5S_SELECT_SET,
&hstart, &hstride, &hcount,
NULL));
#if 0
// TODO DELETE from here
h5_glb_elem_t* glb_elems2 = glb_elems;
#if NDEBUG == 0
sleep (m->f->myproc*2);
for (int i = 0; i < num_glb_elems;i++) {
h5_debug ("\n"
"GLB ELEM\n idx: %d \n"
" parent_idx: %d \n"
" child_idx: %d \n"
" level_idx: %d \n"
" refinement: %d \n"
" flags: %d \n"
" indices: %d %d %d\n"
" neigh_indi: %d %d %d\n\n",
(int)glb_elems2[i].idx,
(int)glb_elems2[i].parent_idx,
(int)glb_elems2[i].child_idx,
(int)glb_elems2[i].level_idx,
(int)glb_elems2[i].refinement,
(int)glb_elems2[i].flags,
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[0],
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[1],
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[2],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[0],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[1],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[2]);
}
#endif
#endif
// TODO END
#ifdef PARALLEL_IO
TRY (h5priv_start_throttle (m->f));
#endif
@@ -1230,39 +1198,6 @@ for (int i = 0; i < num_glb_elems;i++) {
TRY (h5priv_end_throttle (m->f));
#endif
// TODO DELETE from here
#if 0
#if NDEBUG == 0
sleep (m->f->myproc*2);
for (int i = 0; i < num_glb_elems;i++) {
h5_debug ("\n"
"GLB ELEM\n idx: %d \n"
" parent_idx: %d \n"
" child_idx: %d \n"
" level_idx: %d \n"
" refinement: %d \n"
" flags: %d \n"
" indices: %d %d %d\n"
" neigh_indi: %d %d %d\n\n",
(int)glb_elems2[i].idx,
(int)glb_elems2[i].parent_idx,
(int)glb_elems2[i].child_idx,
(int)glb_elems2[i].level_idx,
(int)glb_elems2[i].refinement,
(int)glb_elems2[i].flags,
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[0],
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[1],
(int)((h5_glb_tri_t*)glb_elems2)[i].vertex_indices[2],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[0],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[1],
(int)((h5_glb_tri_t*)glb_elems2)[i].neighbor_indices[2]);
}
#endif
#endif
// TODO END
TRY (hdf5_close_dataspace (dspace_id));
TRY (hdf5_close_dataspace (mspace_id));
TRY (hdf5_close_dataset (dset_id));
@@ -1734,7 +1669,8 @@ h5tpriv_read_mesh (
m->num_loaded_levels = 1;
TRY (h5tpriv_init_loc_elems_struct (m, glb_elems, 0, num_interior_elems, 0));
TRY (h5tpriv_init_loc_elems_struct (m, ghost_elems, num_interior_elems, num_ghost_elems, H5_GHOST_ENTITY));
TRY (h5tpriv_init_loc_elems_struct (
m, ghost_elems, num_interior_elems, num_ghost_elems, H5_GHOST_ENTITY));
TRY (h5_free (glb_elems));
TRY (h5_free (ghost_elems));
@@ -1778,7 +1714,7 @@ h5tpriv_read_mesh (
H5_PRIV_API_RETURN (H5_SUCCESS);
}
#endif
#ifdef PARALLEL_IO
#ifdef WITH_PARALLEL_H5FED
static h5_err_t
read_octree (
h5t_mesh_t* m
@@ -1873,7 +1809,8 @@ read_weights (
"__num_weights__",
H5_INT32_T,
&m->num_weights));
TRY (m->weights = h5_calloc (m->num_weights * m->num_glb_elems[m->num_leaf_levels-1], sizeof (*m->weights)));
TRY (m->weights =
h5_calloc (m->num_weights * m->num_glb_elems[m->num_leaf_levels-1], sizeof (*m->weights)));
if (m->num_weights < 1) {
m->weights = NULL;
}
@@ -1891,7 +1828,10 @@ read_weights (
// check that weights are > 0
for (h5_glb_idx_t i = 0; i < m->num_weights * m->num_glb_elems[m->num_leaf_levels-1]; i++) {
if (m->weights[i] < 1) {
h5_debug ("Warning: weight %d from elem %lld was %d ", (int) i%m->num_weights, (long long int) i/m->num_weights, m->weights[i]);
h5_debug ("Warning: weight %d from elem %lld was %d ",
(int) i%m->num_weights,
(long long int) i/m->num_weights,
m->weights[i]);
m->weights[i] = 1;
}
@@ -1926,14 +1866,16 @@ read_chunks (
H5_INT16_T,
&m->chunks->num_levels));
TRY (m->chunks->num_chunks_p_level = h5_calloc (m->chunks->num_levels, sizeof (*m->chunks->num_chunks_p_level)));
TRY (m->chunks->num_chunks_p_level =
h5_calloc (m->chunks->num_levels, sizeof (*m->chunks->num_chunks_p_level)));
TRY (h5priv_read_attrib (
m->mesh_gid,
"__num_chk_p_level__",
H5_INT32_T,
m->chunks->num_chunks_p_level));
TRY (m->chunks->chunks = h5_calloc (m->chunks->num_alloc, sizeof (*m->chunks->chunks)));
TRY (m->chunks->chunks =
h5_calloc (m->chunks->num_alloc, sizeof (*m->chunks->chunks)));
TRY (h5priv_start_throttle (m->f));
@@ -1955,9 +1897,10 @@ read_chunks (
}
/*
* get weights of octant (i.e. of all elements that belong to a chunk that belongs to the octant or its parents)
* for parent octants a factor is used. therefore the weight of an octant is divided equally onto it's children
*/
get weights of octant (i.e. of all elements that belong to a chunk that
belongs to the octant or its parents) for parent octants a factor is used.
therefore the weight of an octant is divided equally onto it's children
*/
static h5_err_t
get_weights_of_octant (
@@ -2737,7 +2680,7 @@ h5tpriv_read_chunked_mesh (
h5t_mesh_t* const m
) {
H5_PRIV_API_ENTER (h5_err_t, "m=%p", m);
#ifdef PARALLEL_IO
#ifdef WITH_PARALLEL_H5FED
TRY (read_octree (m));
TRY (h5priv_mpi_barrier (m->f->props->comm));
@@ -2752,12 +2695,6 @@ h5tpriv_read_chunked_mesh (
}
TRY (h5priv_mpi_barrier (m->f->props->comm));
m->timing.measure[m->timing.next_time++] = MPI_Wtime();
// if (m->f->myproc == 0) {
// plot_leaf_octants(m->octree);
// sleep (30);
// } else {
// sleep (30);
// }
h5_oct_idx_t* new_numbering = NULL;
idx_t* weights = NULL;
h5_oct_idx_t num_tot_leaf_oct = -1;
+30 -12
View File
@@ -24,8 +24,12 @@
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
int max_num_elems_p_chunk = 120; // minimum is 4 for triangle meshes and
// 8 for thetrahedral meshes
/*
maximum elements per chunk.
minimum is 4 for triangle meshes
and 8 for thetrahedral meshes
*/
int max_num_elems_p_chunk = 120;
#ifdef PARALLEL_IO
// that probably doesn't belong here... //TODO put in right place + print variables
@@ -1097,6 +1101,7 @@ h5t_end_store_ckd_elems (
// /* mesh specific finalize */
// TRY (m->methods->store->end_store_elems (m));
}
#endif
#endif
H5_CORE_API_RETURN (H5_SUCCESS);
}
@@ -1217,7 +1222,9 @@ h5t_pre_refine_chk (
) {
H5_CORE_API_ENTER (h5_err_t, "m=%p", m);
// exchange list of marked entities
TRY (*point_list = h5_calloc (m->num_glb_leaf_elems[m->leaf_level-1], sizeof (**point_list))); // alloc for maximal num elems to refine
TRY (*point_list = h5_calloc (
// alloc for maximal num elems to refine
m->num_glb_leaf_elems[m->leaf_level-1], sizeof (**point_list)));
TRY (h5priv_exchange_loc_list_to_glb (m, glb_list));
h5_glb_idxlist_t* glb_marked_entities = *glb_list;
@@ -1225,12 +1232,15 @@ h5t_pre_refine_chk (
// decide which elements this proc has to refine
TRY (h5tpriv_mark_chk_elems_to_refine (m, glb_marked_entities, *point_list));
//TODO maybe check that sum of m->marked_entities->num_items over all proc is equal to glb_marked_entities->num_items
// this would find out if there is a problem with loading neighboring chunks...
H5_CORE_API_RETURN (m->methods->store->pre_refine (m));
/*
TODO maybe check that sum of m->marked_entities->num_items over
all proc is equal to glb_marked_entities->num_items this would
find out if there is a problem with loading neighboring chunks...
*/
H5_CORE_API_RETURN (m->methods->store->pre_refine (m));
}
#endif
/*
Refine previously marked elements.
*/
@@ -1259,7 +1269,9 @@ h5tpriv_get_ranges (
h5_glb_idx_t mycount,
h5_glb_idx_t glb_start
) {
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p, range=%p, mycount=%lld, glb_start=%lld", m, range, (long long int) mycount, (long long int) glb_start);
H5_PRIV_FUNC_ENTER (h5_err_t,
"m=%p, range=%p, mycount=%lld, glb_start=%lld",
m, range, (long long int) mycount, (long long int) glb_start);
TRY (h5priv_mpi_allgather (
&mycount,
@@ -1318,8 +1330,8 @@ check_edge (
h5_glb_idxlist_t* glb_elems
) {
H5_PRIV_FUNC_ENTER (h5_loc_idx_t,
"m=%p, face_idx=%lld, elem_idx=%lld, glb_elems=%p",
m, (long long)face_idx, (long long)elem_idx, glb_elems);
"m=%p, face_idx=%lld, elem_idx=%lld, glb_elems=%p",
m, (long long)face_idx, (long long)elem_idx, glb_elems);
h5_loc_idlist_t* retval;
// get all elements sharing the given edge
TRY (h5tpriv_find_te2 (m, face_idx, elem_idx, &retval));
@@ -1412,7 +1424,12 @@ h5tpriv_find_boundary_edges ( // todo maybe put some part into another function.
// get all elements sharing the given edge
TRY (h5tpriv_find_te2 (m, j, elem_idx, &retval));
// check if it is a border edge //TODO does not work yet since flags are not set properly but as long as we have all surounding elems it's not a problem -> i.e. tetrahedrals
/*
check if it is a border edge
TODO does not work yet since flags are not set
properly but as long as we have all surounding
elems it's not a problem -> i.e. tetrahedrals
*/
if (retval->flags == H5_BORDER_ENTITY && 0) {
// add to edgelist
h5_glb_idx_t vertices[2];
@@ -1430,7 +1447,8 @@ h5tpriv_find_boundary_edges ( // todo maybe put some part into another function.
h5_loc_idx_t loc_new_vtx = get_new_vtx_of_edge(m, retval->items[l]);
assert (loc_new_vtx > -1);
TRY (h5tpriv_add_edge_list (list ,vertices[0], vertices[1], loc_new_vtx, m->f->myproc));
TRY (h5tpriv_add_edge_list (
list ,vertices[0], vertices[1], loc_new_vtx, m->f->myproc));
continue;
}
// check if one of the neighbors (locally available) was refined on a different proc