Sfoglia il codice sorgente

Reduce duration of bandwidth test

Samuel Thibault 4 anni fa
parent
commit
acae6e78df
1 ha cambiato i file con 13 aggiunte e 2 eliminazioni
  1. 13 2
      tests/microbenchs/bandwidth.c

+ 13 - 2
tests/microbenchs/bandwidth.c

@@ -27,12 +27,11 @@
 
 #if defined(STARPU_QUICK_CHECK) || defined(STARPU_SANITIZE_LEAK) || defined(STARPU_SANITIZE_ADDRESS)
 static size_t size = 1024;
-static unsigned cpustep = 8;
 #else
 /* Must be bigger than available cache size per core, 64MiB should be enough */
 static size_t size = 64UL << 20;
-static unsigned cpustep = 1;
 #endif
+static unsigned cpustep = 0;
 
 static unsigned noalone = 0;
 static unsigned iter = 30;
@@ -305,6 +304,18 @@ int main(int argc, char **argv)
 
 	result = malloc(total_ncpus * sizeof(result[0]));
 
+	if (cpustep == 0) {
+#if defined(STARPU_QUICK_CHECK) || defined(STARPU_SANITIZE_LEAK) || defined(STARPU_SANITIZE_ADDRESS)
+		cpustep = total_ncpus / 2;
+#elif defined(STARPU_LONG_CHECK)
+		cpustep = 1;
+#else
+		cpustep = total_ncpus / 8;
+#endif
+		if (cpustep == 0)
+			cpustep = 1;
+	}
+
 	printf("# nw\ta comp.\t+sched\teff%%\ta scat.\t+nop\t+sync\t+sched\teff%% vs nop\n");
 	for (n = cpustep; n <= total_ncpus; n += cpustep)
 	{