Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion hyperactor_mesh/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,18 @@ fn create_file_writer(
let (path, filename) = log_file_path(env)?;
let path = Path::new(&path);
let mut full_path = PathBuf::from(path);
full_path.push(format!("{}_{}.{}", filename, local_rank, suffix));

// This is the PID of the "owner" of the proc mesh, the proc mesh
// this proc "belongs" to. In other words,the PID of the process
// that invokes `cmd.spawn()` (where `cmd: &mut
// tokio::process::Command`) to start the process that will host
// the proc that this file writer relates to.
let file_created_by_pid = std::process::id();

full_path.push(format!(
"{}_{}_{}.{}",
filename, file_created_by_pid, local_rank, suffix
));
let file = std::fs::OpenOptions::new()
.create(true)
.append(true)
Expand Down