diff --git a/arch/developer-gnu b/arch/developer-gnu index 7d9ef54d6..42fe789e0 100755 --- a/arch/developer-gnu +++ b/arch/developer-gnu @@ -79,6 +79,7 @@ $cmake_mode \ -DENABLE_FLECSIT=ON \ -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} \ -DENABLE_KOKKOS=$kokkos \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ $cinch_dir #------------------------------------------------------------------------------# diff --git a/flecsi/coloring/crs.h b/flecsi/coloring/crs.h index 4931ffc51..8f939eab1 100644 --- a/flecsi/coloring/crs.h +++ b/flecsi/coloring/crs.h @@ -24,10 +24,14 @@ namespace coloring { // Convenience macro to avoid having to reimplement this for each member. //----------------------------------------------------------------------------// +// initialize with an explicit loop to circumvent integral conversion warnings #define define_as(member) \ template \ std::vector member##_as() const { \ - std::vector asvec(member.begin(), member.end()); \ + std::vector asvec; \ + asvec.reserve(member.size()); \ + for(auto v : member) \ + asvec.push_back(static_cast(v)); \ return asvec; \ } @@ -255,10 +259,10 @@ operator<<(std::ostream & stream, const crs_t & crs) { struct dcrs_t : public crs_t { std::vector distribution; - define_as(distribution) + define_as(distribution); - /// \brief clears the current storage - void clear() { + /// \brief clears the current storage + void clear() { crs_t::clear(); distribution.clear(); } diff --git a/flecsi/coloring/dcrs_utils.h b/flecsi/coloring/dcrs_utils.h index 98dc92c52..99f8efb14 100644 --- a/flecsi/coloring/dcrs_utils.h +++ b/flecsi/coloring/dcrs_utils.h @@ -321,8 +321,8 @@ alltoallv(const SEND_TYPE & sendbuf, auto buf = recvbuf.data() + recvdispls[rank]; requests.resize(requests.size() + 1); auto & my_request = requests.back(); - auto ret = - MPI_Irecv(buf, count, mpi_recv_t, rank, tag, comm, &my_request); + auto ret = MPI_Irecv(buf, static_cast(count), mpi_recv_t, + static_cast(rank), tag, comm, &my_request); if(ret != MPI_SUCCESS) return ret; } @@ -335,8 +335,8 @@ alltoallv(const SEND_TYPE & sendbuf, auto buf = sendbuf.data() + senddispls[rank]; requests.resize(requests.size() + 1); auto & my_request = requests.back(); - auto ret = - MPI_Isend(buf, count, mpi_send_t, rank, tag, comm, &my_request); + auto ret = MPI_Isend(buf, static_cast(count), mpi_send_t, + static_cast(rank), tag, comm, &my_request); if(ret != MPI_SUCCESS) return ret; } @@ -344,7 +344,8 @@ alltoallv(const SEND_TYPE & sendbuf, // wait for everything to complete std::vector status(requests.size()); - auto ret = MPI_Waitall(requests.size(), requests.data(), status.data()); + auto ret = MPI_Waitall( + static_cast(requests.size()), requests.data(), status.data()); return ret; } @@ -436,7 +437,7 @@ make_dcrs_distributed( size_t max_global_vert_id{0}; for(auto v : vertex_local_to_global) - max_global_vert_id = std::max(max_global_vert_id, v); + max_global_vert_id = (std::max)(max_global_vert_id, v); // now the global max id size_t tot_verts{0}; @@ -1096,9 +1097,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, std::vector recvcounts(comm_size); auto ret = MPI_Alltoall(sendcounts.data(), 1, mpi_size_t, recvcounts.data(), 1, mpi_size_t, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertex counts"); - + } // how much info will we be receiving std::vector recvdispls(comm_size + 1); recvdispls[0] = 0; @@ -1112,9 +1113,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // now send the actual vertex info ret = alltoallv(sendbuf, sendcounts, senddispls, recvbuf, recvcounts, recvdispls, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertices"); - + } //---------------------------------------------------------------------------- // Unpack results //---------------------------------------------------------------------------- @@ -1149,7 +1150,7 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // first figure out the maximum global id on this rank size_t max_global_ent_id{0}; for(auto v : local2global) - max_global_ent_id = std::max(max_global_ent_id, v); + max_global_ent_id = (std::max)(max_global_ent_id, v); // now the global max id size_t tot_ents{0}; @@ -1217,9 +1218,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // send counts ret = MPI_Alltoall(sendcounts.data(), 1, mpi_size_t, recvcounts.data(), 1, mpi_size_t, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertex counts"); - + } // how much info will we be receiving recvdispls[0] = 0; for(size_t r = 0; r < comm_size; ++r) @@ -1231,8 +1232,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // now send the actual vertex info ret = alltoallv(sendbuf, sendcounts, senddispls, recvbuf, recvcounts, recvdispls, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertices"); + } // upack results for(size_t r = 0; r < comm_size; ++r) { @@ -1293,8 +1295,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // send counts ret = MPI_Alltoall(sendcounts.data(), 1, mpi_size_t, recvcounts.data(), 1, mpi_size_t, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertex counts"); + } // how much info will we be receiving recvdispls[0] = 0; @@ -1307,9 +1310,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // now send the actual vertex info ret = alltoallv(sendbuf, sendcounts, senddispls, recvbuf, recvcounts, recvdispls, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertices"); - + } // upack results for(size_t r = 0; r < comm_size; ++r) { for(size_t i = recvdispls[r]; i < recvdispls[r + 1]; i++) { @@ -1378,9 +1381,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // send counts ret = MPI_Alltoall(sendcounts.data(), 1, mpi_size_t, recvcounts.data(), 1, mpi_size_t, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertex counts"); - + } // how much info will we be receiving recvdispls[0] = 0; for(size_t r = 0; r < comm_size; ++r) @@ -1392,8 +1395,9 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, // now send the actual vertex info ret = alltoallv(sendbuf, sendcounts, senddispls, recvbuf, recvcounts, recvdispls, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertices"); + } // upack results for(size_t r = 0; r < comm_size; ++r) { @@ -1428,7 +1432,7 @@ color_entities(const flecsi::coloring::crs_t & cells2entity, } // shared and ghost - for(const auto pair : entities2rank) { + for(const auto & pair : entities2rank) { auto global_id = pair.first; auto owner = pair.second; // if i am the owner, shared @@ -1484,7 +1488,7 @@ match_ids( size_t max_global_vert_id{0}; for(auto v : vertex_local2global) - max_global_vert_id = std::max(max_global_vert_id, v); + max_global_vert_id = (std::max)(max_global_vert_id, v); // now the global max id size_t tot_verts{0}; @@ -1808,9 +1812,9 @@ ghost_connectivity(const flecsi::coloring::crs_t & from2to, std::vector recvcounts(comm_size); auto ret = MPI_Alltoall(sendcounts.data(), 1, mpi_size_t, recvcounts.data(), 1, mpi_size_t, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertex counts"); - + } // how much info will we be receiving std::vector recvdispls(comm_size + 1); recvdispls[0] = 0; @@ -1821,9 +1825,9 @@ ghost_connectivity(const flecsi::coloring::crs_t & from2to, // now send the actual vertex info ret = alltoallv(sendbuf, sendcounts, senddispls, recvbuf, recvcounts, recvdispls, MPI_COMM_WORLD); - if(ret != MPI_SUCCESS) + if(ret != MPI_SUCCESS) { clog_error("Error communicating vertices"); - + } //---------------------------------------------------------------------------- // Unpack results //---------------------------------------------------------------------------- diff --git a/flecsi/coloring/mpi_communicator.h b/flecsi/coloring/mpi_communicator.h index f4e9afca5..dfdfa9bd1 100644 --- a/flecsi/coloring/mpi_communicator.h +++ b/flecsi/coloring/mpi_communicator.h @@ -613,13 +613,13 @@ class mpi_communicator_t : public communicator_t std::unordered_map coloring_info; for(size_t c(0); c < colors; ++c) { - auto & ci = coloring_info[c]; + auto & ci = coloring_info[c]; ci.exclusive = buffer[c].exclusive; ci.shared = buffer[c].shared; ci.ghost = buffer[c].ghost; } // for -#if 0 +#if 0 alltoall_coloring_info( color_info.shared_users, [&](size_t c, size_t value) { coloring_info[c].shared_users.insert(value); diff --git a/flecsi/coloring/parmetis_colorer.h b/flecsi/coloring/parmetis_colorer.h index f9e23e3f3..92fb98ffd 100644 --- a/flecsi/coloring/parmetis_colorer.h +++ b/flecsi/coloring/parmetis_colorer.h @@ -263,14 +263,14 @@ struct parmetis_colorer_t : public colorer_t { idx_t wgtflag = 0; idx_t numflag = 0; idx_t ncon = 1; - std::vector tpwgts(ncon * size, 1.0 / size); + std::vector tpwgts(ncon * size, static_cast(1.0 / size)); // We may need to expose some of the ParMETIS configuration options. - std::vector ubvec(ncon, 1.05); + std::vector ubvec(ncon, static_cast(1.05)); idx_t options[3] = {0, 0, 0}; idx_t edgecut; MPI_Comm comm = MPI_COMM_WORLD; - std::vector part(dcrs.size(), std::numeric_limits::max()); + std::vector part(dcrs.size(), (std::numeric_limits::max)()); // Get the dCRS information using ParMETIS types. std::vector vtxdist = dcrs.distribution_as(); @@ -281,8 +281,9 @@ struct parmetis_colorer_t : public colorer_t { int result = ParMETIS_V3_PartKway(&vtxdist[0], &xadj[0], &adjncy[0], nullptr, nullptr, &wgtflag, &numflag, &ncon, &size, &tpwgts[0], ubvec.data(), options, &edgecut, &part[0], &comm); - if(result != METIS_OK) + if(result != METIS_OK) { clog_error("Parmetis failed!"); + } std::vector partitioning(part.begin(), part.end()); diff --git a/flecsi/data/common/registration_wrapper.h b/flecsi/data/common/registration_wrapper.h index c37968f12..7f8689a68 100644 --- a/flecsi/data/common/registration_wrapper.h +++ b/flecsi/data/common/registration_wrapper.h @@ -80,11 +80,13 @@ struct field_registration_wrapper_u { // register custom serdez op, if applicable if constexpr(STORAGE_CLASS == ragged) { using serdez_t = serdez_u>; - execution::context_t::instance().register_serdez(fid); + execution::context_t::instance().register_serdez( + static_cast(fid)); } // if else if constexpr(STORAGE_CLASS == sparse) { using serdez_t = serdez_u>>; - execution::context_t::instance().register_serdez(fid); + execution::context_t::instance().register_serdez( + static_cast(fid)); } } // register_callback diff --git a/flecsi/data/common/row_vector.h b/flecsi/data/common/row_vector.h index 2f2c87130..d4ef6e8ff 100644 --- a/flecsi/data/common/row_vector.h +++ b/flecsi/data/common/row_vector.h @@ -92,7 +92,7 @@ struct row_vector_u { } void assign(const_iterator first, const_iterator last) { - resize(last - first); + resize(static_cast(last - first)); std::copy(first, last, datap); } diff --git a/flecsi/data/data_client_handle.h b/flecsi/data/data_client_handle.h index 67db751d4..73763c01f 100644 --- a/flecsi/data/data_client_handle.h +++ b/flecsi/data/data_client_handle.h @@ -50,7 +50,7 @@ struct data_client_handle_base_u : public DATA_CLIENT_TYPE, data_client_handle_base_u(const data_client_handle_base_u & h) - : DATA_POLICY(h), DATA_CLIENT_TYPE(h), type_hash(h.type_hash), + : DATA_CLIENT_TYPE(h), DATA_POLICY(h), type_hash(h.type_hash), name_hash(h.name_hash), namespace_hash(h.namespace_hash) { static_assert( UNMAPPED_PERMISSIONS == 0, "passing mapped client handle to task args"); diff --git a/flecsi/data/ragged_accessor.h b/flecsi/data/ragged_accessor.h index 4bf28cba3..510f2542a 100644 --- a/flecsi/data/ragged_accessor.h +++ b/flecsi/data/ragged_accessor.h @@ -141,7 +141,7 @@ struct accessor_uhandle.rows[index]; assert(ragged_index < row.size() && "ragged accessor: index out of range"); - return row[ragged_index]; + return row[static_cast(ragged_index)]; } // operator () const T & operator()(size_t index, size_t ragged_index) const { diff --git a/flecsi/data/ragged_mutator.h b/flecsi/data/ragged_mutator.h index dae9384ce..fe3587acf 100644 --- a/flecsi/data/ragged_mutator.h +++ b/flecsi/data/ragged_mutator.h @@ -62,13 +62,12 @@ struct mutator_u : public mutator_u, T & operator()(size_t index, size_t ragged_index) { auto & row = this->handle[index]; - return row[ragged_index]; - + return row[static_cast(ragged_index)]; } // operator () void resize(size_t index, size_t size) { auto & row = this->handle[index]; - row.resize(size); + row.resize(static_cast(size)); } // resize void erase(size_t index, size_t ragged_index) { diff --git a/flecsi/execution/CMakeLists.txt b/flecsi/execution/CMakeLists.txt index 389e1360a..4e7a95ab8 100644 --- a/flecsi/execution/CMakeLists.txt +++ b/flecsi/execution/CMakeLists.txt @@ -29,6 +29,7 @@ set(execution_HEADERS global_object_wrapper.h internal_index_space.h kernel.h + reduction.h remap_shared.h task.h ) diff --git a/flecsi/execution/legion/future.h b/flecsi/execution/legion/future.h index 91eb94f59..b5902b2d7 100644 --- a/flecsi/execution/legion/future.h +++ b/flecsi/execution/legion/future.h @@ -256,7 +256,17 @@ struct legion_future_u : public future_base_t { */ RETURN - get(size_t index = 0, bool silence_warnings = false) { + get(size_t index, bool silence_warnings = false) { + return legion_future_.get_result( + Legion::DomainPoint::from_point<1>( + LegionRuntime::Arrays::Point<1>(index)), + silence_warnings); + } // get + + RETURN + get(bool silence_warnings = false) { + auto runtime = Legion::Runtime::get_runtime(); + size_t index = runtime->find_local_MPI_rank(); return legion_future_.get_result( Legion::DomainPoint::from_point<1>( LegionRuntime::Arrays::Point<1>(index)), diff --git a/flecsi/execution/remap_shared.h b/flecsi/execution/remap_shared.h index e5bda7137..8b0fb10fb 100644 --- a/flecsi/execution/remap_shared.h +++ b/flecsi/execution/remap_shared.h @@ -80,8 +80,8 @@ remap_shared_entities() { buf.resize(n); requests.resize(requests.size() + 1); auto & my_request = requests.back(); - auto ret = MPI_Irecv( - buf.data(), n, mpi_size_t, rank, tag, MPI_COMM_WORLD, &my_request); + auto ret = MPI_Irecv(buf.data(), static_cast(n), mpi_size_t, + static_cast(rank), tag, MPI_COMM_WORLD, &my_request); } } @@ -92,13 +92,14 @@ remap_shared_entities() { const auto & buf = comm_pair.second; requests.resize(requests.size() + 1); auto & my_request = requests.back(); - auto ret = MPI_Isend(buf.data(), buf.size(), mpi_size_t, rank, tag, - MPI_COMM_WORLD, &my_request); + auto ret = MPI_Isend(buf.data(), static_cast(buf.size()), mpi_size_t, + static_cast(rank), tag, MPI_COMM_WORLD, &my_request); } // wait for everything to complete std::vector status(requests.size()); - MPI_Waitall(requests.size(), requests.data(), status.data()); + MPI_Waitall( + static_cast(requests.size()), requests.data(), status.data()); // now we can unpack the messages and reconstruct the ghost entities std::set new_ghost; diff --git a/flecsi/execution/test/data_client_handle.cc b/flecsi/execution/test/data_client_handle.cc index 6bfcbfdd7..15ef8cbe7 100644 --- a/flecsi/execution/test/data_client_handle.cc +++ b/flecsi/execution/test/data_client_handle.cc @@ -41,7 +41,7 @@ fill_task(client_handle_t mesh, dense_accessor pressure) { size_t count = 0; for(auto c : mesh.cells()) { - pressure(c) = count++; + pressure(c) = static_cast(count++); } // for } // fill_task @@ -57,7 +57,7 @@ print_task(client_handle_t mesh, CINCH_CAPTURE() << "vertex id: " << v->id() << std::endl; } // for - clog(info) << "presure: " << pressure(c) << std::endl; + clog(info) << "pressure: " << pressure(c) << std::endl; } // for } // print_task diff --git a/flecsi/execution/test/devel_handle.cc b/flecsi/execution/test/devel_handle.cc index 6572dbcb2..a2db4f916 100644 --- a/flecsi/execution/test/devel_handle.cc +++ b/flecsi/execution/test/devel_handle.cc @@ -5,6 +5,7 @@ #include +#include #include #include #include diff --git a/flecsi/execution/test/finite_difference_dense.cc b/flecsi/execution/test/finite_difference_dense.cc index f45cb4fad..0a1c119cb 100644 --- a/flecsi/execution/test/finite_difference_dense.cc +++ b/flecsi/execution/test/finite_difference_dense.cc @@ -106,7 +106,7 @@ flecsi_register_task(init, flecsi::execution, loc, index); void check_results(mesh mesh, field values, size_t global_target) { auto target = flecsi_get_global_object(global_target, global, vec_2d_t); - auto rank = context_t::instance().color(); + size_t rank = context_t::instance().color(); for(auto c : mesh.cells(owned)) { auto v = values(c); @@ -115,7 +115,7 @@ check_results(mesh mesh, field values, size_t global_target) { auto t = (*target)[i][j]; if(std::abs(v - t) > test_tolerance) { - printf("[Rank %lu] at [%lu,%lu] %.15e != %.15e\n", rank, i, j, v, t); + printf("[Rank %zu] at [%zu,%zu] %.15e != %.15e\n", rank, i, j, v, t); throw std::runtime_error("Got wrong result"); } } diff --git a/flecsi/execution/test/finite_difference_sparse.cc b/flecsi/execution/test/finite_difference_sparse.cc index 2b0c43a74..57f49f575 100644 --- a/flecsi/execution/test/finite_difference_sparse.cc +++ b/flecsi/execution/test/finite_difference_sparse.cc @@ -104,7 +104,7 @@ check_results(mesh mesh, size_t field_idx, size_t global_target) { auto target = flecsi_get_global_object(global_target, global, vec_2d_t); - auto rank = context_t::instance().color(); + size_t rank = context_t::instance().color(); for(auto c : mesh.cells(owned)) { auto v = values(c, field_idx); @@ -113,7 +113,7 @@ check_results(mesh mesh, auto t = (*target)[i][j]; if(std::abs(v - t) > test_tolerance) { - printf("[Rank %lu] at [%lu,%lu] %.15e != %.15e\n", rank, i, j, v, t); + printf("[Rank %zu] at [%zu,%zu] %.15e != %.15e\n", rank, i, j, v, t); throw std::runtime_error("Got wrong result"); } } diff --git a/flecsi/execution/test/future_handle.cc b/flecsi/execution/test/future_handle.cc index 27c8ecb00..ac1862400 100644 --- a/flecsi/execution/test/future_handle.cc +++ b/flecsi/execution/test/future_handle.cc @@ -19,7 +19,7 @@ //----------------------------------------------------------------------------// template -using handle_t = +using future_handle_t = flecsi::execution::flecsi_future; template @@ -27,7 +27,7 @@ using index_handle_t = flecsi::execution::flecsi_future; void -future_dump(handle_t x) { +future_dump(future_handle_t x) { double tmp = x.get(); std::cout << " future = " << x.get() << std::endl; } @@ -43,7 +43,7 @@ writer(double a) { flecsi_register_task(writer, , loc, single); void -reader(handle_t x, handle_t y) { +reader(future_handle_t x, future_handle_t y) { ASSERT_EQ(x.get(), static_cast(3.14)); ASSERT_EQ(x.get(), y.get()); } @@ -52,7 +52,8 @@ flecsi_register_task(reader, , loc, single); int index_writer() { - int x = 1 + flecsi::execution::context_t::instance().color(); + int x = + 1 + static_cast(flecsi::execution::context_t::instance().color()); return x; } @@ -60,8 +61,9 @@ flecsi_register_task(index_writer, , loc, index); void index_reader(index_handle_t x) { - int y = 1 + flecsi::execution::context_t::instance().color(); - ASSERT_EQ(x, y); + int y = + 1 + static_cast(flecsi::execution::context_t::instance().color()); + ASSERT_EQ(x.get(), y); } flecsi_register_task(index_reader, , loc, index); diff --git a/flecsi/execution/test/handle_list.cc b/flecsi/execution/test/handle_list.cc index 4d44e81e3..82add4021 100644 --- a/flecsi/execution/test/handle_list.cc +++ b/flecsi/execution/test/handle_list.cc @@ -35,8 +35,8 @@ write_task(data_client_handle_u mesh, auto & context = execution::context_t::instance(); const auto & map = context.index_map(cells); for(auto c : mesh.cells(flecsi::owned)) { - fs[0](c) = map.at(c.id()); - fs[1](c) = 2 * map.at(c.id()); + fs[0](c) = static_cast(map.at(c.id())); + fs[1](c) = static_cast(2 * map.at(c.id())); } } // task1 diff --git a/flecsi/execution/test/handle_tuple.cc b/flecsi/execution/test/handle_tuple.cc index 72ae5eec8..68f856885 100644 --- a/flecsi/execution/test/handle_tuple.cc +++ b/flecsi/execution/test/handle_tuple.cc @@ -33,8 +33,8 @@ write_task(data_client_handle_u mesh, auto & context = execution::context_t::instance(); const auto & map = context.index_map(cells); for(auto c : mesh.cells(flecsi::owned)) { - std::get<0>(fs)(c) = map.at(c.id()); - std::get<1>(fs)(c) = 2 * map.at(c.id()); + std::get<0>(fs)(c) = static_cast(map.at(c.id())); + std::get<1>(fs)(c) = static_cast(2 * map.at(c.id())); } } // task1 diff --git a/flecsi/execution/test/ragged_data.cc b/flecsi/execution/test/ragged_data.cc index 5bc7c3f67..6bbf88993 100644 --- a/flecsi/execution/test/ragged_data.cc +++ b/flecsi/execution/test/ragged_data.cc @@ -37,7 +37,7 @@ init(client_handle_t mesh, ragged_mutator rm) { count = 8; rm.resize(c, count); for(size_t j = 0; j < count; ++j) { - rm(c, j) = rank * 10000 + gid * 100 + j; + rm(c, j) = static_cast(rank * 10000 + gid * 100 + j); } } } // init @@ -64,14 +64,14 @@ mutate(client_handle_t mesh, ragged_mutator rm) { if(gid == 11 || gid == 14) { rm.resize(c, 10); for(size_t j = 3; j < 10; ++j) { - rm(c, j) = rank * 10000 + gid * 100 + 50 + j; + rm(c, j) = static_cast(rank * 10000 + gid * 100 + 50 + j); } rm.erase(c, 1); } else if(gid == 13) { auto n = rank * 10000 + gid * 100 + 66; - rm.push_back(c, n); - rm.insert(c, 1, n + 1); + rm.push_back(c, static_cast(n)); + rm.insert(c, 1, static_cast(n + 1)); } // flip the checkerboard: entries that had 3 entries will now // have 2, and vice-versa @@ -81,7 +81,7 @@ mutate(client_handle_t mesh, ragged_mutator rm) { } else { auto n = rank * 10000 + gid * 100 + 88; - rm.insert(c, 1, n); + rm.insert(c, 1, static_cast(n)); rm(c, 2) = -rm(c, 2) + 80; } } diff --git a/flecsi/execution/test/reduction_interface.cc b/flecsi/execution/test/reduction_interface.cc index 717e80dab..ddca51e34 100644 --- a/flecsi/execution/test/reduction_interface.cc +++ b/flecsi/execution/test/reduction_interface.cc @@ -61,7 +61,7 @@ min_task(mesh m, field v) { double min{1000000.0}; for(auto c : m.cells(owned)) { - min = std::min(v(c), min); + min = (std::min)(v(c), min); } // for return min; @@ -71,7 +71,7 @@ max_task(mesh m, field v) { double max{0.0}; for(auto c : m.cells(owned)) { - max = std::max(v(c), max); + max = (std::max)(v(c), max); } // for return max; diff --git a/flecsi/execution/test/sparse_data.cc b/flecsi/execution/test/sparse_data.cc index 737854d07..325e9cf8c 100644 --- a/flecsi/execution/test/sparse_data.cc +++ b/flecsi/execution/test/sparse_data.cc @@ -37,7 +37,7 @@ init(client_handle_t mesh, sparse_mutator sm) { if(gid >= 11 && gid <= 13) stop = (parity ? 16 : 17); for(size_t j = start; j < stop; j += 2) { - sm(c, j) = rank * 10000 + gid * 100 + j; + sm(c, j) = static_cast(rank * 10000 + gid * 100 + j); } } } // init @@ -64,7 +64,7 @@ mutate(client_handle_t mesh, sparse_mutator sm) { int start = (parity ? 6 : 5); int stop = (parity ? 20 : 21); for(size_t j = start; j < stop; j += 2) { - sm(c, j) = rank * 10000 + gid * 100 + 50 + j; + sm(c, j) = static_cast(rank * 10000 + gid * 100 + 50 + j); } sm.erase(c, start - 4); sm.erase(c, stop - 4); @@ -73,10 +73,10 @@ mutate(client_handle_t mesh, sparse_mutator sm) { sm.erase(c, 9); } else if(parity) { - sm(c, 6) = rank * 10000 + gid * 100 + 66; + sm(c, 6) = static_cast(rank * 10000 + gid * 100 + 66); } else { - sm(c, 3) = rank * 10000 + gid * 100 + 77; + sm(c, 3) = static_cast(rank * 10000 + gid * 100 + 77); } } } // mutate diff --git a/flecsi/execution/test/unordered_ispaces.cc b/flecsi/execution/test/unordered_ispaces.cc index f063791ba..554e23a80 100644 --- a/flecsi/execution/test/unordered_ispaces.cc +++ b/flecsi/execution/test/unordered_ispaces.cc @@ -107,6 +107,9 @@ driver(int argc, char ** argv) { #elif FLECSI_RUNTIME_MODEL == FLECSI_RUNTIME_MODEL_mpi int my_color; MPI_Comm_rank(MPI_COMM_WORLD, &my_color); +#elif FLECSI_RUNTIME_MODEL == FLECSI_RUNTIME_MODEL_hpx + int my_color; + MPI_Comm_rank(MPI_COMM_WORLD, &my_color); #endif clog(trace) << "Rank " << my_color << " in driver" << std::endl; @@ -351,7 +354,7 @@ add_colorings(int dummy) { // Get the set of cells that reference this vertex. auto referencers = flecsi::topology::entity_referencers<2, 0>(sd, i); - size_t min_rank(std::numeric_limits::max()); + size_t min_rank((std::numeric_limits::max)()); std::set shared_vertices; // Iterate the direct referencers to assign vertex ownership. diff --git a/flecsi/io/CMakeLists.txt b/flecsi/io/CMakeLists.txt index 1af9619e7..81b951881 100644 --- a/flecsi/io/CMakeLists.txt +++ b/flecsi/io/CMakeLists.txt @@ -140,21 +140,21 @@ endif() if(FLECSI_RUNTIME_MODEL STREQUAL "legion" AND ENABLE_HDF5) -cinch_add_unit(io_hdf5 - SOURCES - test/legion/io_hdf5.cc - ${DRIVER_INITIALIZATION} - ${RUNTIME_DRIVER} - DEFINES - -DCINCH_OVERRIDE_DEFAULT_INITIALIZATION_DRIVER - POLICY - ${UNIT_POLICY} - LIBRARIES - FleCSI - ${CINCH_RUNTIME_LIBRARIES} - ${HDF5_LIBRARIES} - THREADS 4 -) + cinch_add_unit(io_hdf5 + SOURCES + test/legion/io_hdf5.cc + ${DRIVER_INITIALIZATION} + ${RUNTIME_DRIVER} + DEFINES + -DCINCH_OVERRIDE_DEFAULT_INITIALIZATION_DRIVER + POLICY + ${UNIT_POLICY} + LIBRARIES + FleCSI + ${CINCH_RUNTIME_LIBRARIES} + ${HDF5_LIBRARIES} + THREADS 4 + ) endif() cinch_add_unit(simple_definition diff --git a/flecsi/supplemental/coloring/coloring_functions.h b/flecsi/supplemental/coloring/coloring_functions.h index 726386e82..38c06fff2 100644 --- a/flecsi/supplemental/coloring/coloring_functions.h +++ b/flecsi/supplemental/coloring/coloring_functions.h @@ -81,7 +81,7 @@ color_entity(topology::mesh_definition_u const & md, } // guard #endif - size_t min_rank(std::numeric_limits::max()); + size_t min_rank((std::numeric_limits::max)()); std::set shared_entities; // Iterate the direct referencers to assign entity ownership. @@ -168,9 +168,9 @@ color_entity(topology::mesh_definition_u const & md, { clog_tag_guard(coloring_functions); clog_container_one( - info, - "exclusive entities("<(md, i); - size_t min_rank(std::numeric_limits::max()); + size_t min_rank((std::numeric_limits::max)()); std::set shared_entities; // Iterate the direct referencers to assign entity ownership diff --git a/flecsi/supplemental/coloring/tikz.h b/flecsi/supplemental/coloring/tikz.h index 7d9a56409..bbf16efef 100644 --- a/flecsi/supplemental/coloring/tikz.h +++ b/flecsi/supplemental/coloring/tikz.h @@ -71,7 +71,8 @@ struct tikz_writer_t { const size_t round_robin(c.first % palette.size()); for(size_t id : c.second) { - write_node(tex, id % (N + 1), id / (N + 1), id, round_robin); + write_node(tex, static_cast(id % (N + 1)), + static_cast(id / (N + 1)), id, round_robin); } // for } // for @@ -142,9 +143,9 @@ struct tikz_writer_t { size_t vertex(0); for(size_t j(0); j < M + 1; ++j) { - double yoff(j); + double yoff(static_cast(j)); for(size_t i(0); i < N + 1; ++i) { - double xoff(i); + double xoff(static_cast(i)); auto evertex = exclusive_vertices.find(vertex); auto svertex = shared_vertices.find(vertex); diff --git a/flecsi/supplemental/mesh/test_mesh_2d.h b/flecsi/supplemental/mesh/test_mesh_2d.h index b18548000..ddd256423 100644 --- a/flecsi/supplemental/mesh/test_mesh_2d.h +++ b/flecsi/supplemental/mesh/test_mesh_2d.h @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -265,7 +266,7 @@ do_test_mesh_2d_coloring() { //----------------------------------------------------------------------------// void -initialize_mesh(data_client_handle_u mesh) { +initialize_mesh(data_client_handle_u mesh) { auto & context = execution::context_t::instance(); auto & vertex_map{context.index_map(index_spaces::vertices)}; diff --git a/flecsi/topology/test/pseudo_random.h b/flecsi/topology/test/pseudo_random.h index c2fcd5e51..fb4aed70c 100644 --- a/flecsi/topology/test/pseudo_random.h +++ b/flecsi/topology/test/pseudo_random.h @@ -23,7 +23,7 @@ class pseudo_random //! \brief Generate a new random number with a uniform distribution between //! [0, 1). double uniform() { - return double(rng_()) / rng_.max(); + return double(rng_()) / (rng_.max)(); } //! \brief Generate a new random number with a uniform distribution between diff --git a/flecsi/utils/CMakeLists.txt b/flecsi/utils/CMakeLists.txt index 88427f1e8..d8275cd35 100644 --- a/flecsi/utils/CMakeLists.txt +++ b/flecsi/utils/CMakeLists.txt @@ -135,6 +135,7 @@ cinch_add_unit(factory SOURCES demangle.cc test/factory.cc + ${utils_SOURCES} INPUTS test/factory.blessed ${factory_blessed_input} @@ -192,6 +193,7 @@ cinch_add_unit(test_utility SOURCES demangle.cc test/utility.cc + ${utils_SOURCES} INPUTS test/utility.blessed.gnug ) @@ -206,6 +208,7 @@ cinch_add_unit(tuple_type_converter SOURCES demangle.cc test/tuple_type_converter.cc + ${utils_SOURCES} INPUTS ${tuple_type_converter_blessed_input} ) @@ -226,6 +229,7 @@ cinch_add_unit(array_ref SOURCES demangle.cc test/array_ref.cc + ${utils_SOURCES} INPUTS test/array_ref.blessed ${array_ref_blessed_input} ) @@ -240,6 +244,7 @@ cinch_add_unit(common SOURCES demangle.cc test/common.cc + ${utils_SOURCES} INPUTS test/common.blessed.ppc test/common.blessed ${common_blessed_input} ) @@ -254,6 +259,7 @@ cinch_add_unit(id SOURCES demangle.cc test/id.cc + ${utils_SOURCES} INPUTS test/id.blessed ${id_blessed_input} ) diff --git a/flecsi/utils/annotation.h b/flecsi/utils/annotation.h index f7b9950b2..10dbcd01d 100644 --- a/flecsi/utils/annotation.h +++ b/flecsi/utils/annotation.h @@ -73,11 +73,15 @@ class annotation struct runtime_finish : region { inline static const std::string name{"finish"}; }; + template struct execute_task : region { /// Set code region name for regions inheriting from execute_task with the /// following prefix. - inline static const std::string name{"execute_task->" + T::tag}; + static std::string const & name() { + static const std::string name_{"execute_task->" + T::tag}; + return name_; + } }; struct execute_task_init : execute_task { inline static const std::string tag{"init-handles"}; @@ -139,7 +143,7 @@ class annotation begin(std::string task_name) { #if defined(ENABLE_CALIPER) if constexpr(reg::detail_level <= detail_level) { - std::string atag{reg::name + "->" + task_name}; + std::string atag{reg::name() + "->" + task_name}; reg::outer_context::ann.begin(atag.c_str()); } #endif diff --git a/flecsi/utils/array_ref.h b/flecsi/utils/array_ref.h index 45f6ea4ac..33039a468 100644 --- a/flecsi/utils/array_ref.h +++ b/flecsi/utils/array_ref.h @@ -306,18 +306,20 @@ struct vector_ref { (--e)->~value_type(); } + struct cleanup { + vector_ref & v; + size_type sz0; + bool fail = true; + ~cleanup() { + if(fail) + v.resize(sz0); + } + }; + constexpr void resize(size_type n) { reserve(n); auto sz = size(); - struct cleanup { - vector_ref & v; - size_type sz0; - bool fail = true; - ~cleanup() { - if(fail) - v.resize(sz0); - } - } guard = {*this, sz}; + cleanup guard = {*this, sz}; for(; sz > n; --sz) pop_back(); diff --git a/flecsi/utils/demangle.cc b/flecsi/utils/demangle.cc index 06af963e7..6cca7d171 100644 --- a/flecsi/utils/demangle.cc +++ b/flecsi/utils/demangle.cc @@ -18,6 +18,8 @@ #include #endif +#include + namespace flecsi { namespace utils { diff --git a/flecsi/utils/demangle.h b/flecsi/utils/demangle.h index c68379d4b..5b0549232 100644 --- a/flecsi/utils/demangle.h +++ b/flecsi/utils/demangle.h @@ -13,6 +13,8 @@ */ #pragma once +#include + /*! @file */ namespace flecsi { @@ -26,7 +28,7 @@ namespace utils { @ingroup utils */ -std::string demangle(const char * const name); +FLECSI_EXPORT std::string demangle(const char * const name); /*! Return the demangled name of the type T. diff --git a/flecsi/utils/mpi_type_traits.h b/flecsi/utils/mpi_type_traits.h index 341418126..585b4a907 100644 --- a/flecsi/utils/mpi_type_traits.h +++ b/flecsi/utils/mpi_type_traits.h @@ -121,7 +121,9 @@ struct mpi_typetraits_u { return MPI_CXX_DOUBLE_COMPLEX; else if constexpr(is_same_v>) return MPI_CXX_LONG_DOUBLE_COMPLEX; - else if constexpr(is_same_v) + + // MSVC is confused without the explicit std:: qualification + else if constexpr(is_same_v) return MPI_BYTE; else return make();