If you’re using torch.multiprocessing (which you probably should be doing), you’ll get the process index as the first parameter of your entry point function. You can consider index 0 to be your master process and do all of your summary writing in that process.
def my_entry_point(index):
  if index == 0:
    writer = SummaryWriter(summary_dir)
    writer.add_scalar('test', 1.0, 1)

torch.multiprocessing.spawn(my_entry_point, args=(), nprocs=2)