Skip to content

@__FILE__ not available on workers #17500

@artas360

Description

@artas360

Hi all,
it seems that the @__FILE__ macro doesn't not return the expected result when evaluated by workers.
To illustrate this issue you can create a test.jl script containing the following code:

@everywhere f = @__FILE__;
println(pmap(x->f, workers()));

Which, when running julia test.jl prints Any["/tmp/test.jl"] as expected. However with julia -p2 the result is Any["",""], which leads to some issues when trying to reliably access files across workers.

The tests were ran with:

Julia Version 0.4.6
Commit 2e358ce (2016-06-19 17:16 UTC)

and

Julia Version 0.5.0-dev+5504
Commit c7ca319 (2016-07-19 12:45 UTC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs testsUnit tests are required for this changeparallelismParallel or distributed computation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions