Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.4 warnings pass (part 1) #1006

Merged
merged 8 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ stages:
make VERBOSE=1
mpiexec -n 1 ./conduit_mpi_example
displayName: 'Test vs Install (using-with-cmake-mpi)'
condition: and(succeeded(),eq(variables['ENABLE_MPI'], 'ON'))
condition: and(succeeded(),eq(variables['ENABLE_MPI'], 'ON'))

- script: |
################################
Expand Down
3 changes: 1 addition & 2 deletions src/libs/blueprint/conduit_blueprint_mesh_examples_julia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,6 @@ void julia_nestsets_complex(index_t nx,
int32 min_size = 4; // min num zones for refine
float64 efficiency = .80; // target boxs count(flags)/size > effeciency

int32 curr_domain = 0;
int32 domain_count = 1;
int32 children = 1;

Expand All @@ -741,7 +740,7 @@ void julia_nestsets_complex(index_t nx,
domain_count += count;
level_count += count;
}
curr_domain += level_count;

children = level_count;
// for each level refinement threshold and min size
threshold += 20;
Expand Down
54 changes: 35 additions & 19 deletions src/libs/blueprint/conduit_blueprint_mesh_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,8 @@ Partitioner::get_prelb_adjset_maps(const std::vector<int>& chunk_offsets,
// index
if (domain_map.size() > 0)
{
if (adjset_chunk_maps.size() < domain_map.rbegin()->first + 1)
if ( static_cast<index_t>(adjset_chunk_maps.size()) <
static_cast<index_t>(domain_map.rbegin()->first + 1))
{
adjset_chunk_maps.resize(domain_map.rbegin()->first + 1);
}
Expand Down Expand Up @@ -4626,6 +4627,21 @@ Partitioner::communicate_chunks(const std::vector<Partitioner::Chunk> &chunks,
}
}

//-------------------------------------------------------------------------
void
Partitioner::communicate_mapback(std::unordered_map<index_t, Node>& /*packed_fields*/)
{
// implemented only in parallel case
}

//-------------------------------------------------------------------------
void Partitioner::synchronize_gvids(const std::vector<std::vector<index_t>>& /*remap_to_local_doms*/,
std::map<index_t, std::vector<index_t>>& /*orig_dom_gvids*/)
{
// implemented only in parallel case
}


//-----------------------------------------------------------------------------
// -- begin conduit::blueprint::mesh::coordset --
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -5676,9 +5692,9 @@ point_merge::append_data(const std::vector<Node> &coordsets,
const auto append = [&](float64 *p, index_t)
{
old_to_new_ids[i].push_back(newid);
for(auto i = 0; i < dimension; i++)
for(auto j = 0; j < dimension; j++)
{
new_coords.push_back(p[i]);
new_coords.push_back(p[j]);
}
newid++;
};
Expand Down Expand Up @@ -6483,17 +6499,17 @@ build_polyhedral_output(const std::vector<const Node*> &topologies,
const index_t offset = out_conn.size();
out_offsets.push_back(offset);
out_sizes.push_back(sz);
for(index_t i = 0; i < sz; i++)
for(index_t ii = 0; ii < sz; ii++)
{
const index_t subidx = out_subsizes.size();
const index_t subsz = e.subelement_ids[i].size();
const index_t subsz = e.subelement_ids[ii].size();
const index_t suboffset = out_subconn.size();
out_conn.push_back(subidx);
out_suboffsets.push_back(suboffset);
out_subsizes.push_back(subsz);
for(index_t j = 0; j < subsz; j++)
{
out_subconn.push_back(pmap_da[e.subelement_ids[i][j]]);
out_subconn.push_back(pmap_da[e.subelement_ids[ii][j]]);
}
}
}
Expand Down Expand Up @@ -6691,11 +6707,11 @@ class combine_implicit_topologies
n_new_topo["coordset"] = n_cset.name();

const index_t dim = utils::topology::dims(n_topo);
std::array<index_t, MAXDIM> logical_dims;
utils::topology::logical_dims(n_topo, logical_dims.data(), dim);
std::array<index_t, MAXDIM> logical_dims_vals;
utils::topology::logical_dims(n_topo, logical_dims_vals.data(), dim);
for(index_t ldi = 0; ldi < dim; ldi++)
{
n_new_topo["elements/dims/"+utils::LOGICAL_AXES[ldi]] = logical_dims[ldi];
n_new_topo["elements/dims/"+utils::LOGICAL_AXES[ldi]] = logical_dims_vals[ldi];
}

if(n_topo.has_path("elements/origin"))
Expand Down Expand Up @@ -9624,19 +9640,19 @@ Partitioner::combine(int domain,
auto itr = fields.children();
while(itr.has_next())
{
const Node &n = itr.next();
auto itr = std::find_if(field_groups.begin(), field_groups.end(), [&](const field_group_t &g) {
return g.first == n.name();
const Node &n_child = itr.next();
auto field_groups_itr_pos = std::find_if(field_groups.begin(), field_groups.end(), [&](const field_group_t &g) {
return g.first == n_child.name();
});
if(itr != field_groups.end())
if(field_groups_itr_pos != field_groups.end())
{
itr->second.push_back(&n);
field_groups_itr_pos->second.push_back(&n_child);
}
else
{
field_groups.emplace_back();
field_groups.back().first = n.name();
field_groups.back().second.push_back(&n);
field_groups.back().first = n_child.name();
field_groups.back().second.push_back(&n_child);
}
}
}
Expand Down Expand Up @@ -9944,7 +9960,7 @@ Partitioner::map_back_fields(const conduit::Node& repart_mesh,
// communicate domain gvids to ranks that need them
synchronize_gvids(map_tgt_domains, orig_dom_gvids);

for (index_t repart_idx = 0; repart_idx < repart_doms.size(); repart_idx++)
for (index_t repart_idx = 0; repart_idx < static_cast<index_t>(repart_doms.size()); repart_idx++)
{
const conduit::Node& dom = *repart_doms[repart_idx];

Expand Down Expand Up @@ -10038,7 +10054,7 @@ Partitioner::map_back_fields(const conduit::Node& repart_mesh,
// domain homes
communicate_mapback(packed_fields);

bool first_warn = true;
// bool first_warn = true; // unused
for (const auto& orig_dom : packed_fields)
{
// Precompute final element count
Expand Down Expand Up @@ -10103,7 +10119,7 @@ Partitioner::map_back_fields(const conduit::Node& repart_mesh,
fields::map_element_field(src_fields, elem_map_arr, output["values"]);
}
}
first_warn = false;
// first_warn = false; // unused
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/libs/blueprint/conduit_blueprint_mesh_partition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ class CONDUIT_BLUEPRINT_API Partitioner
@note Reimplemented in parallel
@note This method is not dependent on Partitioner::initialize()
*/
virtual void communicate_mapback(std::unordered_map<index_t, Node>& packed_fields) {}
virtual void communicate_mapback(std::unordered_map<index_t, Node>& packed_fields);

/**
@brief During the field back-map, communicates global vertex id information
Expand All @@ -736,7 +736,7 @@ class CONDUIT_BLUEPRINT_API Partitioner
*/
virtual void synchronize_gvids(
const std::vector<std::vector<index_t>>& remap_to_local_doms,
std::map<index_t, std::vector<index_t>>& orig_dom_gvids) {}
std::map<index_t, std::vector<index_t>>& orig_dom_gvids);

int rank, size;
unsigned int target;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/blueprint/conduit_blueprint_mesh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ topology::reindex_coords(const Node& topo,
index_t_accessor old_vids = out_topo[node_path].as_index_t_accessor();
index_t_accessor old_to_gvids = old_gvids["values"].as_index_t_accessor();
std::vector<index_t> new_vids(old_vids.number_of_elements());
for (index_t idx = 0; idx < new_vids.size(); idx++)
for (index_t idx = 0; idx < static_cast<index_t>(new_vids.size()); idx++)
{
index_t old_vid = old_vids[idx];
index_t gvid = old_to_gvids[old_vid];
Expand Down
20 changes: 13 additions & 7 deletions src/libs/blueprint/conduit_blueprint_mpi_mesh_parmetis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void generate_global_element_and_vertex_ids(conduit::Node &mesh,
}

uint64_accessor group_verts = group["values"].as_uint64_accessor();
if (min_domain == global_domid)
if (static_cast<int64>(min_domain) == global_domid)
{
// This domain provides the actual vids
std::vector<uint64> actual_vids(group_verts.number_of_elements());
Expand All @@ -423,13 +423,13 @@ void generate_global_element_and_vertex_ids(conduit::Node &mesh,
// our global vids to those ranks.
for (uint64 nbr_dom : sorted_nbrs)
{
if (nbr_dom == global_domid)
if (static_cast<int64>(nbr_dom) == global_domid)
{
// skip source domain
continue;
}
const uint64 dst_rank = dom_locs[nbr_dom];
if (par_rank != dst_rank)
if (static_cast<uint64>(par_rank) != dst_rank)
{
pending_sends[dst_rank].push_back(sorted_nbrs);
}
Expand All @@ -441,7 +441,7 @@ void generate_global_element_and_vertex_ids(conduit::Node &mesh,
// on this rank. Prepare irecv if necessary.
const uint64 src_rank = dom_locs[min_domain];

if (par_rank != src_rank)
if (static_cast<uint64>(par_rank) != src_rank)
{
pending_recvs[src_rank].push_back(sorted_nbrs);
groups_2_vids[sorted_nbrs].resize(group_verts.number_of_elements());
Expand Down Expand Up @@ -519,16 +519,16 @@ void generate_global_element_and_vertex_ids(conduit::Node &mesh,
}

uint64_accessor group_verts = group["values"].as_uint64_accessor();
if (min_domain != global_domid)
if ( static_cast<int64>(min_domain) != global_domid)
{
// Remap higher-numbered domains with primary domain's
// assigned global vtx ids
const std::vector<uint64>& actual_vids = groups_2_vids[sorted_nbrs];
if (actual_vids.size() != group_verts.number_of_elements())
if (static_cast<index_t>(actual_vids.size()) != group_verts.number_of_elements())
{
CONDUIT_ERROR("mismatch in shared verts");
}
for (index_t ivert = 0; ivert < actual_vids.size(); ivert++)
for (index_t ivert = 0; ivert < static_cast<index_t>(actual_vids.size()); ivert++)
{
vert_ids_vals[group_verts[ivert]] = actual_vids[ivert];
}
Expand Down Expand Up @@ -789,6 +789,12 @@ void generate_partition_field(conduit::Node &mesh,
part_vals,
&comm);

if( parmetis_res == METIS_ERROR )
{
// TODO: Should this be a full Error?
CONDUIT_INFO("ParMETIS_V3_PartMeshKway call failed!");
}

index_t part_vals_idx=0;
// create output field with part result
for(size_t local_dom_idx=0; local_dom_idx < domains.size(); local_dom_idx++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ParallelPartitioner::get_global_domids(const conduit::Node& n_mesh)
MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
ndoms_all.data(), 1, MPI_INT64_T, comm);
index_t offset = 0;
for (size_t irnk = 0; irnk < rank; irnk++)
for (index_t irnk = 0; irnk < rank; irnk++)
{
offset += ndoms_all[irnk];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CONDUIT_BLUEPRINT_API ParallelPartitioner
virtual void get_prelb_adjset_maps(const std::vector<int>& chunk_offsets,
const DomainToChunkMap& chunks,
const std::map<index_t, const Node*>& domain_map,
std::vector<Node>& adjset_chunk_maps);
std::vector<Node>& adjset_chunk_maps) override;

virtual void communicate_mapback(std::unordered_map<index_t, Node>& packed_fields) override;

Expand Down
8 changes: 4 additions & 4 deletions src/libs/conduit/conduit_data_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1758,9 +1758,9 @@ DataArray<T>::to_summary_string_stream(std::ostream &os,
else
{
// if above threshold only show threshold # of values
int half = threshold / 2;
int bottom = half;
int top = half;
index_t half = threshold / 2;
index_t bottom = half;
index_t top = half;

//
// if odd, show 1/2 +1 first
Expand All @@ -1775,7 +1775,7 @@ DataArray<T>::to_summary_string_stream(std::ostream &os,
os << "[";

bool done = (nele == 0);
int idx = 0;
index_t idx = 0;

while(!done)
{
Expand Down
28 changes: 14 additions & 14 deletions src/libs/conduit/conduit_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12688,8 +12688,8 @@ Node::to_summary_string_stream(std::ostream &os,
if(dtype().id() == DataType::OBJECT_ID)
{
os << eoe;
int nchildren = m_children.size();
int threshold = num_children_threshold;
index_t nchildren = static_cast<index_t>(m_children.size());
index_t threshold = num_children_threshold;

// if we are neg or zero, show all children
if(threshold <=0)
Expand All @@ -12698,10 +12698,10 @@ Node::to_summary_string_stream(std::ostream &os,
}

// if above threshold only show threshold # of values
int half = threshold / 2;
int bottom = half;
int top = half;
int num_skipped = m_children.size() - threshold;
index_t half = threshold / 2;
index_t bottom = half;
index_t top = half;
index_t num_skipped = static_cast<index_t>(m_children.size() - threshold);

//
// if odd, show 1/2 +1 first
Expand All @@ -12713,7 +12713,7 @@ Node::to_summary_string_stream(std::ostream &os,
}

bool done = (nchildren == 0);
int idx = 0;
index_t idx = 0;

while(!done)
{
Expand Down Expand Up @@ -12759,8 +12759,8 @@ Node::to_summary_string_stream(std::ostream &os,
else if(dtype().id() == DataType::LIST_ID)
{
os << eoe;
int nchildren = m_children.size();
int threshold = num_children_threshold;
index_t nchildren = static_cast<index_t>(m_children.size());
index_t threshold = num_children_threshold;

// if we are neg or zero, show all children
if(threshold <=0)
Expand All @@ -12769,10 +12769,10 @@ Node::to_summary_string_stream(std::ostream &os,
}

// if above threshold only show threshold # of values
int half = threshold / 2;
int bottom = half;
int top = half;
int num_skipped = m_children.size() - threshold;
index_t half = threshold / 2;
index_t bottom = half;
index_t top = half;
index_t num_skipped = static_cast<index_t>(m_children.size() - threshold);

//
// if odd, show 1/2 +1 first
Expand All @@ -12784,7 +12784,7 @@ Node::to_summary_string_stream(std::ostream &os,
}

bool done = (nchildren == 0);
int idx = 0;
index_t idx = 0;

while(!done)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libs/conduit/conduit_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ list_directory_contents(const std::string &path,
{
// Add the drives to the list.
char buf[200];
DWORD bufLen = 200;
// DWORD bufLen = 200; unused
DWORD slen = GetLogicalDriveStrings(200, buf);

if(slen > 0)
Expand Down
8 changes: 4 additions & 4 deletions src/libs/conduit/python/conduit_utils_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ PyConduit_Utils_format(PyObject *, //self
// args case
if(py_args != NULL)
{
Node &args = *PyConduit_Node_Get_Node_Ptr(py_args);
Node &args_node = *PyConduit_Node_Get_Node_Ptr(py_args);
res = conduit::utils::format(std::string(pattern),
args);
args_node);
}
else // maps case
{
Node &maps = *PyConduit_Node_Get_Node_Ptr(py_maps);
Node &maps_node = *PyConduit_Node_Get_Node_Ptr(py_maps);
res = conduit::utils::format(std::string(pattern),
maps,
maps_node,
(index_t)map_index);
}
}
Expand Down
Loading