@@ -108,25 +108,39 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
108108
109109 // Compute resources to use
110110 HiCR::Device::computeResourceList_t cr;
111+ int size;
112+ MPI_Comm_size ( MPI_COMM_WORLD , &size);
111113
112- // Adding it to the list
113- // auto itr = computeResources.begin();
114- // for (size_t i = 0; i < 2ul; i++)
115- // {
116- // // Getting up-casted pointer for the processing unit
117- // auto c = dynamic_pointer_cast<HiCR::backend::hwloc::ComputeResource>(*itr);
118-
119- // // Checking whether the execution unit passed is compatible with this backend
120- // if (c == nullptr) HICR_THROW_LOGIC("The passed compute resource is not supported by this processing unit type\n");
121-
122- // // Getting the logical processor ID of the compute resource
123- // auto pid = c->getProcessorId();
124-
125- // printf("numaDomainId: %lu has PID: %u\n", numaDomainId, pid); fflush(stdout);
126- // cr.push_back(*itr);
127- // itr++;
128- // }
114+ for (size_t i = 0 ; i < (size_t )(lt.x * lt.y * lt.z ); i++)
115+ {
116+ cr.push_back (computeResources[(myInstanceId*size+i)%(computeResources.size ())]);
117+ }
129118
119+ // cr.push_back(numaDomains[0]->getComputeResourceList()[0]);
120+
121+ for (int i = 0 ; i < size; ++i) {
122+ if (myInstanceId == (size_t )i) {
123+ auto itr = cr.begin ();
124+ for (size_t i = 0 ; i < cr.size (); i++)
125+ {
126+ // Getting up-casted pointer for the processing unit
127+ auto c = dynamic_pointer_cast<HiCR::backend::hwloc::ComputeResource>(*itr);
128+
129+ // Checking whether the execution unit passed is compatible with this backend
130+ if (c == nullptr ) HICR_THROW_LOGIC (" The passed compute resource is not supported by this processing unit type\n " );
131+
132+ // Getting the logical processor ID of the compute resource
133+ auto pid = c->getProcessorId ();
134+
135+ printf (" %u " , pid); fflush (stdout);
136+
137+ itr++;
138+ // cr.push_back(*itr);
139+ }
140+ printf (" ]\n " ); fflush (stdout);
141+ }
142+ MPI_Barrier (MPI_COMM_WORLD );
143+ }
130144 // printf("PUs Per NUMA Domain: %lu\n", computeResources.size());
131145
132146 // Initializing nosv-based compute manager to run tasks in parallel
0 commit comments