Skip to content

Commit

Permalink
Fixed the simulator without custom folder job run error. (NVIDIA#3090)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhwen authored Dec 4, 2024
1 parent 5ef575f commit 245f0f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nvflare/private/fed/app/simulator/simulator_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,10 @@ def do_one_task(self, client, num_of_threads, gpu, lock, timeout=60.0, task_name
command += " --gpu " + str(gpu)
new_env = os.environ.copy()
add_custom_dir_to_path(app_custom_folder, new_env)
if self.server_custom_folder:
if os.path.isdir(self.server_custom_folder):
python_paths = new_env[SystemVarName.PYTHONPATH].split(os.pathsep)
python_paths.remove(self.server_custom_folder)
if self.server_custom_folder in python_paths:
python_paths.remove(self.server_custom_folder)
new_env[SystemVarName.PYTHONPATH] = os.pathsep.join(python_paths)

_ = subprocess.Popen(shlex.split(command, True), preexec_fn=os.setsid, env=new_env)
Expand Down

0 comments on commit 245f0f5

Please sign in to comment.