From 723ccbaa0141d2c5de3b5acdf7e8fb8f1b49cd25 Mon Sep 17 00:00:00 2001 From: AdityaAtulTewari Date: Mon, 13 May 2024 18:28:23 +0000 Subject: [PATCH 1/2] Updated for node index --- examples/benchmark_pointer.cpp | 151 ++++++++++++++++-- .../include/pando-rt/benchmark/counters.hpp | 82 ++++++++++ pando-rt/include/pando-rt/index.hpp | 4 +- .../pando-rt/memory/address_translation.hpp | 2 +- pando-rt/src/prep/nodes.cpp | 8 +- 5 files changed, 223 insertions(+), 24 deletions(-) create mode 100644 pando-rt/include/pando-rt/benchmark/counters.hpp diff --git a/examples/benchmark_pointer.cpp b/examples/benchmark_pointer.cpp index 2d059a7e..3c4a1631 100644 --- a/examples/benchmark_pointer.cpp +++ b/examples/benchmark_pointer.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -15,59 +16,175 @@ * This benchmarks various types of pointer dereferences */ +std::uint64_t currentLocation = 100; +std::uint64_t nodeDims = 100; + +template +struct CacheRef { + pando::GlobalPtr globalPtr; + std::uint64_t cacheLoc; + T* cachePtr; + +private: + bool tryToCache() { + if (cacheLoc == nodeDims) { + std::uint64_t nodeIndex = pando::extractNodeIndex(globalPtr.address).id; + if (currentLocation == nodeIndex) { + cacheLoc = nodeIndex; + cachePtr = globalPtr.operator->(); + return true; + } + } + return false; + } + +public: + operator T() const { + if (cacheLoc == currentLocation || tryToCache()) { + return *cachePtr; + } else { + return *globalPtr; + } + } + + CacheRef operator=(const T& value) { + if (cacheLoc == currentLocation || tryToCache()) { + *cachePtr = value; + } else { + *globalPtr = value; + } + return this; + } + template + CacheRef operator+=(const U& y) { + if (cacheLoc == currentLocation || tryToCache()) { + *cachePtr += y; + } else { + *globalPtr += y; + } + return *this; + } +}; + +template +struct CachePtr { + CacheRef ref; + + CacheRef operator*() { + return ref; + } +}; + void printUsageExit(char* argv0) { - std::cerr << "Usage: " << argv0 << " -n numAccesses" << std::endl; + std::cerr << "Usage: " << argv0 << " -n numAccesses [-r] [-g] [-c]" << std::endl; std::exit(EXIT_FAILURE); } +enum POINTER : std::uint64_t { REGULAR = 0x1 << 0, GLOBALPTR = 0x1 << 1, CACHEPTR = 0x1 << 2 }; + int pandoMain(int argc, char** argv) { auto thisPlace = pando::getCurrentPlace(); + currentLocation = thisPlace.node.id; + nodeDims = pando::getNodeDims().id; if (thisPlace.node.id == 0) { galois::HostLocalStorageHeap::HeapInit(); galois::PodLocalStorageHeap::HeapInit(); optind = 0; std::uint64_t numAccesses = 0; + std::uint64_t ptrTypes = 0; int opt; - while ((opt = getopt(argc, argv, "n:s:f:dm")) != -1) { + while ((opt = getopt(argc, argv, "n:rgc")) != -1) { switch (opt) { case 'n': numAccesses = strtoull(optarg, nullptr, 10); break; + case 'r': + ptrTypes |= REGULAR; + break; + case 'g': + ptrTypes |= GLOBALPTR; + break; + case 'c': + ptrTypes |= CACHEPTR; + break; default: printUsageExit(argv[0]); } } + // Checks + if (numAccesses == 0) { + printUsageExit(argv[0]); + } + if (ptrTypes == 0) { + printUsageExit(argv[0]); + } + + // Initialize Regular std::uint64_t* ptr = (std::uint64_t*)malloc(sizeof(std::uint64_t)); + + // Initialize GlobalPtr pando::GlobalPtr gptr; pando::LocalStorageGuard gptrGuard(gptr, 1); + // Initialize CachePtr + CachePtr cptr; + pando::LocalStorageGuard cptrGuard(cptr.ref.globalPtr, 1); + cptr.ref.cacheLoc = nodeDims; + std::array simpleArr; for (std::uint64_t i = 0; i < simpleArr.size(); i++) { simpleArr[i] = i; } - *ptr = 0; - auto normalBegin = std::chrono::high_resolution_clock::now(); - for (std::uint64_t i = 0; i < numAccesses; i++) { - *ptr += simpleArr[i % simpleArr.size()]; + std::chrono::time_point normalBegin, normalEnd; + std::chrono::time_point gptrBegin, gptrEnd; + std::chrono::time_point cptrBegin, cptrEnd; + if (ptrTypes & REGULAR) { + *ptr = 0; + normalBegin = std::chrono::high_resolution_clock::now(); + for (std::uint64_t i = 0; i < numAccesses; i++) { + *ptr += simpleArr[i % simpleArr.size()]; + } + normalEnd = std::chrono::high_resolution_clock::now(); } - auto normalEnd = std::chrono::high_resolution_clock::now(); - *gptr = 0; - auto gptrBegin = std::chrono::high_resolution_clock::now(); - for (std::uint64_t i = 0; i < numAccesses; i++) { - *gptr += simpleArr[i % simpleArr.size()]; + + if (ptrTypes & GLOBALPTR) { + *gptr = 0; + gptrBegin = std::chrono::high_resolution_clock::now(); + for (std::uint64_t i = 0; i < numAccesses; i++) { + *gptr += simpleArr[i % simpleArr.size()]; + } + gptrEnd = std::chrono::high_resolution_clock::now(); } - auto gptrEnd = std::chrono::high_resolution_clock::now(); + if (ptrTypes & CACHEPTR) { + *gptr = 0; + cptrBegin = std::chrono::high_resolution_clock::now(); + for (std::uint64_t i = 0; i < numAccesses; i++) { + *cptr += simpleArr[i % simpleArr.size()]; + } + cptrEnd = std::chrono::high_resolution_clock::now(); + } - std::cout << "Normal Pointer took: " - << std::chrono::duration_cast(normalEnd - normalBegin) - << "\n Global Pointer took: " - << std::chrono::duration_cast(gptrEnd - gptrBegin) - << std::endl; + if (ptrTypes & REGULAR) { + std::cout << "Normal Pointer took: " + << std::chrono::duration_cast(normalEnd - normalBegin) + << "\n"; + } + if (ptrTypes & GLOBALPTR) { + std::cout << "Global Pointer took: " + << std::chrono::duration_cast(gptrEnd - gptrBegin) + << "\n"; + } + if (ptrTypes & CACHEPTR) { + std::cout << "Cache Pointer took: " + << std::chrono::duration_cast(cptrEnd - cptrBegin) + << "\n"; + } + std::cout << std::flush; } pando::waitAll(); return 0; diff --git a/pando-rt/include/pando-rt/benchmark/counters.hpp b/pando-rt/include/pando-rt/benchmark/counters.hpp new file mode 100644 index 00000000..1b079078 --- /dev/null +++ b/pando-rt/include/pando-rt/benchmark/counters.hpp @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2023. University of Texas at Austin. All rights reserved. + +#ifndef PANDO_RT_BENCHMARK_COUNTERS_HPP_ +#define PANDO_RT_BENCHMARK_COUNTERS_HPP_ + +#include +#include +#include + +#include + + +template +struct Record { + std::array counts; + + constexpr Record() { + for(auto& count : counts) { + count = T(); + } + } + + Record(Record&) = delete; + Record& operator=(Record&) = delete; + Record(Record&&) = default; + Record& operator=(Record&&) = default; + + void reset () { + for(auto& count : counts) { + count = T(); + } + } + + template + void record(A val, F func, bool isOnCP, + decltype(pando::getCurrentPlace().core.x) corex, + decltype(pando::getCurrentPlace().core.x) coreDims) { + std::uint64_t idx = isOnCP ? coreDims + 1 : corex; + counts[idx] += func(val); + } + + template + void record(A val, F func) { + auto thisPlace = pando::getCurrentPlace(); + auto coreDims = pando::getCoreDims(); + record(val, func, pando::isOnCP(), thisPlace.core.x, coreDims.x); + } + + T& get(std::uint64_t i) { + return counts[i]; + } +}; + +struct HighResolutionCount { + std::chrono::time_point begin; + + inline void start() { + begin = std::chrono::high_resolution_clock::now(); + } + + inline std::chrono::nanoseconds stop() const noexcept{ + auto stop = std::chrono::high_resolution_clock::now(); + return std::chrono::duration_cast(stop - begin); + } + + inline static void recordHighResolutionEvent(Record& r, + HighResolutionCount c, bool isOnCP, + decltype(pando::getCurrentPlace().core.x) corex, + decltype(pando::getCurrentPlace().core.x) coreDims) { + r.record(c, [](const HighResolutionCount& c) { + return c.stop().count(); + }, isOnCP, corex, coreDims); + } + + inline static void recordHighResolutionEvent(Record& r, HighResolutionCount c) { + r.record(c, [](const HighResolutionCount& c){ + return c.stop().count(); + }); + } +}; +#endif diff --git a/pando-rt/include/pando-rt/index.hpp b/pando-rt/include/pando-rt/index.hpp index 055fd912..2bd19512 100644 --- a/pando-rt/include/pando-rt/index.hpp +++ b/pando-rt/include/pando-rt/index.hpp @@ -17,11 +17,11 @@ namespace pando { * @ingroup ROOT */ struct NodeIndex { - std::int16_t id{}; + std::int64_t id{}; constexpr NodeIndex() noexcept = default; - constexpr explicit NodeIndex(std::int16_t id) noexcept : id{id} {} + constexpr explicit NodeIndex(std::int64_t id) noexcept : id{id} {} }; /** diff --git a/pando-rt/include/pando-rt/memory/address_translation.hpp b/pando-rt/include/pando-rt/memory/address_translation.hpp index 1218923d..8fd43238 100644 --- a/pando-rt/include/pando-rt/memory/address_translation.hpp +++ b/pando-rt/include/pando-rt/memory/address_translation.hpp @@ -58,7 +58,7 @@ inline MemoryType extractMemoryType(GlobalAddress addr) noexcept { */ inline NodeIndex extractNodeIndex(GlobalAddress addr) noexcept { #if defined(PANDO_RT_USE_BACKEND_PREP) - return NodeIndex{std::int16_t(readBits(addr, addressMap.main.nodeIndex))}; + return NodeIndex{std::int64_t(readBits(addr, addressMap.main.nodeIndex))}; #elif defined(PANDO_RT_USE_BACKEND_DRVX) DrvAPI::DrvAPIVAddress vaddr = addr; return NodeIndex(vaddr.pxn()); diff --git a/pando-rt/src/prep/nodes.cpp b/pando-rt/src/prep/nodes.cpp index 4aa6d0c3..6fb55858 100644 --- a/pando-rt/src/prep/nodes.cpp +++ b/pando-rt/src/prep/nodes.cpp @@ -140,8 +140,8 @@ void handleValueAck(gex_Token_t, void*, size_t, gex_AM_Arg_t handlePtrHi, gex_AM // System wide GASNet client struct { std::string_view clientName = "pando-rt"; - gex_Rank_t rank{GEX_RANK_INVALID}; - gex_Rank_t size{GEX_RANK_INVALID}; + std::int64_t rank{GEX_RANK_INVALID}; + std::int64_t size{GEX_RANK_INVALID}; gex_Client_t client{GEX_CLIENT_INVALID}; gex_EP_t endpoint{GEX_EP_INVALID}; gex_TM_t team{GEX_TM_INVALID}; @@ -593,11 +593,11 @@ void Nodes::exit(int errorCode) { } NodeIndex Nodes::getCurrentNode() noexcept { - return NodeIndex{std::int16_t(world.rank)}; + return NodeIndex(world.rank); } NodeIndex Nodes::getNodeDims() noexcept { - return NodeIndex{std::int16_t(world.size)}; + return NodeIndex(world.size); } Status Nodes::requestAcquire(NodeIndex nodeIdx, std::size_t requestSize, void** p, From 96a5773ce4475b6c5b2e6215a10950c20e228c69 Mon Sep 17 00:00:00 2001 From: AdityaAtulTewari Date: Mon, 13 May 2024 19:12:11 +0000 Subject: [PATCH 2/2] Update examples to match --- pando-rt/examples/gups.cpp | 2 +- pando-rt/examples/gups_no_tasks.cpp | 2 +- pando-rt/examples/helloworld.cpp | 6 +++--- pando-rt/examples/memory_resource.cpp | 2 +- pando-rt/examples/multi_pxns/allcores_reduce_values.cpp | 2 +- .../examples/multi_pxns/allcores_reducebroadcast_values.cpp | 2 +- .../examples/multi_pxns/onecore_perpxn_reduce_values.cpp | 2 +- .../multi_pxns/onecore_perpxn_reducebroadcast_values.cpp | 4 ++-- .../multi_pxns/onecore_scatter_diffdim_arrays_values.cpp | 2 +- .../multi_pxns/onecore_scatter_samedim_arrays_values.cpp | 2 +- pando-rt/examples/single_pxn/onecore_increment_value.cpp | 2 +- pando-rt/examples/single_pxn/onecore_scatter_values.cpp | 2 +- pando-rt/examples/single_pxn/pass_value_in_allcores.cpp | 4 ++-- pando-rt/examples/single_pxn/pass_value_in_twocores.cpp | 4 ++-- pando-rt/examples/single_pxn/serial_tasks.cpp | 2 +- pando-rt/examples/single_pxn/twocores_scatter_values.cpp | 2 +- pando-rt/examples/stack_sizes.cpp | 4 ++-- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pando-rt/examples/gups.cpp b/pando-rt/examples/gups.cpp index 6afa2d51..2bf0883d 100644 --- a/pando-rt/examples/gups.cpp +++ b/pando-rt/examples/gups.cpp @@ -38,7 +38,7 @@ int pandoMain(int argc, char** argv) { const auto thisPlace = pando::getCurrentPlace(); const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); const auto tableByteCount = tableSize * sizeof(std::int64_t); diff --git a/pando-rt/examples/gups_no_tasks.cpp b/pando-rt/examples/gups_no_tasks.cpp index ec10e09e..6bec6761 100644 --- a/pando-rt/examples/gups_no_tasks.cpp +++ b/pando-rt/examples/gups_no_tasks.cpp @@ -39,7 +39,7 @@ int pandoMain(int argc, char** argv) { std::printf("Table size per node: %lu, updates / thread: %lu\n", tableSize, threadUpdates); const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); const auto tableByteCount = tableSize * sizeof(std::int64_t); diff --git a/pando-rt/examples/helloworld.cpp b/pando-rt/examples/helloworld.cpp index 954076fc..cb7722c9 100644 --- a/pando-rt/examples/helloworld.cpp +++ b/pando-rt/examples/helloworld.cpp @@ -15,7 +15,7 @@ void greetings(int level) { PANDO_CHECK(pando::executeOn(otherPlace, &greetings, level + 1)); } - std::printf("%s/%i: Hello from node %i, pod x=%i,y=%i, core x=%i,y=%i\n", __func__, level, + std::printf("%s/%i: Hello from node %li, pod x=%i,y=%i, core x=%i,y=%i\n", __func__, level, thisPlace.node.id, thisPlace.pod.x, thisPlace.pod.y, thisPlace.core.x, thisPlace.core.y); } @@ -30,14 +30,14 @@ void nodeGreetings(int level) { PANDO_CHECK( pando::executeOn(pando::Place{rightNode, {}, pando::anyCore}, &nodeGreetings, level + 1)); } - std::printf("%s/%i: Hello from node %i, pod x=%i,y=%i, core x=%i,y=%i\n", __func__, level, + std::printf("%s/%i: Hello from node %li, pod x=%i,y=%i, core x=%i,y=%i\n", __func__, level, thisPlace.node.id, thisPlace.pod.x, thisPlace.pod.y, thisPlace.core.x, thisPlace.core.y); } int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); const auto thisPlace = pando::getCurrentPlace(); diff --git a/pando-rt/examples/memory_resource.cpp b/pando-rt/examples/memory_resource.cpp index 909ba219..c7ed63fb 100644 --- a/pando-rt/examples/memory_resource.cpp +++ b/pando-rt/examples/memory_resource.cpp @@ -18,7 +18,7 @@ void allocate() { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); const auto thisPlace = pando::getCurrentPlace(); diff --git a/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp b/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp index 5d47002f..3c5ff2e4 100644 --- a/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp +++ b/pando-rt/examples/multi_pxns/allcores_reduce_values.cpp @@ -186,7 +186,7 @@ void correctnessCheck(pando::GlobalPtr> output, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp b/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp index 1910e2f0..6b97dd98 100644 --- a/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp +++ b/pando-rt/examples/multi_pxns/allcores_reducebroadcast_values.cpp @@ -233,7 +233,7 @@ void correctnessCheck(pando::GlobalPtr> output, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { 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 6ac22522..70f3c4e0 100644 --- a/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_perpxn_reduce_values.cpp @@ -144,7 +144,7 @@ void correctnessCheck(pando::GlobalPtr> output, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { 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 be9a1284..ec9cc6d3 100644 --- a/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp +++ b/pando-rt/examples/multi_pxns/onecore_perpxn_reducebroadcast_values.cpp @@ -169,7 +169,7 @@ void correctnessCheck(pando::GlobalPtr> output, for (std::int32_t c = 0; c < numCoresPerNode; ++c) { std::int16_t ownerPXN = (c % placeDims.node.id); if (localArray[c] != std::int64_t{ownerPXN * (placeDims.node.id - 1) + 1}) { - std::printf("%i %i %li\n", pando::getCurrentPlace().node.id, c, (int64_t)localArray[c]); + std::printf("%li %i %li\n", pando::getCurrentPlace().node.id, c, (int64_t)localArray[c]); check_correctness = false; } } @@ -183,7 +183,7 @@ void correctnessCheck(pando::GlobalPtr> output, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { 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 c9af5996..58351503 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 @@ -90,7 +90,7 @@ void waitUntil(pando::GlobalPtr dones, std::int16_t numNodes) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { 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 45c9c2d4..af95ce54 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 @@ -89,7 +89,7 @@ void waitUntil(pando::GlobalPtr dones, std::int16_t numNodes) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i).\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i).\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/single_pxn/onecore_increment_value.cpp b/pando-rt/examples/single_pxn/onecore_increment_value.cpp index 4562ee60..5e58d8fe 100644 --- a/pando-rt/examples/single_pxn/onecore_increment_value.cpp +++ b/pando-rt/examples/single_pxn/onecore_increment_value.cpp @@ -21,7 +21,7 @@ void increase(std::int64_t v) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); const auto thisPlace = pando::getCurrentPlace(); diff --git a/pando-rt/examples/single_pxn/onecore_scatter_values.cpp b/pando-rt/examples/single_pxn/onecore_scatter_values.cpp index 1890411d..e3ee6b58 100644 --- a/pando-rt/examples/single_pxn/onecore_scatter_values.cpp +++ b/pando-rt/examples/single_pxn/onecore_scatter_values.cpp @@ -74,7 +74,7 @@ void correctnessCheck(pando::GlobalPtr output) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/single_pxn/pass_value_in_allcores.cpp b/pando-rt/examples/single_pxn/pass_value_in_allcores.cpp index 91a14b7e..c04e7de0 100644 --- a/pando-rt/examples/single_pxn/pass_value_in_allcores.cpp +++ b/pando-rt/examples/single_pxn/pass_value_in_allcores.cpp @@ -19,7 +19,7 @@ constexpr std::int64_t solution{5}; void readValue(pando::GlobalPtr sharedValue, pando::GlobalPtr checkSolution) { if (*sharedValue == solution) { auto thisPlace = pando::getCurrentPlace(); - std::printf("[node %i, pod x=%i,y=%i, core x=%i,y=%i] read value: %li\n", thisPlace.node.id, + std::printf("[node %li, pod x=%i,y=%i, core x=%i,y=%i] read value: %li\n", thisPlace.node.id, thisPlace.pod.x, thisPlace.pod.y, thisPlace.core.x, thisPlace.core.y, static_cast(*sharedValue)); (*checkSolution) = true; @@ -49,7 +49,7 @@ void incrementValue(pando::GlobalPtr sharedValue, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/single_pxn/pass_value_in_twocores.cpp b/pando-rt/examples/single_pxn/pass_value_in_twocores.cpp index 473d4d74..033b48e7 100644 --- a/pando-rt/examples/single_pxn/pass_value_in_twocores.cpp +++ b/pando-rt/examples/single_pxn/pass_value_in_twocores.cpp @@ -18,7 +18,7 @@ constexpr std::int64_t solution{5}; void readValue(pando::GlobalPtr sharedValue) { if (*sharedValue == solution) { auto thisPlace = pando::getCurrentPlace(); - std::printf("[node %i, pod x=%i,y=%i, core x=%i,y=%i] read value: %li\n", thisPlace.node.id, + std::printf("[node %li, pod x=%i,y=%i, core x=%i,y=%i] read value: %li\n", thisPlace.node.id, thisPlace.pod.x, thisPlace.pod.y, thisPlace.core.x, thisPlace.core.y, static_cast(*sharedValue)); } @@ -46,7 +46,7 @@ void incrementValue(pando::GlobalPtr sharedValue) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/single_pxn/serial_tasks.cpp b/pando-rt/examples/single_pxn/serial_tasks.cpp index d63e9e8b..7859e71b 100644 --- a/pando-rt/examples/single_pxn/serial_tasks.cpp +++ b/pando-rt/examples/single_pxn/serial_tasks.cpp @@ -20,7 +20,7 @@ void incrementValue(pando::GlobalPtr sharedValue, int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x == 0 || placeDims.core.y == 0) { diff --git a/pando-rt/examples/single_pxn/twocores_scatter_values.cpp b/pando-rt/examples/single_pxn/twocores_scatter_values.cpp index a41156e2..d1c4c6b9 100644 --- a/pando-rt/examples/single_pxn/twocores_scatter_values.cpp +++ b/pando-rt/examples/single_pxn/twocores_scatter_values.cpp @@ -97,7 +97,7 @@ void correctnessCheck(pando::GlobalPtr output) { int pandoMain(int, char**) { const auto placeDims = pando::getPlaceDims(); - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); if (placeDims.core.x * placeDims.core.y < 2) { diff --git a/pando-rt/examples/stack_sizes.cpp b/pando-rt/examples/stack_sizes.cpp index 2912a630..98c7c1c3 100644 --- a/pando-rt/examples/stack_sizes.cpp +++ b/pando-rt/examples/stack_sizes.cpp @@ -9,7 +9,7 @@ do { \ const auto stackUsage = pando::getThreadStackSize() - pando::getThreadAvailableStack(); \ std::printf( \ - "%s: Node %i, pod x=%i,y=%i, core x=%i,y=%i, total stack(bytes): %lu, used stack(bytes): " \ + "%s: Node %li, pod x=%i,y=%i, core x=%i,y=%i, total stack(bytes): %lu, used stack(bytes): " \ "%lu, available stack(bytes): %lu\n", \ (message), (place).node.id, (place).pod.x, (place).pod.y, (place).core.x, (place).core.y, \ pando::getThreadStackSize(), stackUsage, pando::getThreadAvailableStack()); \ @@ -48,7 +48,7 @@ int pandoMain(int, char**) { const auto& thisPlace = pando::getCurrentPlace(); const auto& placeDims = pando::getPlaceDims(); if (thisPlace.node == pando::NodeIndex(0)) { - std::printf("Configuration (nodes, pods, cores): (%i), (%i,%i), (%i,%i)\n", placeDims.node.id, + std::printf("Configuration (nodes, pods, cores): (%li), (%i,%i), (%i,%i)\n", placeDims.node.id, placeDims.pod.x, placeDims.pod.y, placeDims.core.x, placeDims.core.y); }