Skip to content

Commit

Permalink
changed on_exit
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Sep 10, 2019
1 parent 14fa365 commit 72eb9ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test_tube/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ def get_meta_copy(self):
return DDPExperiment(self)

def on_exit(self):
self.__clean_dir()
if self.rank == 0:
self.close()

self.__clean_dir()


def __clean_dir(self):
files = os.listdir(self.save_dir)

Expand All @@ -176,7 +178,6 @@ def __clean_dir(self):

for f in files:
if str(self.process) in f:
self.close()
os.remove(os.path.join(self.save_dir, f))

def argparse(self, argparser):
Expand Down

0 comments on commit 72eb9ba

Please sign in to comment.