diff mbox

[committed] Make 3 libgomp examples-4 tests cheaper

Message ID 20141126194027.GU1669@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 26, 2014, 7:40 p.m. UTC
Hi!

I've looked at which tests are still too expensive
on heavily loaded many thread configurations (where other threads
during normal testing run many other tests), and found these:

The patch attempts to limit number of target or parallel regions
to something smaller than hundreds or thousands.
In the Fortran test, I haven't understand why the Fortran version
uses so much larger arrays than corresponding C test.

Regtested on x86_64-linux and i686-linux, committed to trunk.

2014-11-26  Jakub Jelinek  <jakub@redhat.com>

	* testsuite/libgomp.c/examples-4/e.53.4.c: Add -DITESTITERS=20
	to dg-options unless expensive testing is on.  
	(TESTITERS): Define to N if not defined.
	(main): Use TESTITERS instead of N.
	* testsuite/libgomp.c/examples-4/e.55.1.c: Define CHUNKSZ from
	dg-additional-options depending on whether expensive testing is on.
	* testsuite/libgomp.fortran/examples-4/e.55.1.f90 (e_55_1_mod):
	Decrease N to 100000 and CHUNKSZ to 10000.


	Jakub
diff mbox

Patch

--- libgomp/testsuite/libgomp.c/examples-4/e.53.4.c.jj	2014-11-13 15:13:18.000000000 +0100
+++ libgomp/testsuite/libgomp.c/examples-4/e.53.4.c	2014-11-26 11:50:00.092550436 +0100
@@ -1,9 +1,13 @@ 
 /* { dg-do run } */
+/* { dg-additional-options "-DTESTITERS=20" { target { ! run_expensive_tests } } } */
 
 #include <stdlib.h>
 
 #define EPS 0.00001
 #define N 1000
+#ifndef TESTITERS
+#define TESTITERS N
+#endif
 
 #pragma omp declare target
 float Q[N][N];
@@ -60,7 +64,7 @@  int main ()
 
   #pragma omp target update to(Q)
 
-  for (i = 0; i < N; i++)
+  for (i = 0; i < TESTITERS; i++)
     check (accum (i), accum_ref (i));
 
   return 0;
--- libgomp/testsuite/libgomp.c/examples-4/e.55.1.c.jj	2014-11-13 15:13:18.000000000 +0100
+++ libgomp/testsuite/libgomp.c/examples-4/e.55.1.c	2014-11-26 11:52:16.206153938 +0100
@@ -1,10 +1,11 @@ 
 /* { dg-do run } */
+/* { dg-additional-options "-DCHUNKSZ=5000" { target { ! run_expensive_tests } } } */
+/* { dg-additional-options "-DCHUNKSZ=1000" { target run_expensive_tests } } */
 
 #include <stdlib.h>
 
 #define EPS 0.00001
 #define N 100000
-#define CHUNKSZ 1000
 
 float Y[N];
 float Z[N];
--- libgomp/testsuite/libgomp.fortran/examples-4/e.55.1.f90.jj	2014-11-13 15:13:17.000000000 +0100
+++ libgomp/testsuite/libgomp.fortran/examples-4/e.55.1.f90	2014-11-26 12:00:03.531907670 +0100
@@ -1,7 +1,7 @@ 
 ! { dg-do run }
 
 module e_55_1_mod
-  integer, parameter :: N = 10000000, CHUNKSZ = 100000
+  integer, parameter :: N = 100000, CHUNKSZ = 10000
   real :: Y(N), Z(N)
 end module