From 7ff8c51dba2b324efdc3a9f9809aa78f9f6b06a4 Mon Sep 17 00:00:00 2001 From: ywwu928 <44017355+ywwu928@users.noreply.github.com> Date: Mon, 13 May 2024 21:01:48 -0500 Subject: [PATCH] change node index from int16_t to int64_t (#94) --- .../containers/dist_array.hpp | 6 ++-- .../containers/host_indexed_map.hpp | 6 ++-- .../containers/host_local_storage.hpp | 10 +++---- .../containers/per_thread.hpp | 4 +-- .../graphs/dist_array_csr.hpp | 4 +-- .../graphs/dist_local_csr.hpp | 18 +++++------ .../graphs/mirror_dist_local_csr.hpp | 18 +++++------ .../import/ingest_rmat_el.hpp | 4 +-- .../import/ingest_wmd_csv.hpp | 2 +- include/pando-lib-galois/loops/do_all.hpp | 8 ++--- include/pando-lib-galois/utility/locality.hpp | 2 +- .../bfs/include/pando-bfs-galois/sssp.hpp | 2 +- pando-rt/examples/gups.cpp | 2 +- pando-rt/examples/helloworld.cpp | 2 +- .../multi_pxns/allcores_reduce_values.cpp | 22 +++++++------- .../allcores_reducebroadcast_values.cpp | 28 ++++++++--------- .../onecore_perpxn_reduce_values.cpp | 22 +++++++------- .../onecore_perpxn_reducebroadcast_values.cpp | 30 +++++++++---------- .../onecore_scatter_diffdim_arrays_values.cpp | 16 +++++----- .../onecore_scatter_samedim_arrays_values.cpp | 16 +++++----- pando-rt/src/drv_info.cpp | 10 +++---- pando-rt/src/drvx/cp.cpp | 2 +- src/edge_exchange.cpp | 24 +++++++-------- test/containers/test_dist_array.cpp | 30 +++++++++---------- test/containers/test_host_cached_array.cpp | 2 +- test/containers/test_host_indexed_map.cpp | 6 ++-- test/containers/test_host_local_storage.cpp | 6 ++-- test/containers/test_per_thread.cpp | 2 +- test/import/test_cusp_importer.cpp | 8 ++--- test/import/test_edge_exchange.cpp | 22 +++++++------- test/loops/test_do_all.cpp | 2 +- test/python/test_MDLCSR_Broadcast.cpp | 6 ++-- test/python/test_MDLCSR_MapExchange.cpp | 4 +-- test/python/test_MDLCSR_Reduce.cpp | 4 +-- test/python/test_MDLCSR_Sync.cpp | 6 ++-- test/sync/test_global_barrier.cpp | 10 +++---- test/sync/test_wait_group.cpp | 4 +-- test/utility/test_dist_accumulator.cpp | 4 +-- 38 files changed, 187 insertions(+), 187 deletions(-) diff --git a/include/pando-lib-galois/containers/dist_array.hpp b/include/pando-lib-galois/containers/dist_array.hpp index ed6d9758..cd058661 100644 --- a/include/pando-lib-galois/containers/dist_array.hpp +++ b/include/pando-lib-galois/containers/dist_array.hpp @@ -153,7 +153,7 @@ class DistArray { pando::Status err = hostsPlaces.initialize(pando::getPlaceDims().node.id); PANDO_CHECK_RETURN(err); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { hostsPlaces[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -321,7 +321,7 @@ class DistArray { * @brief A beginning local iterator for a specified node `n` that * points to the first local item of this distributed array. */ - pando::GlobalPtr localBegin(std::int16_t n) noexcept { + pando::GlobalPtr localBegin(std::int64_t n) noexcept { pando::Array arr = m_data[n]; return pando::GlobalPtr(arr.begin()); } @@ -330,7 +330,7 @@ class DistArray { * @brief A ending local iterator for a specified node `n` that * points to (the last local item of this distributed array + 1). */ - pando::GlobalPtr localEnd(std::int16_t n) noexcept { + pando::GlobalPtr localEnd(std::int64_t n) noexcept { pando::Array arr = m_data[n]; return pando::GlobalPtr(arr.end()); } diff --git a/include/pando-lib-galois/containers/host_indexed_map.hpp b/include/pando-lib-galois/containers/host_indexed_map.hpp index 4fb7d63e..c3c37e74 100644 --- a/include/pando-lib-galois/containers/host_indexed_map.hpp +++ b/include/pando-lib-galois/containers/host_indexed_map.hpp @@ -176,16 +176,16 @@ class HostIndexedMap { template class HostIndexedMapIt { pando::GlobalPtr m_curr; - std::int16_t m_loc; + std::int64_t m_loc; public: using iterator_category = std::random_access_iterator_tag; - using difference_type = std::int16_t; + using difference_type = std::int64_t; using value_type = T; using pointer = pando::GlobalPtr; using reference = pando::GlobalRef; - HostIndexedMapIt(pando::GlobalPtr curr, std::int16_t loc) : m_curr(curr), m_loc(loc) {} + HostIndexedMapIt(pando::GlobalPtr curr, std::int64_t loc) : m_curr(curr), m_loc(loc) {} constexpr HostIndexedMapIt() noexcept = default; constexpr HostIndexedMapIt(HostIndexedMapIt&&) noexcept = default; diff --git a/include/pando-lib-galois/containers/host_local_storage.hpp b/include/pando-lib-galois/containers/host_local_storage.hpp index 497deb88..035c5999 100644 --- a/include/pando-lib-galois/containers/host_local_storage.hpp +++ b/include/pando-lib-galois/containers/host_local_storage.hpp @@ -107,11 +107,11 @@ class HostLocalStorage { } pando::GlobalPtr get(std::uint64_t i) noexcept { - return m_items.getPointerAt(pando::NodeIndex(static_cast(i))); + return m_items.getPointerAt(pando::NodeIndex(static_cast(i))); } pando::GlobalPtr get(std::uint64_t i) const noexcept { - return m_items.getPointerAt(pando::NodeIndex(static_cast(i))); + return m_items.getPointerAt(pando::NodeIndex(static_cast(i))); } pando::GlobalRef operator[](std::uint64_t i) noexcept { @@ -184,16 +184,16 @@ class HostLocalStorage { template class HostLocalStorageIt { HostLocalStorage m_curr; - std::int16_t m_loc; + std::int64_t m_loc; public: using iterator_category = std::random_access_iterator_tag; - using difference_type = std::int16_t; + using difference_type = std::int64_t; using value_type = T; using pointer = pando::GlobalPtr; using reference = pando::GlobalRef; - HostLocalStorageIt(HostLocalStorage curr, std::int16_t loc) : m_curr(curr), m_loc(loc) {} + HostLocalStorageIt(HostLocalStorage curr, std::int64_t loc) : m_curr(curr), m_loc(loc) {} constexpr HostLocalStorageIt() noexcept = default; constexpr HostLocalStorageIt(HostLocalStorageIt&&) noexcept = default; diff --git a/include/pando-lib-galois/containers/per_thread.hpp b/include/pando-lib-galois/containers/per_thread.hpp index 804dc510..e20cada9 100644 --- a/include/pando-lib-galois/containers/per_thread.hpp +++ b/include/pando-lib-galois/containers/per_thread.hpp @@ -304,7 +304,7 @@ class PerThreadVector { // TODO(AdityaAtulTewari) Make this properly parallel. // Initialize the per host vectors - for (std::int16_t i = 0; i < static_cast(lift(flat, getNumHosts)); i++) { + for (std::int64_t i = 0; i < static_cast(lift(flat, getNumHosts)); i++) { auto place = pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}; auto ref = fmap(flat, operator[], i); std::uint64_t start = @@ -342,7 +342,7 @@ class PerThreadVector { // TODO(AdityaAtulTewari) Make this properly parallel. // Initialize the per host vectors - for (std::int16_t i = 0; i < static_cast(flat.getNumHosts()); i++) { + for (std::int64_t i = 0; i < static_cast(flat.getNumHosts()); i++) { auto ref = flat[i]; std::uint64_t start = (i == 0) ? 0 : m_indices[static_cast(i) * cores * threads - 1]; diff --git a/include/pando-lib-galois/graphs/dist_array_csr.hpp b/include/pando-lib-galois/graphs/dist_array_csr.hpp index c682af9e..07701f97 100644 --- a/include/pando-lib-galois/graphs/dist_array_csr.hpp +++ b/include/pando-lib-galois/graphs/dist_array_csr.hpp @@ -169,7 +169,7 @@ class DistArrayCSR { err = vec.initialize(pando::getPlaceDims().node.id); PANDO_CHECK_RETURN(err); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -464,7 +464,7 @@ class DistArrayCSR { err = vec.initialize(pando::getPlaceDims().node.id); PANDO_CHECK_RETURN(err); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } diff --git a/include/pando-lib-galois/graphs/dist_local_csr.hpp b/include/pando-lib-galois/graphs/dist_local_csr.hpp index 3cf945af..a46e3612 100644 --- a/include/pando-lib-galois/graphs/dist_local_csr.hpp +++ b/include/pando-lib-galois/graphs/dist_local_csr.hpp @@ -102,7 +102,7 @@ class DistLocalCSR { pointer ptr = m_pos + 1; CSR csrCurr = getCachedCSR(arrayOfCSRs, currNode); if (csrCurr.vertexEdgeOffsets.end() - 1 > ptr || - (int16_t)currNode == pando::getPlaceDims().node.id - 1) { + (int64_t)currNode == pando::getPlaceDims().node.id - 1) { m_pos = ptr; } else { csrCurr = getCachedCSR(arrayOfCSRs, currNode + 1); @@ -582,7 +582,7 @@ class DistLocalCSR { }; for (std::uint64_t i = 0; i < numHosts; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; PANDO_CHECK( pando::executeOn(place, createCSRFuncs, this->arrayOfCSRs, vertexData, numEdges, i, wgh)); @@ -631,7 +631,7 @@ class DistLocalCSR { wgh.done(); }; for (std::uint64_t i = 0; i < numHosts; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; PANDO_CHECK_RETURN( pando::executeOn(place, fillCSRFuncs, *this, vertexData, edgeData, edgeMap, i, wgh)); @@ -791,7 +791,7 @@ class DistLocalCSR { PANDO_CHECK(wg.initialize(numHosts)); auto wgh = wg.getHandle(); for (std::uint64_t i = 0; i < numHosts; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; PANDO_CHECK(pando::executeOn(place, createMirrors, partEdges, mirrorList, V2PM, i, wgh)); } @@ -901,11 +901,11 @@ class DistLocalCSR { uint64_t numLocalEdges = edgesEnd - edgesStart; PANDO_CHECK(currentCSR.initializeTopologyMemory( vertex, numLocalEdges, - pando::Place{pando::NodeIndex{(int16_t)host}, pando::anyPod, pando::anyCore}, + pando::Place{pando::NodeIndex{(int64_t)host}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main)); PANDO_CHECK(currentCSR.initializeDataMemory( vertex, numLocalEdges, - pando::Place{pando::NodeIndex{(int16_t)host}, pando::anyPod, pando::anyCore}, + pando::Place{pando::NodeIndex{(int64_t)host}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main)); uint64_t currLocalEdge = 0; @@ -922,7 +922,7 @@ class DistLocalCSR { currentCSR.vertexEdgeOffsets[vertex] = Vertex{¤tCSR.edgeDestinations[currLocalEdge]}; PANDO_CHECK(fmap(arrayOfCSRs[host], initialize, - pando::Place{pando::NodeIndex{(int16_t)host}, pando::anyPod, pando::anyCore}, + pando::Place{pando::NodeIndex{(int64_t)host}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main)); fmap(arrayOfCSRs[host], operator[], host) = currentCSR; edgesStart = edgesEnd; @@ -1087,7 +1087,7 @@ class DistLocalCSR { std::uint64_t hosts = static_cast(pando::getPlaceDims().node.id); for (std::uint64_t i = 0; i < numThreads; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, pando::anyPod, pando::anyCore}; PANDO_CHECK_RETURN( pando::executeOn(place, &galois::internal::loadVertexFilePerThread, @@ -1101,7 +1101,7 @@ class DistLocalCSR { std::uint64_t hosts = static_cast(pando::getPlaceDims().node.id); for (std::uint64_t i = 0; i < numThreads; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, pando::anyPod, pando::anyCore}; PANDO_CHECK_RETURN(pando::executeOn( place, &galois::internal::loadEdgeFilePerThread, dones.getHandle(i), diff --git a/include/pando-lib-galois/graphs/mirror_dist_local_csr.hpp b/include/pando-lib-galois/graphs/mirror_dist_local_csr.hpp index ea1d0e93..34d801dd 100644 --- a/include/pando-lib-galois/graphs/mirror_dist_local_csr.hpp +++ b/include/pando-lib-galois/graphs/mirror_dist_local_csr.hpp @@ -728,7 +728,7 @@ class MirrorDistLocalCSR { }; uint64_t local_mirror_size = 0; for (std::uint64_t i = 0; i < numHosts; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; PANDO_CHECK(pando::executeOn(place, mirrorAttach, vertexData, mirrorList, i, wgh)); local_mirror_size = lift(mirrorList[i], size); @@ -774,7 +774,7 @@ class MirrorDistLocalCSR { }; for (std::uint64_t i = 0; i < numHosts; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; PANDO_CHECK( pando::executeOn(place, generateMetadata, *this, this->dlcsr, mirrorList, i, wgh)); @@ -812,11 +812,11 @@ class MirrorDistLocalCSR { // initialize localMirrorToRemoteMasterOrderedTable PANDO_CHECK_RETURN(localMasterToRemoteMirrorTable.initialize()); - for (std::int16_t i = 0; i < dims.node.id; i++) { + for (std::int64_t i = 0; i < dims.node.id; i++) { pando::GlobalRef>> localMasterToRemoteMirrorMap = localMasterToRemoteMirrorTable[i]; PANDO_CHECK_RETURN(fmap(localMasterToRemoteMirrorMap, initialize, dims.node.id)); - for (std::int16_t i = 0; i < dims.node.id; i++) { + for (std::int64_t i = 0; i < dims.node.id; i++) { pando::GlobalRef> mapVectorFromHost = fmap(localMasterToRemoteMirrorMap, operator[], i); PANDO_CHECK_RETURN(fmap(mapVectorFromHost, initialize, 0)); @@ -855,23 +855,23 @@ class MirrorDistLocalCSR { /** Testing Purpose **/ pando::GlobalRef> getLocalMirrorToRemoteMasterOrderedMap( - int16_t hostId) { + int64_t hostId) { return localMirrorToRemoteMasterOrderedTable[hostId]; } pando::GlobalRef>> getLocalMasterToRemoteMirrorMap( uint64_t hostId) { return localMasterToRemoteMirrorTable[hostId]; } - pando::GlobalRef> getMasterBitSet(int16_t hostId) { + pando::GlobalRef> getMasterBitSet(int64_t hostId) { return masterBitSets[hostId]; } - pando::GlobalRef> getMirrorBitSet(int16_t hostId) { + pando::GlobalRef> getMirrorBitSet(int64_t hostId) { return mirrorBitSets[hostId]; } - pando::GlobalRef getMasterRange(int16_t hostId) { + pando::GlobalRef getMasterRange(int64_t hostId) { return masterRange[hostId]; } - pando::GlobalRef getMirrorRange(int16_t hostId) { + pando::GlobalRef getMirrorRange(int64_t hostId) { return mirrorRange[hostId]; } diff --git a/include/pando-lib-galois/import/ingest_rmat_el.hpp b/include/pando-lib-galois/import/ingest_rmat_el.hpp index 3c4cdcea..c0303bbb 100644 --- a/include/pando-lib-galois/import/ingest_rmat_el.hpp +++ b/include/pando-lib-galois/import/ingest_rmat_el.hpp @@ -78,7 +78,7 @@ ReturnType initializeELDACSR(pando::Array filename, std::uint64_t numVerti PANDO_MEM_STAT_NEW_KERNEL("loadELFilePerThread Start"); for (std::uint64_t i = 0; i < numThreads; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, pando::anyPod, pando::anyCore}; PANDO_CHECK(pando::executeOn(place, &galois::loadELFilePerThread, wgh, filename, 1, numThreads, i, localReadEdges, perThreadRename, numVertices)); @@ -145,7 +145,7 @@ ReturnType initializeELDLCSR(pando::Array filename, std::uint64_t numVerti PANDO_MEM_STAT_NEW_KERNEL("loadELFilePerThread Start"); for (std::uint64_t i = 0; i < numThreads; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, pando::anyPod, pando::anyCore}; PANDO_CHECK(pando::executeOn(place, &galois::loadELFilePerThread, wgh, filename, 1, numThreads, i, localReadEdges, perThreadRename, numVertices)); diff --git a/include/pando-lib-galois/import/ingest_wmd_csv.hpp b/include/pando-lib-galois/import/ingest_wmd_csv.hpp index 4f298870..d54cd1bf 100644 --- a/include/pando-lib-galois/import/ingest_wmd_csv.hpp +++ b/include/pando-lib-galois/import/ingest_wmd_csv.hpp @@ -91,7 +91,7 @@ galois::DistLocalCSR initializeWMDDLCSR(pando::Array PANDO_MEM_STAT_NEW_KERNEL("loadWMDFilePerThread Start"); for (std::uint64_t i = 0; i < numThreads; i++) { - pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, + pando::Place place = pando::Place{pando::NodeIndex{static_cast(i % hosts)}, pando::anyPod, pando::anyCore}; PANDO_CHECK(pando::executeOn(place, &galois::loadWMDFilePerThread, wgh, filename, 1, numThreads, i, localReadEdges, perThreadRename, localReadVertices, totVerts)); diff --git a/include/pando-lib-galois/loops/do_all.hpp b/include/pando-lib-galois/loops/do_all.hpp index 83b6b40c..1f614d9c 100644 --- a/include/pando-lib-galois/loops/do_all.hpp +++ b/include/pando-lib-galois/loops/do_all.hpp @@ -311,17 +311,17 @@ class DoAll { const auto end = range.end(); for (auto curr = range.begin(); curr != end; curr++) { - int16_t assignedHost; + int64_t assignedHost; if (workPerHost > 0) { - assignedHost = (int16_t)(*curr / workPerHost); + assignedHost = (int64_t)(*curr / workPerHost); } else if (hosts % workItems == 0) { // Given that we have 8 pxns and we schedule 4 workItems, this will place the workers on the // even numbered pxns - assignedHost = (int16_t)(*curr * (hosts / workItems)); + assignedHost = (int64_t)(*curr * (hosts / workItems)); } else { // Given that workItems < hosts and workItems does not divide hosts, assign the work // sequentially - assignedHost = (int16_t)(*curr); + assignedHost = (int64_t)(*curr); } if (assignedHost >= pando::getPlaceDims().node.id) { assignedHost = pando::getPlaceDims().node.id - 1; diff --git a/include/pando-lib-galois/utility/locality.hpp b/include/pando-lib-galois/utility/locality.hpp index 10437d6f..bd3f6a9a 100644 --- a/include/pando-lib-galois/utility/locality.hpp +++ b/include/pando-lib-galois/utility/locality.hpp @@ -64,7 +64,7 @@ namespace galois { static_cast(placeDims.core.y); const std::uint64_t threadsPerHost = threadsPerPod * static_cast(placeDims.pod.x) * static_cast(placeDims.pod.y); - const pando::NodeIndex node(static_cast(idx / threadsPerHost)); + const pando::NodeIndex node(static_cast(idx / threadsPerHost)); const std::uint64_t threadPerHostIdx = idx % threadsPerHost; const std::uint64_t podPerHostIdx = threadPerHostIdx / threadsPerPod; const pando::PodIndex pod(podPerHostIdx / placeDims.pod.y, podPerHostIdx % placeDims.pod.y); diff --git a/microbench/bfs/include/pando-bfs-galois/sssp.hpp b/microbench/bfs/include/pando-bfs-galois/sssp.hpp index 4532f437..867c1d8a 100644 --- a/microbench/bfs/include/pando-bfs-galois/sssp.hpp +++ b/microbench/bfs/include/pando-bfs-galois/sssp.hpp @@ -296,7 +296,7 @@ pando::Status SSSPMDLCSR(G& graph, std::uint64_t src, HostLocalStorage>(memoryResource->allocate(tableByteCount)); - for (std::int16_t nodeId = 0; nodeId < placeDims.node.id; ++nodeId) { + for (std::int64_t nodeId = 0; nodeId < placeDims.node.id; ++nodeId) { for (std::int8_t podX = 0; podX < placeDims.pod.x; ++podX) { for (std::int8_t podY = 0; podY < placeDims.pod.y; ++podY) { for (std::int8_t coreX = 0; coreX < placeDims.core.x; ++coreX) { diff --git a/pando-rt/examples/helloworld.cpp b/pando-rt/examples/helloworld.cpp index cb7722c9..a2c8f6e4 100644 --- a/pando-rt/examples/helloworld.cpp +++ b/pando-rt/examples/helloworld.cpp @@ -26,7 +26,7 @@ void nodeGreetings(int level) { if (level < 2) { pando::NodeIndex rightNode{ - static_cast((thisPlace.node.id + 1) % placeDims.node.id)}; + static_cast((thisPlace.node.id + 1) % placeDims.node.id)}; PANDO_CHECK( pando::executeOn(pando::Place{rightNode, {}, pando::anyCore}, &nodeGreetings, level + 1)); } diff --git a/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp b/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp index 3c5ff2e4..656ece10 100644 --- a/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp +++ b/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp @@ -46,7 +46,7 @@ void setValue(pando::GlobalPtr localArray, std::int64_t initialVal void initializeLocalArray(pando::GlobalPtr localArray, std::int64_t value, std::int32_t numCoresPerNode, pando::GlobalPtr done, [[maybe_unused]] pando::GlobalPtr coresDone) { - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; // Parallelize local array initialization for (std::int32_t c = 0; c < numCoresPerNode; ++c) { coresDone[c] = false; @@ -66,11 +66,11 @@ void initializeValues(pando::GlobalPtr>& distArra std::int32_t numCoresPerNode, pando::GlobalPtr done, pando::GlobalPtr>& distCoreDones) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); // Each PXN initializes its local array by `initialValue`. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = distArray[ipxn]; pando::GlobalPtr localCoreDone = distCoreDones[ipxn]; if (ipxn == thisNodeId) { @@ -100,7 +100,7 @@ void reduceOwnValuesParallel(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones, pando::GlobalPtr coresDone) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { coresDone[i] = false; if (i % placeDims.node.id == thisNodeId) { @@ -126,9 +126,9 @@ void reduceValues(pando::GlobalPtr>& distArray, const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN performs sum-reduction to its local array. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -159,7 +159,7 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::int32_t c = 0; c < numCoresPerNode; ++c) { if (c % placeDims.node.id == ipxn) { @@ -202,7 +202,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; std::int8_t numPodsPerPXNs = placeDims.pod.x * placeDims.pod.y; std::int32_t numCoresPerNode = placeDims.core.x * placeDims.core.y * numPodsPerPXNs; auto mmResource = pando::getDefaultMainMemoryResource(); @@ -220,7 +220,7 @@ int pandoMain(int, char**) { mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local distributed array memory allocation // Remote and local distributed core done checking array memory allocation - for (std::int16_t n = 0; n < numPXNs; ++n) { + for (std::int64_t n = 0; n < numPXNs; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; { @@ -252,11 +252,11 @@ int pandoMain(int, char**) { // Deallocate arrays // TODO(hc): I suspect this is a root's bug? - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * numCoresPerNode); } - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distCoreDones[n]; pando::deallocateMemory(localArray, sizeof(bool) * numCoresPerNode); } diff --git a/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp b/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp index 6b97dd98..bd9a61fc 100644 --- a/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp +++ b/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp @@ -49,7 +49,7 @@ void setValue(pando::GlobalPtr localArray, std::int64_t value, std void initializeLocalArray(pando::GlobalPtr localArray, std::int64_t value, std::int32_t numCoresPerNode, pando::GlobalPtr done, [[maybe_unused]] pando::GlobalPtr coresDone) { - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; // Parallelize local array initialization for (std::int32_t c = 0; c < numCoresPerNode; ++c) { coresDone[c] = false; @@ -69,11 +69,11 @@ void initializeValues(pando::GlobalPtr>& distArra std::int32_t numCoresPerNode, pando::GlobalPtr done, pando::GlobalPtr>& distCoreDones) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); // Each PXN initializes its local array by `initialValue`. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = distArray[ipxn]; pando::GlobalPtr localCoreDone = distCoreDones[ipxn]; if (ipxn == thisNodeId) { @@ -103,7 +103,7 @@ void reduceOwnValuesParallel(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones, pando::GlobalPtr coresDone) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { coresDone[i] = false; if (i % placeDims.node.id == thisNodeId) { @@ -129,9 +129,9 @@ void reduceValues(pando::GlobalPtr>& distArray, const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN performs sum-reduction to its local array. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -161,7 +161,7 @@ void broadcastOwnValues(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones, pando::GlobalPtr coresDone) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { if (i % placeDims.node.id == thisNodeId) { // Copying a value wrapped by `GlobalPtr` requires casting, @@ -188,9 +188,9 @@ void broadcastValues(pando::GlobalPtr>& distArray const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN broadcasts its owning elements to other PXNs. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -215,10 +215,10 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::int32_t c = 0; c < numCoresPerNode; ++c) { - std::int16_t ownerPXN = (c % placeDims.node.id); + std::int64_t ownerPXN = (c % placeDims.node.id); if (localArray[c] != std::int64_t{ownerPXN * (placeDims.node.id - 1) + 1}) { check_correctness = false; } @@ -249,7 +249,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; std::int8_t numPodsPerPXNs = placeDims.pod.x * placeDims.pod.y; std::int32_t numCoresPerNode = placeDims.core.x * placeDims.core.y * numPodsPerPXNs; auto mmResource = pando::getDefaultMainMemoryResource(); @@ -267,7 +267,7 @@ int pandoMain(int, char**) { mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local distributed array memory allocation // Remote and local distributed core done checking array memory allocation - for (std::int16_t n = 0; n < numPXNs; ++n) { + for (std::int64_t n = 0; n < numPXNs; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; { @@ -299,7 +299,7 @@ int pandoMain(int, char**) { correctnessCheck(distArray, numCoresPerNode); // Deallocate arrays - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * numCoresPerNode); pando::GlobalPtr localCoreDone = distCoreDones[n]; diff --git a/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp b/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp index 70f3c4e0..3aee99f2 100644 --- a/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp @@ -20,8 +20,8 @@ constexpr std::int64_t initialValue{1}; * @brief Wait until invoked tasks complete. */ template -void waitUntil(pando::GlobalPtr dones, T expected, std::int16_t numNodes) { - for (std::int16_t n = 0; n < numNodes; ++n) { +void waitUntil(pando::GlobalPtr dones, T expected, std::int64_t numNodes) { + for (std::int64_t n = 0; n < numNodes; ++n) { pando::waitUntil([dones, expected, n]() { return (dones[n] == expected); }); @@ -47,11 +47,11 @@ void setValue(pando::GlobalPtr localArray, std::int64_t value, void initializeValues(pando::GlobalPtr>& distArray, std::int32_t numCoresPerNode, pando::GlobalPtr done) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); // Each PXN initializes its local array by `initialValue`. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::Place remotePlace{pando::NodeIndex{ipxn}, pando::anyPod, pando::anyCore}; pando::GlobalPtr remoteArray = distArray[ipxn]; PANDO_CHECK(pando::executeOn(remotePlace, &setValue, remoteArray, initialValue, numCoresPerNode, @@ -72,7 +72,7 @@ void reduceOwnValues(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { if (i % placeDims.node.id == thisNodeId) { ownArray[i] = ownArray[i] + srcArray[i]; @@ -91,9 +91,9 @@ void reduceValues(pando::GlobalPtr>& distArray, const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN performs sum-reduction to its local array. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -117,7 +117,7 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::int32_t c = 0; c < numCoresPerNode; ++c) { if (c % placeDims.node.id == ipxn) { @@ -160,7 +160,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; std::int8_t numPodsPerPXNs = placeDims.pod.x * placeDims.pod.y; std::int32_t numCoresPerNode = placeDims.core.x * placeDims.core.y * numPodsPerPXNs; auto mmResource = pando::getDefaultMainMemoryResource(); @@ -173,7 +173,7 @@ int pandoMain(int, char**) { pando::GlobalPtr boolDones = static_cast>(mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local memory allocation - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; auto result = pando::allocateMemory(numCoresPerNode, otherPlace, pando::MemoryType::Main); @@ -191,7 +191,7 @@ int pandoMain(int, char**) { correctnessCheck(distArray, numCoresPerNode); // Deallocate arrays - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * numCoresPerNode); } diff --git a/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp b/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp index ec9cc6d3..c073b59b 100644 --- a/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp @@ -21,8 +21,8 @@ constexpr std::int64_t initialValue{1}; * @brief Wait until invoked tasks complete. */ template -void waitUntil(pando::GlobalPtr dones, T expected, std::int16_t numNodes) { - for (std::int16_t n = 0; n < numNodes; ++n) { +void waitUntil(pando::GlobalPtr dones, T expected, std::int64_t numNodes) { + for (std::int64_t n = 0; n < numNodes; ++n) { pando::waitUntil([dones, expected, n]() { return (dones[n] == expected); }); @@ -48,11 +48,11 @@ void setValue(pando::GlobalPtr localArray, std::int64_t value, void initializeValues(pando::GlobalPtr>& distArray, std::int32_t numCoresPerNode, pando::GlobalPtr done) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); // Each PXN initializes its local array by `initialValue`. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::Place remotePlace{pando::NodeIndex{ipxn}, pando::anyPod, pando::anyCore}; pando::GlobalPtr remoteArray = distArray[ipxn]; PANDO_CHECK(pando::executeOn(remotePlace, &setValue, remoteArray, initialValue, numCoresPerNode, @@ -73,7 +73,7 @@ void reduceOwnValues(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { if (i % placeDims.node.id == thisNodeId) { ownArray[i] = ownArray[i] + (thisNodeId * srcArray[i]); @@ -92,9 +92,9 @@ void reduceValues(pando::GlobalPtr>& distArray, const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN performs sum-reduction to its local array. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -117,7 +117,7 @@ void broadcastOwnValues(pando::GlobalPtr srcArray, pando::GlobalPtr ownArray, std::int32_t numCoresPerNode, pando::GlobalPtr dones) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; for (std::int32_t i = 0; i < numCoresPerNode; ++i) { if (i % placeDims.node.id == thisNodeId) { // Copying a value wrapped by `GlobalPtr` requires casting, @@ -138,9 +138,9 @@ void broadcastValues(pando::GlobalPtr>& distArray const auto placeDims = pando::getPlaceDims(); // Iterate a pair of PXNs, and pass all the remote arrays to each // PXN. Then, each PXN broadcasts its owning elements to other PXNs. - for (std::int16_t spxn = 0; spxn < placeDims.node.id; ++spxn) { + for (std::int64_t spxn = 0; spxn < placeDims.node.id; ++spxn) { pando::GlobalPtr srcArray = distArray[spxn]; - for (std::int16_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { + for (std::int64_t dpxn = 0; dpxn < placeDims.node.id; ++dpxn) { if (spxn == dpxn) { boolDones[spxn] = true; continue; @@ -164,10 +164,10 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::int32_t c = 0; c < numCoresPerNode; ++c) { - std::int16_t ownerPXN = (c % placeDims.node.id); + std::int64_t ownerPXN = (c % placeDims.node.id); if (localArray[c] != std::int64_t{ownerPXN * (placeDims.node.id - 1) + 1}) { std::printf("%li %i %li\n", pando::getCurrentPlace().node.id, c, (int64_t)localArray[c]); check_correctness = false; @@ -199,7 +199,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; std::int8_t numPodsPerPXNs = placeDims.pod.x * placeDims.pod.y; std::int32_t numCoresPerNode = placeDims.core.x * placeDims.core.y * numPodsPerPXNs; auto mmResource = pando::getDefaultMainMemoryResource(); @@ -212,7 +212,7 @@ int pandoMain(int, char**) { pando::GlobalPtr boolDones = static_cast>(mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local memory allocation - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; auto result = pando::allocateMemory(numCoresPerNode, otherPlace, pando::MemoryType::Main); @@ -231,7 +231,7 @@ int pandoMain(int, char**) { correctnessCheck(distArray, numCoresPerNode); // Deallocate arrays - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * numCoresPerNode); } diff --git a/pando-rt/examples/multi_pxns/onecore_scatter_diffdim_arrays_values.cpp b/pando-rt/examples/multi_pxns/onecore_scatter_diffdim_arrays_values.cpp index 58351503..4546f7d5 100644 --- a/pando-rt/examples/multi_pxns/onecore_scatter_diffdim_arrays_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_scatter_diffdim_arrays_values.cpp @@ -34,7 +34,7 @@ void scatterValues(pando::GlobalPtr> distHeteroAr pando::GlobalPtr distHeteroArraySize, pando::GlobalPtr done) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); pando::GlobalPtr localArray = distHeteroArray[thisNodeId]; @@ -45,7 +45,7 @@ void scatterValues(pando::GlobalPtr> distHeteroAr done[thisNodeId] = true; // Scatter values to remote PXNs. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::Place destPlace{pando::NodeIndex{ipxn}, pando::anyPod, pando::anyCore}; pando::GlobalPtr remoteArray = distHeteroArray[ipxn]; PANDO_CHECK(pando::executeOn(destPlace, &setValue, remoteArray, solution, @@ -61,7 +61,7 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::uint64_t i = 0; i < outputSizes[ipxn]; ++i) { if (localArray[i] != solution) { @@ -79,8 +79,8 @@ void correctnessCheck(pando::GlobalPtr> output, /** * @brief Wait until invoked tasks complete. */ -void waitUntil(pando::GlobalPtr dones, std::int16_t numNodes) { - for (std::int16_t n = 0; n < numNodes; ++n) { +void waitUntil(pando::GlobalPtr dones, std::int64_t numNodes) { + for (std::int64_t n = 0; n < numNodes; ++n) { pando::waitUntil([dones, n]() { return dones[n]; }); @@ -106,7 +106,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; auto mmResource = pando::getDefaultMainMemoryResource(); // A global array that holds pointers to PXN-local array is @@ -121,7 +121,7 @@ int pandoMain(int, char**) { static_cast>(mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local memory allocation. // Each PXN has different sized memory. - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; auto result = pando::allocateMemory(n + 10, otherPlace, pando::MemoryType::Main); @@ -138,7 +138,7 @@ int pandoMain(int, char**) { correctnessCheck(distHeteroArray, distHeteroArraySize); // Deallocate arrays - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distHeteroArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * distHeteroArraySize[n]); } diff --git a/pando-rt/examples/multi_pxns/onecore_scatter_samedim_arrays_values.cpp b/pando-rt/examples/multi_pxns/onecore_scatter_samedim_arrays_values.cpp index af95ce54..505c8bbb 100644 --- a/pando-rt/examples/multi_pxns/onecore_scatter_samedim_arrays_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_scatter_samedim_arrays_values.cpp @@ -32,7 +32,7 @@ void setValue(pando::GlobalPtr localArray, std::int64_t value, void scatterValues(pando::GlobalPtr>& distArray, std::int32_t numCoresPerNode, pando::GlobalPtr done) { const auto placeDims = pando::getPlaceDims(); - std::int16_t thisNodeId = pando::getCurrentPlace().node.id; + std::int64_t thisNodeId = pando::getCurrentPlace().node.id; assert(thisNodeId == 0); // Initialize values. @@ -44,7 +44,7 @@ void scatterValues(pando::GlobalPtr>& distArray, done[thisNodeId] = true; // Scatter values to remote PXNs. - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::Place destPlace{pando::NodeIndex{ipxn}, pando::anyPod, pando::anyCore}; pando::GlobalPtr remoteArray = distArray[ipxn]; PANDO_CHECK(pando::executeOn(destPlace, &setValue, remoteArray, solution, numCoresPerNode, @@ -60,7 +60,7 @@ void correctnessCheck(pando::GlobalPtr> output, const auto placeDims = pando::getPlaceDims(); // Check correctness. bool check_correctness{true}; - for (std::int16_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { + for (std::int64_t ipxn = 0; ipxn < placeDims.node.id; ++ipxn) { pando::GlobalPtr localArray = output[ipxn]; for (std::int32_t c = 0; c < numCoresPerNode; ++c) { if (localArray[c] != solution) { @@ -78,8 +78,8 @@ void correctnessCheck(pando::GlobalPtr> output, /** * @brief Wait until invoked tasks complete. */ -void waitUntil(pando::GlobalPtr dones, std::int16_t numNodes) { - for (std::int16_t n = 0; n < numNodes; ++n) { +void waitUntil(pando::GlobalPtr dones, std::int64_t numNodes) { + for (std::int64_t n = 0; n < numNodes; ++n) { pando::waitUntil([dones, n]() { return dones[n]; }); @@ -105,7 +105,7 @@ int pandoMain(int, char**) { const auto thisPlace = pando::getCurrentPlace(); if (thisPlace.node.id == 0) { - std::int16_t numPXNs = placeDims.node.id; + std::int64_t numPXNs = placeDims.node.id; std::int8_t numPodsPerPXNs = placeDims.pod.x * placeDims.pod.y; std::int32_t numCoresPerNode = placeDims.core.x * placeDims.core.y * numPodsPerPXNs; auto mmResource = pando::getDefaultMainMemoryResource(); @@ -118,7 +118,7 @@ int pandoMain(int, char**) { pando::GlobalPtr dones = static_cast>(mmResource->allocate(sizeof(bool) * numPXNs)); // Remote and local memory allocation - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { const pando::Place otherPlace{pando::NodeIndex{n}, pando::anyPod, pando::anyCore}; auto result = pando::allocateMemory(numCoresPerNode, otherPlace, pando::MemoryType::Main); @@ -135,7 +135,7 @@ int pandoMain(int, char**) { correctnessCheck(distArray, numCoresPerNode); // Deallocate arrays - for (std::int16_t n = 0; n < placeDims.node.id; ++n) { + for (std::int64_t n = 0; n < placeDims.node.id; ++n) { pando::GlobalPtr localArray = distArray[n]; pando::deallocateMemory(localArray, sizeof(std::int64_t) * numCoresPerNode); } diff --git a/pando-rt/src/drv_info.cpp b/pando-rt/src/drv_info.cpp index a7e66672..5eb45b30 100644 --- a/pando-rt/src/drv_info.cpp +++ b/pando-rt/src/drv_info.cpp @@ -16,7 +16,7 @@ void setStageInit() { set_stage(stage_t::STAGE_INIT); }; auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { for (std::int8_t pod_x = 0; pod_x < dims.pod.x; pod_x++) { for (std::int8_t pod_y = 0; pod_y < dims.pod.y; pod_y++) { for (std::int8_t core_x = 0; core_x < dims.core.x; core_x++) { @@ -41,7 +41,7 @@ void setStageExecComp() { set_stage(stage_t::STAGE_EXEC_COMP); }; auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { for (std::int8_t pod_x = 0; pod_x < dims.pod.x; pod_x++) { for (std::int8_t pod_y = 0; pod_y < dims.pod.y; pod_y++) { for (std::int8_t core_x = 0; core_x < dims.core.x; core_x++) { @@ -66,7 +66,7 @@ void setStageExecComm() { set_stage(stage_t::STAGE_EXEC_COMM); }; auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { for (std::int8_t pod_x = 0; pod_x < dims.pod.x; pod_x++) { for (std::int8_t pod_y = 0; pod_y < dims.pod.y; pod_y++) { for (std::int8_t core_x = 0; core_x < dims.core.x; core_x++) { @@ -91,7 +91,7 @@ void setStageOther() { set_stage(stage_t::STAGE_OTHER); }; auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { for (std::int8_t pod_x = 0; pod_x < dims.pod.x; pod_x++) { for (std::int8_t pod_y = 0; pod_y < dims.pod.y; pod_y++) { for (std::int8_t core_x = 0; core_x < dims.core.x; core_x++) { @@ -116,7 +116,7 @@ void incrementPhase() { increment_phase(); }; auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { for (std::int8_t pod_x = 0; pod_x < dims.pod.x; pod_x++) { for (std::int8_t pod_y = 0; pod_y < dims.pod.y; pod_y++) { for (std::int8_t core_x = 0; core_x < dims.core.x; core_x++) { diff --git a/pando-rt/src/drvx/cp.cpp b/pando-rt/src/drvx/cp.cpp index ef535df6..078c5e35 100644 --- a/pando-rt/src/drvx/cp.cpp +++ b/pando-rt/src/drvx/cp.cpp @@ -46,7 +46,7 @@ void CommandProcessor::barrier() { // last PXN to reach barrier; reset global barrier counter and signal to other PXNs that we // are done *toNativeDrvPointerOnDram(globalBarrierCounter, NodeIndex(0)) = 0u; - for (std::int16_t i = 0; i < Drvx::getNodeDims().id; ++i) { + for (std::int64_t i = 0; i < Drvx::getNodeDims().id; ++i) { *toNativeDrvPointerOnDram(pxnBarrierDone, NodeIndex(i)) = 1; } } else { diff --git a/src/edge_exchange.cpp b/src/edge_exchange.cpp index db76cec9..681f4048 100644 --- a/src/edge_exchange.cpp +++ b/src/edge_exchange.cpp @@ -100,7 +100,7 @@ void read_reduce_local_edge_lists(pando::GlobalPtr dones, auto num_hosts = pando::getPlaceDims().node.id; // Reads each hosts' data into local Edge List. Collects Metadata. Assigns each edge to VHOST - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { auto vhost_index = i * num_vhosts_per_host; PANDO_CHECK(executeOn(pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, &getVHostData, &dones[i], &global_vhostMetadataPerHost[vhost_index], @@ -109,7 +109,7 @@ void read_reduce_local_edge_lists(pando::GlobalPtr dones, } // REDUCE Metadata: - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { pando::waitUntil([dones, i]() { return dones[i]; }); @@ -120,7 +120,7 @@ void read_reduce_local_edge_lists(pando::GlobalPtr dones, } // RESET dones: - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) dones[i] = false; } @@ -171,18 +171,18 @@ void launch_assign_vhosts_to_host(pando::GlobalPtr dones, auto num_hosts = pando::getPlaceDims().node.id; // LAUNCH KERNEL: Build mapping - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { PANDO_CHECK(executeOn(pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, &assign_vhosts_to_host, &dones[i], vhosts_per_host, sorted_indices_ptr)); } - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { pando::waitUntil([dones, i]() { return dones[i]; }); } // Reset dones - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) dones[i] = false; } @@ -224,18 +224,18 @@ void launch_build_edges_to_send( auto num_hosts = pando::getPlaceDims().node.id; // LAUNCH KERNEL:: build_edges_to_send - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { PANDO_CHECK(executeOn(pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, &build_edges_to_send, &dones[i], edges_to_send, vhosts_per_host, global_vhostEdgesPerHost, num_vhosts_per_host)); } - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) pando::waitUntil([dones, i]() { return dones[i]; }); // Reset dones - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) dones[i] = false; } @@ -267,16 +267,16 @@ void launch_edge_exchange( auto num_hosts = pando::getPlaceDims().node.id; // LAUNCH KERNEL:: edgeExchange - for (int16_t i = 0; i < num_hosts; i++) { + for (int64_t i = 0; i < num_hosts; i++) { PANDO_CHECK(executeOn(pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, &edge_exchange, &dones[i], final_edgelist_per_host, edges_to_send)); } - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) pando::waitUntil([dones, i]() { return dones[i]; }); // Reset dones - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) dones[i] = false; } diff --git a/test/containers/test_dist_array.cpp b/test/containers/test_dist_array.cpp index ed5a419d..d10ac807 100644 --- a/test/containers/test_dist_array.cpp +++ b/test/containers/test_dist_array.cpp @@ -44,8 +44,8 @@ TEST(DistArray, Initialize) { const std::uint64_t size = 10; pando::Vector vec; EXPECT_EQ(vec.initialize(size), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(size); i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + for (std::int64_t i = 0; i < static_cast(size); i++) { + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; vec[i] = PlaceType{pando::Place{pando::NodeIndex{nodeIdx}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -56,7 +56,7 @@ TEST(DistArray, Initialize) { EXPECT_EQ(array.size(), size); for (std::uint64_t i = 0; i < size; i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; EXPECT_EQ(pando::localityOf(&array[i]).node.id, nodeIdx); array[i] = i; } @@ -74,16 +74,16 @@ TEST(DistArray, Swap) { const std::uint64_t size1 = 16; pando::Vector vec0; EXPECT_EQ(vec0.initialize(size0), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(size0); i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + for (std::int64_t i = 0; i < static_cast(size0); i++) { + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; vec0[i] = PlaceType{pando::Place{pando::NodeIndex{nodeIdx}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } pando::Vector vec1; EXPECT_EQ(vec1.initialize(size1), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(size1); i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + for (std::int64_t i = 0; i < static_cast(size1); i++) { + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; vec1[i] = PlaceType{pando::Place{pando::NodeIndex{nodeIdx}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -126,7 +126,7 @@ TEST(DistArray, Iterator) { pando::Vector vec; EXPECT_EQ(vec.initialize(pando::getPlaceDims().node.id), pando::Status::Success); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -158,7 +158,7 @@ TEST(DistArray, IteratorManual) { pando::Vector vec; EXPECT_EQ(vec.initialize(pando::getPlaceDims().node.id), pando::Status::Success); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -190,7 +190,7 @@ TEST(DistArray, ReverseIterator) { pando::Vector vec; EXPECT_EQ(vec.initialize(pando::getPlaceDims().node.id), pando::Status::Success); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -225,7 +225,7 @@ TEST(DistArray, IteratorExecuteOn) { pando::Vector vec; EXPECT_EQ(vec.initialize(pando::getPlaceDims().node.id), pando::Status::Success); - for (std::int16_t i = 0; i < pando::getPlaceDims().node.id; i++) { + for (std::int64_t i = 0; i < pando::getPlaceDims().node.id; i++) { vec[i] = PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -258,8 +258,8 @@ TEST(DistArray, Sort) { const std::uint64_t size = 10; pando::Vector vec; EXPECT_EQ(vec.initialize(size), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(size); i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + for (std::int64_t i = 0; i < static_cast(size); i++) { + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; vec[i] = PlaceType{pando::Place{pando::NodeIndex{nodeIdx}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } @@ -286,8 +286,8 @@ TEST(DistArray, SortPair) { const std::uint64_t size = 10; pando::Vector vec; EXPECT_EQ(vec.initialize(size), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(size); i++) { - std::int16_t nodeIdx = i % pando::getPlaceDims().node.id; + for (std::int64_t i = 0; i < static_cast(size); i++) { + std::int64_t nodeIdx = i % pando::getPlaceDims().node.id; vec[i] = PlaceType{pando::Place{pando::NodeIndex{nodeIdx}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; } diff --git a/test/containers/test_host_cached_array.cpp b/test/containers/test_host_cached_array.cpp index 1b90b357..12e27a1d 100644 --- a/test/containers/test_host_cached_array.cpp +++ b/test/containers/test_host_cached_array.cpp @@ -80,7 +80,7 @@ TEST(HostCachedArray, Initialize) { EXPECT_EQ(array.size(), size * nodes); for (std::uint64_t i = 0; i < size * nodes; i++) { - std::int16_t nodeIdx = i / size; + std::int64_t nodeIdx = i / size; EXPECT_EQ(pando::localityOf(&array[i]).node.id, nodeIdx); array[i] = i; } diff --git a/test/containers/test_host_indexed_map.cpp b/test/containers/test_host_indexed_map.cpp index f69a337a..7958b889 100644 --- a/test/containers/test_host_indexed_map.cpp +++ b/test/containers/test_host_indexed_map.cpp @@ -30,7 +30,7 @@ TEST(HostIndexedMap, Init) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } @@ -49,7 +49,7 @@ TEST(HostIndexedMap, Init) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } @@ -89,7 +89,7 @@ TEST(HostIndexedMap, DoAll) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } diff --git a/test/containers/test_host_local_storage.cpp b/test/containers/test_host_local_storage.cpp index 0e9b2ba5..113d3036 100644 --- a/test/containers/test_host_local_storage.cpp +++ b/test/containers/test_host_local_storage.cpp @@ -30,7 +30,7 @@ TEST(HostLocalStorage, Init) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } @@ -49,7 +49,7 @@ TEST(HostLocalStorage, Init) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } @@ -89,7 +89,7 @@ TEST(HostLocalStorage, DoAll) { EXPECT_EQ(err, pando::Status::Success); for (std::uint64_t i = 0; i < ph.getNumHosts(); i++) { auto place = - pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; + pando::Place{pando::NodeIndex{static_cast(i)}, pando::anyPod, pando::anyCore}; err = pando::executeOn(place, f, ph, i, dones.getHandle(i)); EXPECT_EQ(err, pando::Status::Success); } diff --git a/test/containers/test_per_thread.cpp b/test/containers/test_per_thread.cpp index ce01cc41..072a2e50 100644 --- a/test/containers/test_per_thread.cpp +++ b/test/containers/test_per_thread.cpp @@ -263,7 +263,7 @@ TEST(PerThreadVector, HostLocalStorageVectorAppend) { galois::HostLocalStorage> phv{}; EXPECT_EQ(phv.initialize(), pando::Status::Success); - for (std::int16_t i = 0; i < static_cast(phv.getNumHosts()); i++) { + for (std::int64_t i = 0; i < static_cast(phv.getNumHosts()); i++) { auto place = pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}; auto ref = phv[i]; EXPECT_EQ(fmap(ref, initialize, 0, place, pando::MemoryType::Main), pando::Status::Success); diff --git a/test/import/test_cusp_importer.cpp b/test/import/test_cusp_importer.cpp index 79bff137..6251095c 100644 --- a/test/import/test_cusp_importer.cpp +++ b/test/import/test_cusp_importer.cpp @@ -300,7 +300,7 @@ TEST(InsertLocalEdgesPerThread, MultiBigInsertionTest) { } TEST(BuildEdgeCountToSend, SmallSequentialTest) { - uint16_t numHosts = pando::getPlaceDims().node.id; + uint64_t numHosts = pando::getPlaceDims().node.id; uint32_t numVirtualHosts = numHosts; galois::ThreadLocalVector> perThreadLocalEdges{}; @@ -686,7 +686,7 @@ TEST(loadGraphFilePerThread, loadGraph) { for (uint64_t i = 0; i < numThreads; i++) { pando::Place place = - pando::Place{pando::NodeIndex{static_cast(i % pando::getPlaceDims().node.id)}, + pando::Place{pando::NodeIndex{static_cast(i % pando::getPlaceDims().node.id)}, pando::anyPod, pando::anyCore}; pando::Status err = pando::executeOn(place, &galois::loadWMDFilePerThread, wgh, filename, segmentsPerThread, @@ -756,8 +756,8 @@ TEST(loadGraphFilePerThread, loadEdgeList) { EXPECT_EQ(pando::Status::Success, wg.initialize(numThreads)); auto wgh = wg.getHandle(); for (uint64_t i = 0; i < numThreads; i++) { - std::int16_t nodeId = - static_cast(i % static_cast(pando::getPlaceDims().node.id)); + std::int64_t nodeId = + static_cast(i % static_cast(pando::getPlaceDims().node.id)); pando::Place place = pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}; pando::Status err = pando::executeOn(place, &galois::loadELFilePerThread, wgh, filename, segmentsPerThread, diff --git a/test/import/test_edge_exchange.cpp b/test/import/test_edge_exchange.cpp index a593db44..93319ed8 100644 --- a/test/import/test_edge_exchange.cpp +++ b/test/import/test_edge_exchange.cpp @@ -10,7 +10,7 @@ void check_dones_reset(pando::GlobalPtr dones) { auto num_hosts = pando::getPlaceDims().node.id; - for (int16_t i = 0; i < num_hosts; i++) + for (int64_t i = 0; i < num_hosts; i++) EXPECT_EQ(dones[i], false); } @@ -442,8 +442,8 @@ void run_test_launch_edge_exchange(pando::Notification::HandleType hb_done) { } TEST(TriangleCount, SimpleRRLocalELs) { - int16_t num_hosts = pando::getPlaceDims().node.id; - int16_t required_num_hosts = 3; + int64_t num_hosts = pando::getPlaceDims().node.id; + int64_t required_num_hosts = 3; if (num_hosts == required_num_hosts) { pando::Notification necessary; PANDO_CHECK(pando::executeOn(pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}, @@ -453,8 +453,8 @@ TEST(TriangleCount, SimpleRRLocalELs) { } TEST(TriangleCount, SimpleSortMetadata) { - int16_t num_hosts = pando::getPlaceDims().node.id; - int16_t required_num_hosts = 3; + int64_t num_hosts = pando::getPlaceDims().node.id; + int64_t required_num_hosts = 3; if (num_hosts == required_num_hosts) { pando::Notification necessary; PANDO_CHECK(pando::executeOn(pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}, @@ -464,8 +464,8 @@ TEST(TriangleCount, SimpleSortMetadata) { } TEST(TriangleCount, SimpleDistributeVHosts) { - int16_t num_hosts = pando::getPlaceDims().node.id; - int16_t required_num_hosts = 3; + int64_t num_hosts = pando::getPlaceDims().node.id; + int64_t required_num_hosts = 3; if (num_hosts == required_num_hosts) { pando::Notification necessary; PANDO_CHECK(pando::executeOn(pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}, @@ -475,8 +475,8 @@ TEST(TriangleCount, SimpleDistributeVHosts) { } TEST(TriangleCount, SimpleBuildEdges2Send) { - int16_t num_hosts = pando::getPlaceDims().node.id; - int16_t required_num_hosts = 3; + int64_t num_hosts = pando::getPlaceDims().node.id; + int64_t required_num_hosts = 3; if (num_hosts == required_num_hosts) { pando::Notification necessary; PANDO_CHECK(pando::executeOn(pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}, @@ -486,8 +486,8 @@ TEST(TriangleCount, SimpleBuildEdges2Send) { } TEST(TriangleCount, SimpleEdgeExchange) { - int16_t num_hosts = pando::getPlaceDims().node.id; - int16_t required_num_hosts = 3; + int64_t num_hosts = pando::getPlaceDims().node.id; + int64_t required_num_hosts = 3; if (num_hosts == required_num_hosts) { pando::Notification necessary; PANDO_CHECK(pando::executeOn(pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}, diff --git a/test/loops/test_do_all.cpp b/test/loops/test_do_all.cpp index cf3437e1..5cc194ce 100644 --- a/test/loops/test_do_all.cpp +++ b/test/loops/test_do_all.cpp @@ -117,7 +117,7 @@ TEST(doALL, CustomLocality) { }, +[](bool extraState, uint64_t elt) { if (extraState) { - return pando::Place{pando::NodeIndex{(int16_t)(elt % pando::getPlaceDims().node.id)}, + return pando::Place{pando::NodeIndex{(int64_t)(elt % pando::getPlaceDims().node.id)}, pando::anyPod, pando::anyCore}; } else { return pando::Place{pando::NodeIndex{0}, pando::anyPod, pando::anyCore}; diff --git a/test/python/test_MDLCSR_Broadcast.cpp b/test/python/test_MDLCSR_Broadcast.cpp index bc530fc0..ffdf2871 100644 --- a/test/python/test_MDLCSR_Broadcast.cpp +++ b/test/python/test_MDLCSR_Broadcast.cpp @@ -98,14 +98,14 @@ void runTest(const char* elFile, std::uint64_t numVertices) { fmapVoid(masterBitSet, fill, true); barrier.done(); }; - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { PANDO_CHECK( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, barrier, graph.getMasterBitSets())); } PANDO_CHECK(barrier.wait()); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef masterRange = graph.getMasterRange(nodeId); for (Graph::VertexTopologyID masterTopologyID = *lift(masterRange, begin); masterTopologyID < *lift(masterRange, end); masterTopologyID++) { @@ -116,7 +116,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { graph.broadcast(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef> mirrorBitSet = graph.getMirrorBitSet(nodeId); pando::GlobalRef> localMirrorToRemoteMasterOrderedMap = graph.getLocalMirrorToRemoteMasterOrderedMap(nodeId); diff --git a/test/python/test_MDLCSR_MapExchange.cpp b/test/python/test_MDLCSR_MapExchange.cpp index 09f8576b..a6b52a97 100644 --- a/test/python/test_MDLCSR_MapExchange.cpp +++ b/test/python/test_MDLCSR_MapExchange.cpp @@ -87,7 +87,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { auto dims = pando::getPlaceDims(); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef> localMirrorToRemoteMasterOrderedMap = graph.getLocalMirrorToRemoteMasterOrderedMap(nodeId); for (std::uint64_t i = 0ul; i < lift(localMirrorToRemoteMasterOrderedMap, size); i++) { @@ -104,7 +104,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { pando::GlobalRef>> localMasterToRemoteMirrorMap = graph.getLocalMasterToRemoteMirrorMap(nodeId); - for (std::int16_t fromId = 0; fromId < dims.node.id; fromId++) { + for (std::int64_t fromId = 0; fromId < dims.node.id; fromId++) { pando::GlobalRef> mapVectorFromHost = fmap(localMasterToRemoteMirrorMap, operator[], fromId); for (std::uint64_t i = 0ul; i < lift(mapVectorFromHost, size); i++) { diff --git a/test/python/test_MDLCSR_Reduce.cpp b/test/python/test_MDLCSR_Reduce.cpp index c25f0d58..e7ec13f5 100644 --- a/test/python/test_MDLCSR_Reduce.cpp +++ b/test/python/test_MDLCSR_Reduce.cpp @@ -104,7 +104,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { fmapVoid(mirrorBitSet, fill, true); barrier.done(); }; - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { PANDO_CHECK( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, barrier, graph.getMirrorBitSets())); @@ -113,7 +113,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { graph.reduce(TestFunc); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef> mirrorBitSet = graph.getMirrorBitSet(nodeId); pando::GlobalRef> localMirrorToRemoteMasterOrderedMap = graph.getLocalMirrorToRemoteMasterOrderedMap(nodeId); diff --git a/test/python/test_MDLCSR_Sync.cpp b/test/python/test_MDLCSR_Sync.cpp index 0dc6109b..8aa0ae83 100644 --- a/test/python/test_MDLCSR_Sync.cpp +++ b/test/python/test_MDLCSR_Sync.cpp @@ -104,14 +104,14 @@ void runTest(const char* elFile, std::uint64_t numVertices) { fmapVoid(mirrorBitSet, fill, true); barrier.done(); }; - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { PANDO_CHECK( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, barrier, graph.getMirrorBitSets())); } PANDO_CHECK(barrier.wait()); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef mirrorRange = graph.getMirrorRange(nodeId); for (Graph::VertexTopologyID mirrorTopologyID = *lift(mirrorRange, begin); mirrorTopologyID < *lift(mirrorRange, end); mirrorTopologyID++) { @@ -122,7 +122,7 @@ void runTest(const char* elFile, std::uint64_t numVertices) { graph.sync(TestFunc); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { pando::GlobalRef> mirrorBitSet = graph.getMirrorBitSet(nodeId); pando::GlobalRef> localMirrorToRemoteMasterOrderedMap = graph.getLocalMirrorToRemoteMasterOrderedMap(nodeId); diff --git a/test/sync/test_global_barrier.cpp b/test/sync/test_global_barrier.cpp index e29dfe89..c7b35d1b 100644 --- a/test/sync/test_global_barrier.cpp +++ b/test/sync/test_global_barrier.cpp @@ -92,14 +92,14 @@ TEST(GlobalBarrier, SingleWait) { array[pando::getCurrentPlace().node.id] = goodVal; gb.done(); }; - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { EXPECT_EQ( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, gb, array, goodVal), pando::Status::Success); } EXPECT_EQ(gb.wait(), pando::Status::Success); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { EXPECT_EQ(array[nodeId], goodVal); } gb.deinitialize(); @@ -124,7 +124,7 @@ TEST(GlobalBarrier, MultipleWait) { array[pando::getCurrentPlace().node.id] = goodVal; gb2.done(); }; - for (std::int16_t nodeId = 1; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 1; nodeId < dims.node.id; nodeId++) { EXPECT_EQ( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, gb1, gb2, array, goodVal), @@ -132,7 +132,7 @@ TEST(GlobalBarrier, MultipleWait) { } EXPECT_EQ(array[0], goodVal); - for (std::int16_t nodeId = 1; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 1; nodeId < dims.node.id; nodeId++) { EXPECT_EQ(array[nodeId], 0ul); } @@ -140,7 +140,7 @@ TEST(GlobalBarrier, MultipleWait) { gb2.done(); EXPECT_EQ(gb2.wait(), pando::Status::Success); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { EXPECT_EQ(array[nodeId], goodVal); } diff --git a/test/sync/test_wait_group.cpp b/test/sync/test_wait_group.cpp index b4ac6d8d..348038f0 100644 --- a/test/sync/test_wait_group.cpp +++ b/test/sync/test_wait_group.cpp @@ -90,14 +90,14 @@ TEST(WaitGroup, RemoteUsage) { ptr[pando::getCurrentPlace().node.id] = goodVal; wg.done(); }; - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { EXPECT_EQ( pando::executeOn(pando::Place{pando::NodeIndex{nodeId}, pando::anyPod, pando::anyCore}, func, wg.getHandle(), ptr, goodVal), pando::Status::Success); } EXPECT_EQ(wg.wait(), pando::Status::Success); - for (std::int16_t nodeId = 0; nodeId < dims.node.id; nodeId++) { + for (std::int64_t nodeId = 0; nodeId < dims.node.id; nodeId++) { EXPECT_EQ(*ptr, goodVal); } wg.deinitialize(); diff --git a/test/utility/test_dist_accumulator.cpp b/test/utility/test_dist_accumulator.cpp index efca0e72..215931e3 100644 --- a/test/utility/test_dist_accumulator.cpp +++ b/test/utility/test_dist_accumulator.cpp @@ -10,11 +10,11 @@ galois::DistArray getDistributedWorkArray(uint64_t workItemsPerHost) { galois::DistArray work{}; - int16_t pxns = pando::getPlaceDims().node.id; + int64_t pxns = pando::getPlaceDims().node.id; pando::Vector vec; EXPECT_EQ(vec.initialize(pxns), pando::Status::Success); - for (std::int16_t i = 0; i < pxns; i++) { + for (std::int64_t i = 0; i < pxns; i++) { vec[i] = galois::PlaceType{pando::Place{pando::NodeIndex{i}, pando::anyPod, pando::anyCore}, pando::MemoryType::Main}; }