Skip to content

Commit

Permalink
Update examples to match
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaAtulTewari committed May 13, 2024
1 parent 723ccba commit 96a5773
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pando-rt/examples/gups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/gups_no_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions pando-rt/examples/helloworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/memory_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/multi_pxns/allcores_reduce_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void correctnessCheck(pando::GlobalPtr<pando::GlobalPtr<std::int64_t>> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void correctnessCheck(pando::GlobalPtr<pando::GlobalPtr<std::int64_t>> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void correctnessCheck(pando::GlobalPtr<pando::GlobalPtr<std::int64_t>> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void correctnessCheck(pando::GlobalPtr<pando::GlobalPtr<std::int64_t>> 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;
}
}
Expand All @@ -183,7 +183,7 @@ void correctnessCheck(pando::GlobalPtr<pando::GlobalPtr<std::int64_t>> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void waitUntil(pando::GlobalPtr<bool> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void waitUntil(pando::GlobalPtr<bool> 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) {
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/single_pxn/onecore_increment_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/single_pxn/onecore_scatter_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void correctnessCheck(pando::GlobalPtr<std::int64_t> 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) {
Expand Down
4 changes: 2 additions & 2 deletions pando-rt/examples/single_pxn/pass_value_in_allcores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ constexpr std::int64_t solution{5};
void readValue(pando::GlobalPtr<std::int64_t> sharedValue, pando::GlobalPtr<bool> 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<std::int64_t>(*sharedValue));
(*checkSolution) = true;
Expand Down Expand Up @@ -49,7 +49,7 @@ void incrementValue(pando::GlobalPtr<std::int64_t> 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) {
Expand Down
4 changes: 2 additions & 2 deletions pando-rt/examples/single_pxn/pass_value_in_twocores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ constexpr std::int64_t solution{5};
void readValue(pando::GlobalPtr<std::int64_t> 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<std::int64_t>(*sharedValue));
}
Expand Down Expand Up @@ -46,7 +46,7 @@ void incrementValue(pando::GlobalPtr<std::int64_t> 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) {
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/single_pxn/serial_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void incrementValue(pando::GlobalPtr<std::int16_t> 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) {
Expand Down
2 changes: 1 addition & 1 deletion pando-rt/examples/single_pxn/twocores_scatter_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void correctnessCheck(pando::GlobalPtr<std::int64_t> 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) {
Expand Down
4 changes: 2 additions & 2 deletions pando-rt/examples/stack_sizes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()); \
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 96a5773

Please sign in to comment.