Add CmiInitCPUTopology to Converse programs to initialize topology 78/3478/6
authorNitin Bhat <nbhat4@illinois.edu>
Wed, 3 Jan 2018 21:22:31 +0000 (13:22 -0800)
committerNitin Bhat <nbhat4@illinois.edu>
Mon, 26 Feb 2018 16:14:21 +0000 (10:14 -0600)
Change-Id: I0b808795033e730f1089a3fdf07cb89f04cd72d7

examples/converse/pingpong/pingpong.C
examples/converse/pingpong_multi/pingpong.C
src/conv-core/converse.h
tests/converse/commbench/commbench.c
tests/converse/machinetest/multiping.C
tests/converse/machinetest/pingall.C
tests/converse/megacon/megacon.c

index 6706819dfd6ea253caa7b0e3d7688de900d66a9d..8adb09c6ff02f7082b2a04f1bcb94c31c1c090d8 100644 (file)
@@ -161,6 +161,10 @@ CmiStartFn mymain(int argc, char *argv[])
 
   // Set runtime cpuaffinity
   CmiInitCPUAffinity(argv);
+
+  // Initialize CPU topology
+  CmiInitCPUTopology(argv);
+
   // Update the argc after runtime parameters are extracted out
   argc = CmiGetArgc(argv);
   if(argc == 5){
index 66cd5b530bf532788b46e92e1397175449ef535e..f8870c7411c864e7a2f62b51685baeb5864d0bb1 100644 (file)
@@ -153,11 +153,17 @@ CmiHandler node1HandlerFunc(Message *msg)
 
 
 //Converse main. Initialize variables and register handlers
-CmiStartFn mymain()
+CmiStartFn mymain(int argc, char *argv[])
 {
     CpvInitialize(int,msgSize);
     CpvInitialize(int,cycleNum);
     
+    // Set runtime cpuaffinity
+    CmiInitCPUAffinity(argv);
+
+    // Initialize CPU topology
+    CmiInitCPUTopology(argv);
+
     CpvAccess(msgSize)= 4 + CmiMsgHeaderSizeBytes;
     
     CpvInitialize(int,exitHandler);
index 7735ddf9d3deebc4ea89eefcbf4061aba4a631c2..4d4f00f536a405d912e27b89608b0f4ecb0178ad 100644 (file)
@@ -629,6 +629,7 @@ extern int CmiPhysicalRank(int pe);
 extern void CmiInitCPUAffinity(char **argv);
 extern int CmiPrintCPUAffinity(void);
 extern int CmiSetCPUAffinity(int core);
+extern void CmiInitCPUTopology(char **argv);
 extern int CmiOnCore(void);
 
 typedef struct
index fda15407a3b6c92da7eaba543ec287e5ed560df3..f171b392fffb6cc0fb053cf538a9643ff49186a2 100644 (file)
@@ -139,6 +139,13 @@ void commbench_init(int argc, char** argv) {
   CpvInitialize(int, num_tests_to_skip);
   CpvInitialize(char**, tests_to_skip);
   CpvInitialize(int, next_test_index);
+
+  // Set runtime cpuaffinity
+  CmiInitCPUAffinity(argv);
+
+  // Initialize CPU topology
+  CmiInitCPUTopology(argv);
+
   for (numtests = 0; tests[numtests].name; numtests++)
     ;
   CpvAccess(test_bank_size) = numtests;
index f4c025bf55177a691a893f9f104ef8989e14aa26..77682ea6cd99371e094c1d21bbafa6295d51b86b 100644 (file)
@@ -201,6 +201,12 @@ CmiStartFn mymain(int argc, char **argv)
     CpvInitialize(int,twoway);
     CpvAccess(twoway) = 0;
 
+    // Set runtime cpuaffinity
+    CmiInitCPUAffinity(argv);
+
+    // Initialize CPU topology
+    CmiInitCPUTopology(argv);
+
     if(argc > 1)
         CpvAccess(twoway) = atoi(argv[1]);
     
index 203ba25ee6dbb1baf3494a23d90c17207320a6ca..a48d9b39b9121890555a85cf433d6eb6892e7dc6 100644 (file)
@@ -175,6 +175,12 @@ CmiStartFn mymain(int argc, char** argv)
 
     CcdCallOnConditionKeep(CcdPROCESSOR_BEGIN_IDLE, ApplIdleStart, NULL);
     CcdCallOnConditionKeep(CcdPROCESSOR_END_IDLE, ApplIdleEnd, NULL);
+
+    // Set runtime cpuaffinity
+    CmiInitCPUAffinity(argv);
+
+    // Initialize CPU topology
+    CmiInitCPUTopology(argv);
     
     if(argc > 1)
         CpvAccess(twoway) = atoi(argv[1]);
index 460fad34380c10af62eb263af4e4a23a935f2cb4..86f53deb77fbdb8034e87907ed83eddfb7395afe 100644 (file)
@@ -238,6 +238,13 @@ void megacon_init(int argc, char **argv)
   CpvInitialize(int, next_test_number);
   CpvInitialize(int, acks_expected);
   CpvInitialize(int, acks_received);
+
+  // Set runtime cpuaffinity
+  CmiInitCPUAffinity(argv);
+
+  // Initialize CPU topology
+  CmiInitCPUTopology(argv);
+
   for (numtests=0; tests[numtests].name; numtests++);
   CpvAccess(test_bank_size) = numtests;
   CpvAccess(next_test_index) = 0;