[m-rev.] diff: Create test cases for feedback analysis.

Paul Bone pbone at csse.unimelb.edu.au
Mon Dec 5 17:03:45 AEDT 2011


Create test cases for feedback analysis.

These test cases take a program's profile and compute from it a feedback file.
Then pretty-print the feedback file using mdprof_report_feedback, and compare
the pretty-printed output to a reference output.  By comparing the pretty
printed output it's easy to see what has changed when the tests fail.

tests/Mmakefile:
tests/feedback:
    Create feedback directory in the test suite.

tests/feedback/Mmakefile:
tests/feedback/autopar_mandelbrot.exp:
tests/feedback/autopar_mmc.exp:
tests/feedback/mandelbrot/Deep.data:
tests/feedback/mandelbrot/Deep.procrep:
tests/feedback/mmc/Deep.data:
tests/feedback/mmc/Deep.procrep:
    Create two test cases for feedback analysis, these test the automatic
    parallelization of the compiler and mandelbrot program.

deep_profiler/mdprof_create_feedback.m:
    The create feedback tool does not generate a report by default.

diff --git a/deep_profiler/mdprof_create_feedback.m b/deep_profiler/mdprof_create_feedback.m
index e6c9955..1511cc0 100644
--- a/deep_profiler/mdprof_create_feedback.m
+++ b/deep_profiler/mdprof_create_feedback.m
@@ -191,9 +191,8 @@ help_message(ProgName) = HelpMessage :-
     --debug-read-profile
                     Generate debugging messages when reading the deep profile
                     and creating the deep structure.
-    --no-report     Suppress the report about the feedback information in the
-                    file that is usually displayed after any processing has
-                    been done.
+    --report        Print a report about the feedback information after any
+                    processing has been done.
 
     The following options select sets of feedback information useful
     for particular compiler optimizations:
@@ -435,7 +434,7 @@ defaults(help,                              bool(no)).
 defaults(verbosity,                         int(2)).
 defaults(version,                           bool(no)).
 defaults(debug_read_profile,                bool(no)).
-defaults(report,                            bool(yes)).
+defaults(report,                            bool(no)).
 
 defaults(candidate_parallel_conjunctions,   bool(no)).
 
diff --git a/tests/Mmakefile b/tests/Mmakefile
index 8ee8aad..746ded5 100644
--- a/tests/Mmakefile
+++ b/tests/Mmakefile
@@ -6,6 +6,7 @@ SUBDIRS = \
 	benchmarks \
 	debugger \
 	dppd \
+	feedback \
 	general \
 	grade_subdirs \
 	hard_coded \
diff --git a/tests/feedback/Mmakefile b/tests/feedback/Mmakefile
new file mode 100644
index 0000000..b32983e
--- /dev/null
+++ b/tests/feedback/Mmakefile
@@ -0,0 +1,34 @@
+#-----------------------------------------------------------------------------#
+
+THIS_DIR = feedback
+
+#-----------------------------------------------------------------------------#
+
+AUTOPAR_REPORTS=mandelbrot \
+		        mmc
+
+REPORTS=$(patsubst %,autopar_%,$(AUTOPAR_REPORTS))
+
+TESTS = $(patsubst %,%-nodepend,$(sort $(REPORTS)))
+TESTS_DIR = ..
+SUBDIRS=
+include $(TESTS_DIR)/Mmake.common
+
+FB_CREATE = ../../deep_profiler/mdprof_create_feedback
+FB_REPORT = ../../deep_profiler/mdprof_report_feedback
+
+%.runtest: %.res ;
+
+%.out: %.feedback
+	$(FB_REPORT) $< > $@
+
+autopar_%.feedback: %/Deep.data %/Deep.procrep
+	$(FB_CREATE) --implicit-parallelism $< $@
+
+%.realclean:
+	rm -rf $(@:.realclean=.feedback) \
+		$(@:.realclean=.out) \
+		$(@:.realclean=.res) \
+		$(@:.realclean=.res1) \
+		$(@:.realclean=.log)
+
diff --git a/tests/feedback/autopar_mandelbrot.exp b/tests/feedback/autopar_mandelbrot.exp
new file mode 100644
index 0000000..f0b32e8
--- /dev/null
+++ b/tests/feedback/autopar_mandelbrot.exp
@@ -0,0 +1,62 @@
+Feedback report for ./mandelbrot:
+
+  Candidate parallel conjunctions:
+    Desired parallelism:       8.000000
+    Intermodule var use:       no
+    Sparking cost:             100
+    Sparking delay:            1000
+    Barrier cost:              100
+    Future signal cost:        100
+    Future wait cost:          200
+    Context wakeup delay:      1000
+    Clique threshold:          2000
+    Call site threshold:       2000
+    Speedup threshold:         1.010000
+    Dependent conjs:           yes, use overlap calculation
+    BestParAlgorithm:          complete-branches(1000)
+    # of par procs with conjs: 1
+    # of par conjunctions:     1
+    Parallel conjunctions:
+
+    pred mandelbrot.my_map/3-0
+
+      Path: s2-na;
+      Dependent: no
+      NumCalls: 200
+      SeqTime: 2,023,529.72
+      ParTime: 1,013,765.36
+      SparkCost: 100.00
+      BarrierCost: 200.00
+      SignalsCost: 0.00
+      WaitsCost: 0.00
+      ParOverheads total: 300.00
+      Speedup: 1.9961
+      Time saving: 1,009,764.36
+      First conj dead time: 1,001.00
+      Future dead time: 0.00
+      Total dead time: 1,001.00
+
+      Goals before:
+        % conjunction: s2-na;
+        % Cost: 0.00
+
+        % s2-na;c1;
+        % det
+        % cost: 0.00 (not above threshold)
+        V_2 => [|](X, Xs)
+
+      Parallel conjunction:
+        (
+          % s2-na;c2;c1;
+          % det
+          % cost: 1,011,764.36 (above threshold)
+          M((X, Y))
+        &
+          % s2-na;c2;c2;
+          % det
+          % cost: 1,011,765.36 (above threshold)
+          mandelbrot.my_map(V_8, V_9, M, Xs, Ys)
+        )
+
+      Goals after:
+
diff --git a/tests/feedback/autopar_mmc.exp b/tests/feedback/autopar_mmc.exp
new file mode 100644
index 0000000..75ecb98
--- /dev/null
+++ b/tests/feedback/autopar_mmc.exp

This file is too big for anyone to resonably read on the mailing list.

diff --git a/tests/feedback/mandelbrot/Deep.data b/tests/feedback/mandelbrot/Deep.data
new file mode 100644
index 0000000..da745d2
Binary files /dev/null and b/tests/feedback/mandelbrot/Deep.data differ
diff --git a/tests/feedback/mandelbrot/Deep.procrep b/tests/feedback/mandelbrot/Deep.procrep
new file mode 100644
index 0000000..087b516
Binary files /dev/null and b/tests/feedback/mandelbrot/Deep.procrep differ
diff --git a/tests/feedback/mmc/Deep.data b/tests/feedback/mmc/Deep.data
new file mode 100644
index 0000000..09f3960
Binary files /dev/null and b/tests/feedback/mmc/Deep.data differ
diff --git a/tests/feedback/mmc/Deep.procrep b/tests/feedback/mmc/Deep.procrep
new file mode 100644
index 0000000..cc9896f
Binary files /dev/null and b/tests/feedback/mmc/Deep.procrep differ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20111205/bdba29d2/attachment.sig>


More information about the reviews mailing list