Skip to content

Commit 9806409

Browse files
author
Noah Baumann
committed
more prints for debugging
1 parent 1d7e130 commit 9806409

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

examples/jacobi3d/source/pthreads.cpp

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,40 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
9393

9494
// Updating the compute resource list
9595
auto computeResources = numaDomain->getComputeResourceList();
96-
printf("PUs Per NUMA Domain: %lu\n", computeResources.size());
96+
printf("NUMA Domain %lu: #PUs %lu and has PID [", numaDomainId, computeResources.size());
97+
98+
99+
for (size_t i = 0; i < 4; ++i) {
100+
if (myInstanceId == i) {
101+
auto itr = computeResources.begin();
102+
for (size_t i = 0; i < computeResources.size(); i++)
103+
{
104+
// Getting up-casted pointer for the processing unit
105+
auto c = dynamic_pointer_cast<HiCR::backend::hwloc::ComputeResource>(*itr);
106+
107+
// Checking whether the execution unit passed is compatible with this backend
108+
if (c == nullptr) HICR_THROW_LOGIC("The passed compute resource is not supported by this processing unit type\n");
109+
110+
// Getting the logical processor ID of the compute resource
111+
auto pid = c->getProcessorId();
112+
113+
printf("%u ", pid); fflush(stdout);
114+
115+
itr++;
116+
// cr.push_back(*itr);
117+
}
118+
printf("]\n"); fflush(stdout);
119+
}
120+
MPI_Barrier(MPI_COMM_WORLD);
121+
}
97122

98123
// Compute resources to use
99-
HiCR::Device::computeResourceList_t cr;
124+
// HiCR::Device::computeResourceList_t cr;
125+
126+
// for(size_t i = 0; i < (size_t)(lt.x * lt.y * lt.z); i++)
127+
// {
128+
// cr.push_back(computeResources[(myInstanceId+i)%(computeResources.size())]);
129+
// }
100130

101131
// Adding it to the list
102132
// auto itr = computeResources.begin();
@@ -158,14 +188,14 @@ const int LPF_MPI_AUTO_INITIALIZE = 0;
158188
* in lpf_resize_memory_register . This value is currently
159189
* guessed as sufficiently large for a program
160190
*/
161-
#define DEFAULT_MEMSLOTS 10000
191+
#define DEFAULT_MEMSLOTS 100000
162192

163193
/**
164194
* #DEFAULT_MSGSLOTS The message slots used by LPF
165195
* in lpf_resize_message_queue . This value is currently
166196
* guessed as sufficiently large for a program
167197
*/
168-
#define DEFAULT_MSGSLOTS 10000
198+
#define DEFAULT_MSGSLOTS 100000
169199

170200
// Global pointer to the
171201
HiCR::InstanceManager *instanceManager;

0 commit comments

Comments
 (0)