johnyangk commented on a change in pull request #88: [NEMO-138] Rule-based
policy
URL: https://github.com/apache/incubator-nemo/pull/88#discussion_r208200972
##########
File path:
compiler/optimizer/src/main/java/edu/snu/nemo/compiler/optimizer/policy/PolicyImpl.java
##########
@@ -66,7 +68,8 @@ private CompiletimeOptimizer() {
if (passes.hasNext()) {
final CompileTimePass passToApply = passes.next();
// Apply the pass to the DAG.
- final DAG<IRVertex, IREdge> processedDAG = passToApply.apply(dag);
+ final DAG<IRVertex, IREdge> processedDAG =
passToApply.getCondition().test(dag)
+ ? passToApply.apply(dag) : dag;
Review comment:
I'd skip integrity checking and `processedDAG.storeJSON`, when the pass does
not run due unmet conditions.
How about also logging this information to let ourselves know which pass ran
and did not ran?
e.g.,
INFO: Pass X ran (JSON stored at ABC)
INFO: Pass Y did not ran due to condition C1
INFO: Pass Z ran (JSON stored at DEF)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services