Skip to content

Commit

Permalink
Propagate active environment to new workers (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
clasqui authored Mar 27, 2023
1 parent 7f0d169 commit 86e8c1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Instrumentation/ExtraeLocalManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function Distributed.launch(manager::ExtraeLocalManager, params::Dict, launched:
bind_to = manager.restrict ? `127.0.0.1` : `$(LPROC.bind_addr)`
cookie = cluster_cookie()

active_project = Base.active_project()
hookline = """
using Distributed
using Extrae
Expand All @@ -29,7 +30,7 @@ function Distributed.launch(manager::ExtraeLocalManager, params::Dict, launched:

# Bug: Instead of using julia_cmd(exename), I directly use exename because idk howto access Base.julia_cmd
for i in 1:manager.np
cmd = `env EXTRAE_SKIP_AUTO_LIBRARY_INITIALIZE=1 $exename $exeflags --project=. --bind-to $bind_to -e "$hookline"`
cmd = `env EXTRAE_SKIP_AUTO_LIBRARY_INITIALIZE=1 $exename $exeflags --project=$active_project --bind-to $bind_to -e "$hookline"`
io = open(detach(setenv(cmd, dir=dir)), "r+")

# Cluster cookie is not passed through IO. Instead, we set it
Expand Down

0 comments on commit 86e8c1a

Please sign in to comment.