Просмотр исходного кода

Can make the output from the two versions comparable.

If you want to compare the output of the dlrho version to the controller/worker version, you can set the MAKE_VERSIONS_COMPARABLE macro. This forces the controller/worker version to use one worker per subproblem and one dpnode per subproblem. This should make the saved distinguished points comparable between the two, but the number of kernel launches will be slightly higher in the controller/worker version since the worker will usually run an extra kernel launch before it receives the stop message from the dpnode.
Steven Engler 8 лет назад
Родитель
Сommit
f496ab2bf5
3 измененных файлов с 16 добавлено и 2 удалено
  1. 1 1
      Makefile
  2. 8 1
      controller_main.cc
  3. 7 0
      desired_resources.cc

+ 1 - 1
Makefile

@@ -24,7 +24,7 @@ MPI ?= /usr/local
 CXX ?= g++
 
 WORDS = 24
-MACROS=-DDERANDOMIZE -UVERBOSE -DSAVE_DPS
+MACROS=-DDERANDOMIZE -UVERBOSE -DSAVE_DPS -DMAKE_VERSIONS_COMPARABLE
 
 CXXFLAGS=-g -Wall -O2
 CPPFLAGS=-DWORDS=$(WORDS) -I$(LIBEVENT)/include -I$(GMP)/include -std=c++11 $(MACROS)

+ 8 - 1
controller_main.cc

@@ -21,9 +21,16 @@ void custom_desired_resources(const ZZ &order,
     unsigned short &desired_dpnodes, unsigned int &max_workers,
     unsigned int &dpfreq)
 {
+    unsigned short custom_total_nodes = total_nodes;
 
+#ifdef MAKE_VERSIONS_COMPARABLE
+    custom_total_nodes = 1;
+    // override the total number of nodes so that only
+    // one dpnode is used for each subproblem and the
+    // results are comparable to the dlrho version
+#endif
 
-    return desired_resources(order, total_nodes,
+    return desired_resources(order, custom_total_nodes,
 			    GB_mem_per_node, desired_dpnodes,
 			    max_workers, dpfreq);
 }

+ 7 - 0
desired_resources.cc

@@ -39,6 +39,12 @@ void desired_resources(const ZZ &order, unsigned short total_nodes,
     }
 
     // How many workers would we like to use?
+#if defined(DERANDOMIZE) || defined(MAKE_VERSIONS_COMPARABLE)
+    max_workers = 1;
+    // so that there aren't multiple workers using the
+    // exact same a, b, astep, etc
+    // or so that it's similar to the dlrho version
+#else
     ZZ sorder23 = sorder >> 23;
     if (NumBits(sorder23) > 30) {
 	// Just use all the workers we can find
@@ -46,6 +52,7 @@ void desired_resources(const ZZ &order, unsigned short total_nodes,
     } else {
 	max_workers = trunc_long(sorder23,31) + 1;
     }
+#endif
 
     // By default, 1 in dpscale points are distinguished points.
     dpfreq = 4294967295U / dpscale;