@@ -113,9 +113,18 @@ def _makedir(self, *dirs, wipeout=False):
113113 os .makedirs (ret , exist_ok = True )
114114 return ret
115115
116- def _run_suffix (self ):
116+ def _format_dirs (self , * dirs ):
117+ try :
118+ last = dirs [- 1 ]
119+ except IndexError :
120+ return dirs
121+
117122 current_run = runtime ().current_run
118- return '_%s' % current_run if current_run > 0 else ''
123+ if current_run == 0 :
124+ return dirs
125+
126+ last += '_retry%s' % current_run
127+ return (* dirs [:- 1 ], last )
119128
120129 @property
121130 def timestamp (self ):
@@ -125,21 +134,17 @@ def timestamp(self):
125134 def output_prefix (self ):
126135 """The output prefix directory of ReFrame."""
127136 if self .outputdir is None :
128- return os .path .join (self .prefix , 'output' + self ._run_suffix (),
129- self .timestamp )
137+ return os .path .join (self .prefix , 'output' , self .timestamp )
130138 else :
131- return os .path .join (self .outputdir + self ._run_suffix (),
132- self .timestamp )
139+ return os .path .join (self .outputdir , self .timestamp )
133140
134141 @property
135142 def stage_prefix (self ):
136143 """The stage prefix directory of ReFrame."""
137144 if self .stagedir is None :
138- return os .path .join (self .prefix , 'stage' + self ._run_suffix (),
139- self .timestamp )
145+ return os .path .join (self .prefix , 'stage' , self .timestamp )
140146 else :
141- return os .path .join (self .stagedir + self ._run_suffix (),
142- self .timestamp )
147+ return os .path .join (self .stagedir , self .timestamp )
143148
144149 @property
145150 def perflog_prefix (self ):
@@ -149,10 +154,12 @@ def perflog_prefix(self):
149154 return self .perflogdir
150155
151156 def make_stagedir (self , * dirs , wipeout = True ):
152- return self ._makedir (self .stage_prefix , * dirs , wipeout = wipeout )
157+ return self ._makedir (self .stage_prefix ,
158+ * self ._format_dirs (* dirs ), wipeout = wipeout )
153159
154160 def make_outputdir (self , * dirs , wipeout = True ):
155- return self ._makedir (self .output_prefix , * dirs , wipeout = wipeout )
161+ return self ._makedir (self .output_prefix ,
162+ * self ._format_dirs (* dirs ), wipeout = wipeout )
156163
157164
158165class RuntimeContext :
0 commit comments