5151#include " task.hpp"
5252#include " jacobi3d.hpp"
5353
54-
5554// Setting default values (globali)
5655size_t gDepth = 1 ;
5756size_t N = 128 ;
@@ -69,7 +68,7 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
6968
7069 // Attaching the main thread
7170 check (nosv_attach (&mainTask, NULL , NULL , NOSV_ATTACH_NONE));
72-
71+
7372 // Creating (local host) topology manager
7473 const auto topologyManager = HiCR::backend::hwloc::TopologyManager::createDefault ();
7574
@@ -101,36 +100,35 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
101100 // Assuming one process per numa domain
102101 // Looking for Domains that are not zero (Slurm non --exclusive issue)
103102 size_t numaDomainId;
104- for (size_t i = 0 ; i < numaDomains.size (); ++i)
103+ for (size_t i = 0 ; i < numaDomains.size (); ++i)
105104 {
106105 numaDomainId = (myInstanceId + i) % numaDomains.size ();
107- if (numaDomains[numaDomainId]->getComputeResourceList ().size () > 0 )
108- {
109- break ;
110- }
106+ if (numaDomains[numaDomainId]->getComputeResourceList ().size () > 0 ) { break ; }
111107 }
112108
113- auto numaDomain = numaDomains[numaDomainId];
109+ auto numaDomain = numaDomains[numaDomainId];
114110 printf (" Instance %lu - Using NUMA domain: %lu\n " , myInstanceId, numaDomainId);
115111
116112 // Updating the compute resource list
117113 auto computeResources = numaDomain->getComputeResourceList ();
118114
119115 // Compute resources to use
120116 HiCR::Device::computeResourceList_t cr;
121- int size;
122- MPI_Comm_size ( MPI_COMM_WORLD, &size);
117+ int size;
118+ MPI_Comm_size (MPI_COMM_WORLD, &size);
123119
124120 // for(size_t i = 0; i < (size_t)(lt.x * lt.y * lt.z); i++)
125121 // {
126122 // cr.push_back(computeResources[(2+i)%(computeResources.size())]); //21,43,65,87 are broken for nOS-V
127123 // }
128124
129125 // cr.push_back(numaDomains[0]->getComputeResourceList()[0]);
130-
131- for (int i = 0 ; i < size; ++i) {
132- if (myInstanceId == (size_t )i) {
133- auto itr = computeResources.begin ();
126+
127+ for (int i = 0 ; i < size; ++i)
128+ {
129+ if (myInstanceId == (size_t )i)
130+ {
131+ auto itr = computeResources.begin ();
134132 for (size_t i = 0 ; i < computeResources.size (); i++)
135133 {
136134 // Getting up-casted pointer for the processing unit
@@ -142,15 +140,17 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
142140 // Getting the logical processor ID of the compute resource
143141 auto pid = c->getProcessorId ();
144142
145- if (pid != 21 && pid != 43 && pid != 65 && pid != 87 )
143+ if (pid != 21 && pid != 43 && pid != 65 && pid != 87 )
146144 {
147- printf (" %u " , pid); fflush (stdout);
148-
145+ printf (" %u " , pid);
146+ fflush (stdout);
147+
149148 cr.push_back (*itr);
150149 }
151150 itr++;
152151 }
153- printf (" ]\n " ); fflush (stdout);
152+ printf (" ]\n " );
153+ fflush (stdout);
154154 }
155155 MPI_Barrier (MPI_COMM_WORLD);
156156 }
@@ -189,7 +189,6 @@ void jacobiDriver(HiCR::InstanceManager *instanceManager, HiCR::CommunicationMan
189189 // check(nosv_shutdown());
190190}
191191
192-
193192#ifdef _TASKR_DISTRIBUTED_ENGINE_LPF
194193
195194// flag needed when using MPI to launch
@@ -230,21 +229,17 @@ void spmd(lpf_t lpf, lpf_pid_t pid, lpf_pid_t nprocs, lpf_args_t args)
230229
231230 // Creating memory and communication managers
232231 std::unique_ptr<HiCR::CommunicationManager> communicationManager = std::make_unique<HiCR::backend::lpf::CommunicationManager>(nprocs, pid, lpf);
233- std::unique_ptr<HiCR::MemoryManager> memoryManager = std::make_unique<HiCR::backend::lpf::MemoryManager>(lpf);
232+ std::unique_ptr<HiCR::MemoryManager> memoryManager = std::make_unique<HiCR::backend::lpf::MemoryManager>(lpf);
234233
235234 // Running the remote memcpy example
236235 jacobiDriver (instanceManager, communicationManager.get (), memoryManager.get ());
237236}
238237#endif
239238
240-
241239int main (int argc, char *argv[])
242240{
243-
244-
245241 // // Instantiating distributed execution machinery
246242
247-
248243#ifdef _TASKR_DISTRIBUTED_ENGINE_LPF
249244 // Initializing instance manager
250245 auto im = HiCR::backend::mpi::InstanceManager::createDefault (&argc, &argv);
@@ -263,7 +258,6 @@ int main(int argc, char *argv[])
263258 if (!strcmp (argv[i], " -i" )) nIters = atoi (argv[++i]);
264259 }
265260
266-
267261 lpf_init_t init;
268262 lpf_args_t args;
269263
0 commit comments