You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ParallelKernel/init_parallel_kernel.jl
+37-16Lines changed: 37 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -87,28 +87,49 @@ function init_parallel_kernel(caller::Module, package::Symbol, numbertype::DataT
87
87
end
88
88
89
89
90
+
functionMetadata_PK()
91
+
:(module$MOD_METADATA_PK # NOTE: there cannot be any newline before 'module $MOD_METADATA_PK' or it will create a begin end block and the module creation will fail.
createmeta_PK(caller::Module) =if!hasmeta_PK(caller) @eval(caller, $(Metadata_PK())) end
114
+
115
+
90
116
macrois_initialized() is_initialized(__module__) end
91
117
macroget_package() esc(get_package(__module__)) end# NOTE: escaping is required here, to avoid that the symbol is evaluated in this module, instead of just being returned as a symbol.
92
118
macroget_numbertype() get_numbertype(__module__) end
check_initialized(caller::Module) =if!is_initialized(caller) @NotInitializedError("no ParallelKernel macro or function can be called before @init_parallel_kernel in each module (missing call in $caller).") end
113
134
check_already_initialized(caller::Module) =ifis_initialized(caller) @IncoherentCallError("ParallelKernel has already been initialized for the module $caller.") end
ixd(count) =@ModuleInternalError("function ixd had not be evaluated at parse time")
13
-
iyd(count) =@ModuleInternalError("function iyd had not be evaluated at parse time")
14
-
izd(count) =@ModuleInternalError("function izd had not be evaluated at parse time")
12
+
ixd(count) =@ModuleInternalError("function ixd had not been evaluated at parse time")
13
+
iyd(count) =@ModuleInternalError("function iyd had not been evaluated at parse time")
14
+
izd(count) =@ModuleInternalError("function izd had not been evaluated at parse time")
15
15
16
+
const MOD_METADATA_PK =gensym_world("__metadata_PK__", @__MODULE__) # # TODO: name mangling should be used here later, or if there is any sense to leave it like that then at check whether it's available must be done before creating it
Copy file name to clipboardExpand all lines: src/init_parallel_stencil.jl
+51-24Lines changed: 51 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,41 @@ function init_parallel_stencil(caller::Module, package::Symbol, numbertype::Data
68
68
end
69
69
70
70
71
+
functionMetadata_PS()
72
+
:(module$MOD_METADATA_PS # NOTE: there cannot be any newline before 'module $MOD_METADATA_PS' or it will create a begin end block and the module creation will fail.
createmeta_PS(caller::Module) =if!hasmeta_PS(caller) @eval(caller, $(Metadata_PS())) end
104
+
105
+
71
106
macrois_initialized() is_initialized(__module__) end
72
107
macroget_package() esc(get_package(__module__)) end# NOTE: escaping is required here, to avoid that the symbol is evaluated in this module, instead of just being returned as a symbol.
73
108
macroget_numbertype() get_numbertype(__module__) end
@@ -78,30 +113,22 @@ macro get_memopt() get_memopt(__module__) end
78
113
macroget_nonconst_metadata() get_nonconst_metadata(__module__) end
check_initialized(caller::Module) =if!is_initialized(caller) @NotInitializedError("no ParallelStencil macro or function can be called before @init_parallel_stencil in each module (missing call in $caller).") end
0 commit comments