[m-users.] uncaught Mercury exception using mdprof_create_feedback

Paul Bone paul at bone.id.au
Fri Oct 3 17:08:57 AEST 2014


On Sun, Sep 28, 2014 at 04:35:17PM +0200, Matthias Guedemann wrote:
> Dear all,
> 
> I am using mmc version 14.01.1, trying to use the implicit parallelism
> feature.
> 
> My program looks roughly like this:
> 
> ,----
> | main(!IO) :-
> |     ...
> |     (( prepareGraph(E1),
> |        G1 = createGraph(E1),
> |        R1 = analyseGraph(G1)),
> |      ( prepareGraph(E2),
> |        G2 = createGraph(E2),
> |        R2 = analyseGraph(G2)),
> |      ( prepareGraph(E3),
> |        G3 = createGraph(E3),
> |        R3 = analyseGraph(G3))
> |     ),
> |     ...
> |     some IO on results
> `----
> 
> This works without problems, I can also execute the three independent
> conjunction groups using parallel-AND in the asm_fast.par.gc.stseg grade
> with 300% CPU usage. But when I use
> 
> % mmc --deep-profiling --profile-for-feedback
> 
> mdprof_create_feedback chokes on the created Deep.data file. I always
> get the error:

I've fixed the bug and I can patch Mercury soon.  Now that it's working I
can create the feedback file (attached).  What's interesting is that the
automatic parallelisation analysis chooses a different parallelisation than
yours.  It picks a dependent parallelisation of main/2 and believes it can
get a speedup of more than 4.0.  I tried compiling and running the program
and I cannot verify this because the program finishes in less than 0.020
seconds with or without parallelism, which is too little to measure.  I'll
let you try it with my feedback file and see what you find.  Also you can
see what the autoparallelisation recommends by using the
mdprof_report_feedback tool to translate the feedback file into a human
readable form.

I also tried the --no-ipar-dep-conjs flag, in that case the automatic
analysis chooses the ame parallelisation as you did, and predicts a speedup
of 2.5.

Keep in mind the optimisation you used to create the deep profiling version
of the program must match the ones you use to create the parallel version,
otherwise the compiler may not be able to find the parts of the program that
the feedback file says to parallelise.  So if you used -O2 to compile the
profiling version, you must also use -O2 to compile the parallel version,
--intermodule-optimisation and other flags are also significant.

Good luck.


-- 
Paul Bone
-------------- next part --------------
Mercury Compiler Feedback
18
./euler_82
[feedback_data_candidate_parallel_conjunctions(candidate_par_conjunctions_params(8.0, no, 100, 1000, 100, 100, 200, 1000, 2000, 2000, 1.01, parallelise_dep_conjs(estimate_speedup_by_overlap), bpa_complete_branches(1000)), [str_ordinary_proc_label(pf_predicate, "euler_82", "euler_82", "main", 2, 0) - candidate_par_conjunctions_proc(three(12, "Graph_82", 20, "D0", two(8, "Graph_81", three(4, "MaxY", 6, "VList", four(1, "Problem", 2, "Matrix", 3, "MaxX", empty, empty, empty, empty), two(5, "Map", empty, empty), two(7, "EList_81", empty, empty)), two(10, "DistMap_81", two(9, "PreMap_81", empty, empty), two(11, "EList_82", empty, empty))), two(16, "Graph_83", two(14, "DistMap_82", two(13, "PreMap_82", empty, empty), two(15, "EList_83", empty, empty)), two(18, "DistMap_83", two(17, "PreMap_83", empty, empty), two(19, "Length", empty, empty))), two(24, "P1", two(22, "Length1", two(21, "P0", empty, empty), two(23, "D1", empty, empty)), two(26, "D2", two(25, "Length2", empty, empty), two(27, "P2", empty, empty)))), [], [candidate_par_conjunction("", no, 1, conjuncts_are_dependent(sol([8, 11, 12, 15, 16])), [goal_rep(atomic_goal_rep("euler_82.m", 143, [1], plain_call_rep("euler_81_82_83_problem_set", "small_problem", [1])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 144, [2, 3, 4], unify_deconstruct_rep(1, "problem", [2, 3, 4])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 147, [30], unify_construct_rep(30, "0", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [67], unify_construct_rep(67, "$type_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [68], unify_construct_rep(68, "$type_ctor_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 147, [31], plain_call_rep("map", "init", [67, 68, 31])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 147, [5], plain_call_rep("euler_81_82_83_problem_set", "convert_lists", [30, 2, 31, 5])), det_rep, pard_goal_annotation(154.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 148, [6], plain_call_rep("euler_81_82_83_problem_set", "euler_vertex_list", [5, 6])), cc_multidet_rep, pard_goal_annotation(308.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 149, [32], unify_construct_rep(32, "$closure_cons", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], []))], 464.0, [seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 149, [7], plain_call_rep("euler_81_82_83_problem_set", "euler_edge_list", [6, 3, 4, 32, 7])), det_rep, pard_goal_annotation(15363.0, cost_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 150, [8], plain_call_rep("euler_82", "create_graph", [7, 8])), det_rep, pard_goal_annotation(6745.0, cost_above_par_threshold, [8 - 6744.0], []))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 151, [9, 10], plain_call_rep("euler_82", "dijkstra", [8, 6, 5, 9, 10])), det_rep, pard_goal_annotation(26200.0, cost_above_par_threshold, [], [8 - 17888.312046444124]))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 152, [33], unify_construct_rep(33, "$closure_cons", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 152, [11], plain_call_rep("euler_81_82_83_problem_set", "euler_edge_list", [6, 3, 4, 33, 11])), det_rep, pard_goal_annotation(18884.0, cost_above_par_threshold, [11 - 18883.0], []))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 153, [12], plain_call_rep("euler_82", "create_graph", [11, 12])), det_rep, pard_goal_annotation(8706.0, cost_above_par_threshold, [12 - 8705.0], [11 - 1.0]))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 154, [13, 14], plain_call_rep("euler_82", "dijkstra", [12, 6, 5, 13, 14])), det_rep, pard_goal_annotation(28003.0, cost_above_par_threshold, [], [12 - 18020.8824383164]))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 155, [34], unify_construct_rep(34, "$closure_cons", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 155, [15], plain_call_rep("euler_81_82_83_problem_set", "euler_edge_list", [6, 3, 4, 34, 15])), det_rep, pard_goal_annotation(22004.0, cost_above_par_threshold, [15 - 22003.0], []))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 156, [16], plain_call_rep("euler_82", "create_graph", [15, 16])), det_rep, pard_goal_annotation(9737.0, cost_above_par_threshold, [16 - 9736.0], [15 - 1.0]))]), seq_conj([goal_rep(atomic_goal_rep("euler_82.m", 157, [17, 18], plain_call_rep("euler_82", "dijkstra", [16, 6, 5, 17, 18])), det_rep, pard_goal_annotation(28535.0, cost_above_par_threshold, [], [16 - 17916.644412191585]))])], [goal_rep(atomic_goal_rep("euler_82.m", 159, [35], unify_construct_rep(35, "\"Kanten im Graph 81: \"", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [69], unify_construct_rep(69, "$type_ctor_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 159, [36], plain_call_rep("io", "print", [69, 35, 28, 36])), det_rep, pard_goal_annotation(5.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [70], unify_construct_rep(70, "$type_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 160, [19], plain_call_rep("list", "length", [70, 7, 19])), det_rep, pard_goal_annotation(69.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 161, [37], plain_call_rep("io", "print", [68, 19, 36, 37])), det_rep, pard_goal_annotation(27.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 161, [38], plain_call_rep("io", "nl", [37, 38])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 162, [39], unify_construct_rep(39, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [71], unify_construct_rep(71, "$type_ctor_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [72], unify_construct_rep(72, "$type_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 162, [20], plain_call_rep("map", "lookup", [71, 72, 10, 39, 20])), det_rep, pard_goal_annotation(10.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 163, [40], plain_call_rep("io", "print", [72, 20, 38, 40])), det_rep, pard_goal_annotation(87.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 163, [41], plain_call_rep("io", "nl", [40, 41])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 164, [42], unify_construct_rep(42, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 0, [73], unify_construct_rep(73, "$type_info_const", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 164, [21], plain_call_rep("map", "lookup", [71, 73, 9, 42, 21])), det_rep, pard_goal_annotation(10.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 165, [43], plain_call_rep("io", "print", [73, 21, 41, 43])), det_rep, pard_goal_annotation(210.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 165, [44], plain_call_rep("io", "nl", [43, 44])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 165, [45], plain_call_rep("io", "nl", [44, 45])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 167, [46], unify_construct_rep(46, "\"Kanten im Graph 82: \"", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 167, [47], plain_call_rep("io", "print", [69, 46, 45, 47])), det_rep, pard_goal_annotation(5.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 168, [22], plain_call_rep("list", "length", [70, 11, 22])), det_rep, pard_goal_annotation(97.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 169, [48], plain_call_rep("io", "print", [68, 22, 47, 48])), det_rep, pard_goal_annotation(27.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 169, [49], plain_call_rep("io", "nl", [48, 49])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 170, [50], unify_construct_rep(50, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 170, [23], plain_call_rep("map", "lookup", [71, 72, 14, 50, 23])), det_rep, pard_goal_annotation(11.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 171, [51], plain_call_rep("io", "print", [72, 23, 49, 51])), det_rep, pard_goal_annotation(87.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 171, [52], plain_call_rep("io", "nl", [51, 52])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 172, [53], unify_construct_rep(53, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 172, [24], plain_call_rep("map", "lookup", [71, 73, 13, 53, 24])), det_rep, pard_goal_annotation(11.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 173, [54], plain_call_rep("io", "print", [73, 24, 52, 54])), det_rep, pard_goal_annotation(210.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 173, [55], plain_call_rep("io", "nl", [54, 55])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 173, [56], plain_call_rep("io", "nl", [55, 56])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 175, [57], unify_construct_rep(57, "\"Kanten im Graph 83: \"", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 175, [58], plain_call_rep("io", "print", [69, 57, 56, 58])), det_rep, pard_goal_annotation(5.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 176, [25], plain_call_rep("list", "length", [70, 15, 25])), det_rep, pard_goal_annotation(109.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 177, [59], plain_call_rep("io", "print", [68, 25, 58, 59])), det_rep, pard_goal_annotation(27.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 177, [60], plain_call_rep("io", "nl", [59, 60])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 178, [61], unify_construct_rep(61, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 178, [26], plain_call_rep("map", "lookup", [71, 72, 18, 61, 26])), det_rep, pard_goal_annotation(9.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 179, [62], plain_call_rep("io", "print", [72, 26, 60, 62])), det_rep, pard_goal_annotation(87.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 179, [63], plain_call_rep("io", "nl", [62, 63])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 180, [64], unify_construct_rep(64, "t", [])), det_rep, pard_goal_annotation(0.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 180, [27], plain_call_rep("map", "lookup", [71, 73, 17, 64, 27])), det_rep, pard_goal_annotation(9.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 181, [65], plain_call_rep("io", "print", [73, 27, 63, 65])), det_rep, pard_goal_annotation(210.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 181, [66], plain_call_rep("io", "nl", [65, 66])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], [])), goal_rep(atomic_goal_rep("euler_82.m", 183, [29], plain_call_rep("io", "nl", [66, 29])), det_rep, pard_goal_annotation(1.0, cost_not_above_par_threshold, [], []))], 1334.0, parallel_exec_metrics(1, 165975.0, 40737.0, 700.0, 800.0, 500.0, 1000.0, 15731.0, 45502.68795355588))])])].


More information about the users mailing list