Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 632 #720

Closed
wants to merge 29 commits into from
Closed

Issue 632 #720

wants to merge 29 commits into from

Conversation

YUUU23
Copy link

@YUUU23 YUUU23 commented Jun 8, 2024

…t was unparallelizable or general other exceptions in the compiler through providing more specific log messages
…t was unparallelizable or general other exceptions in the compiler through providing more specific log messages
Copy link

github-actions bot commented Jun 8, 2024

OS =
CPU =
Ram =
Hash = b56dd93
Kernel=
||
|-|-|-|-|-|-|-|-|-|

Copy link

github-actions bot commented Jun 8, 2024

OS:ubuntu-20.04
Sat Jun 8 19:21:49 UTC 2024
intro: 2/2 tests passed.
interface: 41/41 tests passed.
compiler: 54/54 tests passed.

@@ -92,10 +93,13 @@ def compile_ir(ir_filename, compiled_script_file, args, compiler_config):
ret = None
try:
ret = compile_optimize_output_script(ir_filename, compiled_script_file, args, compiler_config)
except UnparallelizableError as e:
log("WARNING: Exception caught because some region(s) are unparallelizable:", e)
log(traceback.format_exc()) # get detailed reports for (I) when debugging, one could simply uncomment/introduce traceback.print_exc() ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this we might prefer to leave that commented and make sure to pass all the necessary information in the custom error message. The hope would be that a PaSh user does not see exception traces if something is unparellizable, but rather sees an informative message.

except Exception as e:
log("WARNING: Exception caught:", e)
# traceback.print_exc()

log(traceback.format_exc())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this will now happen less often it might be OK to let the traceback be logged.

compiler/ir.py Outdated
@@ -960,7 +961,7 @@ def introduce_aggregators_for_consec_chunks(self, fileIdGen, in_aggregator_ids,
# TODO: turn node into cmd_invocation_with_io_vars since this is the only thing required in this function
self.create_generic_aggregator_tree(original_cmd_invocation_with_io_vars, parallelizer, map_in_aggregator_ids, out_aggregator_id, fileIdGen)
else:
raise Exception("aggregator kind not yet implemented")
raise UnparallelizableError("aggregator kind not yet implemented")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add more information in this message. For example, which command does this refer to?

compiler/ir.py Outdated

def apply_round_robin_parallelization_to_node(self, node_id, parallelizer, fileIdGen, fan_out,
r_split_batch_size):
# TODO: this control flow should move done to aggregators once we implement them;
# currently, this cannot be done since splitter etc. would be added...
aggregator_spec = parallelizer.get_aggregator_spec()
if aggregator_spec.is_aggregator_spec_adj_lines_merge():
raise Exception("adj_lines_merge not yet implemented in PaSh")
raise UnparallelizableError("adj_lines_merge not yet implemented in PaSh")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 errors are actually general exceptions. Or rather NotImplemented errors, so I would make a new error type and catch them separately.

compiler/ir.py Outdated
@@ -741,19 +742,19 @@ def apply_parallelization_to_node(self, node_id, parallelizer, fileIdGen, fan_ou
elif splitter.is_splitter_consec_chunks():
self.apply_consecutive_chunks_parallelization_to_node(node_id, parallelizer, fileIdGen, fan_out)
else:
raise Exception("Splitter not yet implemented")
raise UnparallelizableError("Splitter not yet implemented")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, add which command the splitter doesn't exist for.

if io_info.has_other_outputs():
raise Exception(f"Command {format_arg_chars(command)} has outputs other than streaming.")
raise UnparallelizableError(f"Command {format_arg_chars(command)} has outputs other than streaming.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also print what is the other output?

@@ -141,7 +142,7 @@ def combine_pipe(ast_nodes):
else:
## If any part of the pipe is not an IR, the compilation must fail.
log("Node: {} is not pure".format(ast_nodes))
raise Exception('Not pure node in pipe')
raise UnparallelizableError('Not pure node in pipe')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I would include the node in the message.

@@ -132,7 +133,7 @@ def combine_pipe(ast_nodes):
else:
## If any part of the pipe is not an IR, the compilation must fail.
log("Node: {} is not pure".format(ast_nodes[0]))
raise Exception('Not pure node in pipe')
raise UnparallelizableError('Not pure node in pipe')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would include more information here (like the node), even though it is logged above.

Copy link
Member

@angelhof angelhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything other than the comments looks good. I would suggest rebasing your commits on future instead of main though. This is where we actually merge new changes (and every now and then we merge on main.

…t_to_ir.py, change errors to be logged when general exceptions are caught and not unparallelizable ones, introduce AdjLineNotImplementedError
Copy link

OS =
CPU =
Ram =
Hash = 623281b
Kernel=
||
|-|-|-|-|-|-|-|-|-|

Copy link

OS =
CPU =
Ram =
Hash = c218e0a
Kernel=
||
|-|-|-|-|-|-|-|-|-|

Copy link

OS:ubuntu-20.04
Mon Jun 10 20:38:55 UTC 2024
intro: 2/2 tests passed.
interface: 41/41 tests passed.
compiler: 54/54 tests passed.

Copy link

OS:ubuntu-20.04
Mon Jun 10 20:51:59 UTC 2024
intro: 0/2 tests passed.
interface: 6/41 tests passed.
compiler: 0/54 tests passed.
demo-spell.sh are not identical
hello-world.sh are not identical
test1 are not identical
test2 are not identical
test3 are not identical
test4 are not identical
test5 are not identical
test6 are not identical
test8 are not identical
test9 are not identical
test10 are not identical
test12 are not identical
test13 are not identical
test14 are not identical
test15 are not identical
test16 are not identical
test17 are not identical
test18 are not identical
test_set are not identical
test_set_e are not identical
test_redirect are not identical
test_unparsing are not identical
test_set_e_2 are not identical
test_set_e_3 are not identical
test_new_line_in_var are not identical
test_cmd_sbst are not identical
test_cmd_sbst2 are not identical
test_cat_hyphen are not identical
test_trap are not identical
test_umask are not identical
test_quoting are not identical
test_var_assgn_default are not identical
test_exclam are not identical
test_redir_var_test are not identical
test_star are not identical
test_env_vars are not identical
test_redir_dup are not identical
diff.sh are not identical
diff.sh are not identical
set-diff.sh are not identical
set-diff.sh are not identical
export_var_script.sh are not identical
export_var_script.sh are not identical
comm-par-test.sh are not identical
comm-par-test.sh are not identical
comm-par-test2.sh are not identical
comm-par-test2.sh are not identical
tee_web_index_bug.sh are not identical
tee_web_index_bug.sh are not identical
fun-def.sh are not identical
fun-def.sh are not identical
bigrams.sh are not identical
bigrams.sh are not identical
spell-grep.sh are not identical
spell-grep.sh are not identical
grep.sh are not identical
grep.sh are not identical
minimal_sort.sh are not identical
minimal_sort.sh are not identical
minimal_grep.sh are not identical
minimal_grep.sh are not identical
topn.sh are not identical
topn.sh are not identical
wf.sh are not identical
wf.sh are not identical
spell.sh are not identical
spell.sh are not identical
shortest_scripts.sh are not identical
shortest_scripts.sh are not identical
alt_bigrams.sh are not identical
alt_bigrams.sh are not identical
deadlock_test.sh are not identical
deadlock_test.sh are not identical
double_sort.sh are not identical
double_sort.sh are not identical
no_in_script.sh are not identical
no_in_script.sh are not identical
for_loop_simple.sh are not identical
for_loop_simple.sh are not identical
minimal_grep_stdin.sh are not identical
minimal_grep_stdin.sh are not identical
micro_10.sh are not identical
micro_10.sh are not identical
sed-test.sh are not identical
sed-test.sh are not identical
tr-test.sh are not identical
tr-test.sh are not identical
grep-test.sh are not identical
grep-test.sh are not identical
ann-agg.sh are not identical
ann-agg.sh are not identical

Copy link

OS =
CPU =
Ram =
Hash = 23f42f6
Kernel=
||
|-|-|-|-|-|-|-|-|-|

Copy link

OS:ubuntu-20.04
Tue Jun 11 00:35:46 UTC 2024
intro: 0/2 tests passed.
interface: 6/41 tests passed.
compiler: 0/54 tests passed.
demo-spell.sh are not identical
hello-world.sh are not identical
test1 are not identical
test2 are not identical
test3 are not identical
test4 are not identical
test5 are not identical
test6 are not identical
test8 are not identical
test9 are not identical
test10 are not identical
test12 are not identical
test13 are not identical
test14 are not identical
test15 are not identical
test16 are not identical
test17 are not identical
test18 are not identical
test_set are not identical
test_set_e are not identical
test_redirect are not identical
test_unparsing are not identical
test_set_e_2 are not identical
test_set_e_3 are not identical
test_new_line_in_var are not identical
test_cmd_sbst are not identical
test_cmd_sbst2 are not identical
test_cat_hyphen are not identical
test_trap are not identical
test_umask are not identical
test_quoting are not identical
test_var_assgn_default are not identical
test_exclam are not identical
test_redir_var_test are not identical
test_star are not identical
test_env_vars are not identical
test_redir_dup are not identical
diff.sh are not identical
diff.sh are not identical
set-diff.sh are not identical
set-diff.sh are not identical
export_var_script.sh are not identical
export_var_script.sh are not identical
comm-par-test.sh are not identical
comm-par-test.sh are not identical
comm-par-test2.sh are not identical
comm-par-test2.sh are not identical
tee_web_index_bug.sh are not identical
tee_web_index_bug.sh are not identical
fun-def.sh are not identical
fun-def.sh are not identical
bigrams.sh are not identical
bigrams.sh are not identical
spell-grep.sh are not identical
spell-grep.sh are not identical
grep.sh are not identical
grep.sh are not identical
minimal_sort.sh are not identical
minimal_sort.sh are not identical
minimal_grep.sh are not identical
minimal_grep.sh are not identical
topn.sh are not identical
topn.sh are not identical
wf.sh are not identical
wf.sh are not identical
spell.sh are not identical
spell.sh are not identical
shortest_scripts.sh are not identical
shortest_scripts.sh are not identical
alt_bigrams.sh are not identical
alt_bigrams.sh are not identical
deadlock_test.sh are not identical
deadlock_test.sh are not identical
double_sort.sh are not identical
double_sort.sh are not identical
no_in_script.sh are not identical
no_in_script.sh are not identical
for_loop_simple.sh are not identical
for_loop_simple.sh are not identical
minimal_grep_stdin.sh are not identical
minimal_grep_stdin.sh are not identical
micro_10.sh are not identical
micro_10.sh are not identical
sed-test.sh are not identical
sed-test.sh are not identical
tr-test.sh are not identical
tr-test.sh are not identical
grep-test.sh are not identical
grep-test.sh are not identical
ann-agg.sh are not identical
ann-agg.sh are not identical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants