Parallel processing 如何在Julia中处处定义宏?
我有一个微不足道的宏Parallel processing 如何在Julia中处处定义宏?,parallel-processing,macros,julia,Parallel Processing,Macros,Julia,我有一个微不足道的宏 macro lit_str(s) s end 我用它来生成正则表达式模式。(上下文)。通常,我会将其包装在一个名为HelperFunctions的模块中(并使用``export@lit\u str导出它)。我试图在通过RemoteRef调用的函数中使用它,但即使我这样做了 @到处使用HelperFunctions 我得到一个错误,比如 exception on exception on 3: exception on 2: 4: ERROR: @lit_str n
macro lit_str(s)
s
end
我用它来生成正则表达式模式。(上下文)。通常,我会将其包装在一个名为HelperFunctions的模块中(并使用``export@lit\u str导出它)。我试图在通过RemoteRef调用的函数中使用它,但即使我这样做了
@到处使用HelperFunctions
我得到一个错误,比如
exception on exception on 3: exception on 2: 4: ERROR: @lit_str not defined
in eval at C:\cygwin\home\vagrant\buildbot\slave\package_win8_1-x64\build\base\sysimg.jl:7
in anonymous at multi.jl:1305
in anonymous at multi.jl:855
in run_work_thunk at multi.jl:621
in anonymous at task.jl:855
ERROR: @lit_str not defined
in eval at C:\cygwin\home\vagrant\buildbot\slave\package_win8_1-x64\build\base\sysimg.jl:7
in anonymous at multi.jl:1305
in anonymous at multi.jl:855
in run_work_thunk at multi.jl:621
in anonymous at task.jl:855
ERROR: @lit_str not defined
in eval at C:\cygwin\home\vagrant\buildbot\slave\package_win8_1-x64\build\base\sysimg.jl:7
in anonymous at multi.jl:1305
in anonymous at multi.jl:855
in run_work_thunk at multi.jl:621
in anonymous at task.jl:855
是否有任何方法可以导出宏,以便由remoteref生成的进程使用它?这是一个很简单的问题,但我会在这里提出解决方案,以防其他人也有同样的问题。我需要这样做
addprocs(numprocs)
以前
@everywhere using WhatNot
因为我是在Jupyter中做这件事的,而不是调用julia-p8myfile.jl