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

Set up custom command in ir.py #723

Draft
wants to merge 1 commit into
base: future
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions compiler/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from pash_annotations.datatypes.CommandInvocationWithIOVars import (
CommandInvocationWithIOVars,
)
from pash_annotations.annotation_generation.annotation_generators.InputOutputInfoGeneratorCustom import InputOutputInfoGeneratorCustom
from pash_annotations.annotation_generation.annotation_generators.ParallelizabilityInfoGeneratorCustom import ParallelizabilityInfoGeneratorCustom


from annotations_utils.util_parsing import parse_arg_list_to_command_invocation
from annotations_utils.util_cmd_invocations import (
Expand Down Expand Up @@ -243,9 +246,29 @@ def compile_command_to_DFG(fileIdGen, command, options, redirections=None):
command_invocation
)
if io_info is None:
raise UnparallelizableError(
f"InputOutputInformation for {format_arg_chars(command)} not provided so considered side-effectful."
)
#get input,output,parallelizability info of the command
#print(f"InputOutputInformation for {format_arg_chars(command)} not provided")
#input_info = input(f"Enter input:")
#output_info = input(f"Enter output:")

# info to provide: parallelizer_list, round_robin_comp_with_cat, is_commutative (for optimisations)
#print(f"ParallelizabilityInformation for {format_arg_chars(command)} not provided")
#parallelizability_info_parallelizer_list = input(f"Enter parallelizer list info:")
#parallelizability_info_round_robin_comp_with_cat = input(f"Enter round robin info:")
#parallelizability_info_is_commutative = input(f"Enter commutative info [Y/N]:")

#generate_info
custom_generator_io = InputOutputInfoGeneratorCustom(command)
custom_generator_io.generate_info()

custom_generator_parallelizability = ParallelizabilityInfoGeneratorCustom(command)
custom_generator_parallelizability.generate_info()

print("Inline Custom Command Attempt")
#
#raise UnparallelizableError(
# f"InputOutputInformation for {format_arg_chars(command)} not provided so considered side-effectful."
#)
if io_info.has_other_outputs():
raise UnparallelizableError(
f"Command {format_arg_chars(command)} has outputs other than streaming."
Expand Down
15 changes: 15 additions & 0 deletions evaluation/intro/newfunctiontest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cd "$(dirname $0)"

[ -z $PASH_TOP ] && {
echo "PASH_TOP not set, maybe $(git rev-parse --show-toplevel)?"
exit
}
FILE="input/100M.txt"

#test function to make a custom command for
our_func() {
grep "$1"
}


cat "$FILE" | our_func choleric
Loading