From 759d98bfbbc2b9a8cc70596b8534ca15c0183d2f Mon Sep 17 00:00:00 2001 From: Samuel Omlin Date: Thu, 16 Mar 2023 19:38:27 +0100 Subject: [PATCH 1/2] make hide communication compatible with incremental compilation --- src/ParallelKernel/shared.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ParallelKernel/shared.jl b/src/ParallelKernel/shared.jl index 6cbbc556..3fde65e2 100644 --- a/src/ParallelKernel/shared.jl +++ b/src/ParallelKernel/shared.jl @@ -180,8 +180,11 @@ is_call(arg) = ( isa(arg, Expr) && (arg.head == :call) ) is_block(arg) = ( isa(arg, Expr) && (arg.head == :block) ) is_parallel_call(x) = isexpr(x, :macrocall) && (x.args[1] == Symbol("@parallel") || x.args[1] == :(@parallel)) -macro get_args(args...) return args end -extract_args(call::Expr, macroname::Symbol) = eval(substitute(deepcopy(call), macroname, Symbol("@get_args"))) +function extract_args(call::Expr, macroname::Symbol) + if (call.head == :macrocall) @ModuleInternalError("argument is not a macro call.") end + if (call.args[1] != macroname) @ModuleInternalError("unexpected macro name.") end + return (call.args[3:end]...,) +end extract_kernelcall_args(call::Expr) = split_args(call.args[2:end]; in_kernelcall=true) From cd2d3d07aa3b2eab69725cc0533b3a789f95783b Mon Sep 17 00:00:00 2001 From: Samuel Omlin Date: Thu, 16 Mar 2023 19:52:04 +0100 Subject: [PATCH 2/2] make hide communication compatible with incremental compilation --- src/ParallelKernel/shared.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ParallelKernel/shared.jl b/src/ParallelKernel/shared.jl index 3fde65e2..142bf001 100644 --- a/src/ParallelKernel/shared.jl +++ b/src/ParallelKernel/shared.jl @@ -181,7 +181,7 @@ is_block(arg) = ( isa(arg, Expr) && (arg.head == :block) ) is_parallel_call(x) = isexpr(x, :macrocall) && (x.args[1] == Symbol("@parallel") || x.args[1] == :(@parallel)) function extract_args(call::Expr, macroname::Symbol) - if (call.head == :macrocall) @ModuleInternalError("argument is not a macro call.") end + if (call.head != :macrocall) @ModuleInternalError("argument is not a macro call.") end if (call.args[1] != macroname) @ModuleInternalError("unexpected macro name.") end return (call.args[3:end]...,) end