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
tr = opentelemetry.trace.getTracer("parfor_example");
sp = startSpan(tr, "main function");
...
parfor i = 1:8
% start a span for this iteration, using the tracer “tr” from main function
sp_i = startSpan(tr, "Iteration" + i);
...
end
Since tr is used both in and outside of the parfor block, parfor would copy and send it to the workers. Running this code would result in this error:
Error using . (line 63)
Unknown proxy ID 3
Error in opentelemetry.trace.Tracer/startSpan (line 125)
id = obj.Proxy.startSpan(spname, contextid, spankind, starttime, ...
This is because the global singleton proxymanager is not copied. In the workers, the proxies only exist in MATLAB but not in C++.
To make objects correctly propagate through to parfor blocks, they need to implement custom save/load methods which should also save/load their C++ counterparts.
The text was updated successfully, but these errors were encountered:
The following code would fail:
tr = opentelemetry.trace.getTracer("parfor_example");
sp = startSpan(tr, "main function");
...
parfor i = 1:8
% start a span for this iteration, using the tracer “tr” from main function
sp_i = startSpan(tr, "Iteration" + i);
...
end
Since tr is used both in and outside of the parfor block, parfor would copy and send it to the workers. Running this code would result in this error:
Error using . (line 63)
Unknown proxy ID 3
Error in opentelemetry.trace.Tracer/startSpan (line 125)
id = obj.Proxy.startSpan(spname, contextid, spankind, starttime, ...
This is because the global singleton proxymanager is not copied. In the workers, the proxies only exist in MATLAB but not in C++.
To make objects correctly propagate through to parfor blocks, they need to implement custom save/load methods which should also save/load their C++ counterparts.
The text was updated successfully, but these errors were encountered: