Skip to content

Commit

Permalink
Merge pull request #779 from teojgo/feature/no_abs_sbatch_path
Browse files Browse the repository at this point in the history
[feat] Do not use absolute paths in generated batch scripts
  • Loading branch information
Vasileios Karakasis committed May 17, 2019
2 parents 6f9f7f5 + 50477ce commit 758f93e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ The generated job script for this example is the following:
#SBATCH --job-name="prerun_demo_check_daint_gpu_PrgEnv-gnu"
#SBATCH --time=0:10:0
#SBATCH --ntasks=1
#SBATCH --output=/path/to/stage/gpu/prerun_demo_check/PrgEnv-gnu/prerun_demo_check.out
#SBATCH --error=/path/to/stage/gpu/prerun_demo_check/PrgEnv-gnu/prerun_demo_check.err
#SBATCH --output=prerun_demo_check.out
#SBATCH --error=prerun_demo_check.err
#SBATCH --constraint=gpu
module load daint-gpu
module unload PrgEnv-cray
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ The generated job script for the test case we are currently inspecting is the fo
#SBATCH --job-name="rfm_Example1Test_job"
#SBATCH --time=0:10:0
#SBATCH --ntasks=1
#SBATCH --output=/path/to/stage/daint/gpu/PrgEnv-gnu/Example1Test/rfm_Example1Test_job.out
#SBATCH --error=/path/to/stage/daint/gpu/PrgEnv-gnu/Example1Test/rfm_Example1Test_job.err
#SBATCH --output=rfm_Example1Test_job.out
#SBATCH --error=rfm_Example1Test_job.err
#SBATCH --constraint=gpu
module load daint-gpu
module unload PrgEnv-cray
Expand Down
4 changes: 2 additions & 2 deletions reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def __init__(self,
self._num_cpus_per_task = num_cpus_per_task
self._use_smt = use_smt
self._script_filename = script_filename or '%s.sh' % name
self._stdout = stdout or os.path.join(workdir, '%s.out' % name)
self._stderr = stderr or os.path.join(workdir, '%s.err' % name)
self._stdout = stdout or '%s.out' % name
self._stderr = stderr or '%s.err' % name
self._time_limit = time_limit
self._nodelist = None

Expand Down
4 changes: 3 additions & 1 deletion reframe/core/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def cancel(self):

def finished(self):
super().finished()
done = os.path.exists(self.stdout) and os.path.exists(self.stderr)
with os_ext.change_dir(self.workdir):
done = os.path.exists(self.stdout) and os.path.exists(self.stderr)

if done:
t_now = datetime.now()
self._time_finished = self._time_finished or t_now
Expand Down
4 changes: 2 additions & 2 deletions unittests/test_launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def expected_command(self):
def expected_minimal_command(self):
return ('srun '
'--job-name=fake_job '
'--output=./fake_job.out '
'--error=./fake_job.err '
'--output=fake_job.out '
'--error=fake_job.err '
'--ntasks=1 '
'--foo')

Expand Down
11 changes: 6 additions & 5 deletions unittests/test_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def test_pass_in_retries(self):


class TaskEventMonitor(executors.TaskEventListener):
"""Event listener for monitoring the execution of the asynchronous execution
policy.
"""Event listener for monitoring the execution of the asynchronous
execution policy.
We need to make sure two things for the async policy:
Expand Down Expand Up @@ -240,9 +240,10 @@ def read_timestamps(self, tasks):
self.begin_stamps = []
self.end_stamps = []
for t in tasks:
with open(evaluate(t.check.stdout), 'r') as f:
self.begin_stamps.append(float(f.readline().strip()))
self.end_stamps.append(float(f.readline().strip()))
with os_ext.change_dir(t.check.stagedir):
with open(evaluate(t.check.stdout), 'r') as f:
self.begin_stamps.append(float(f.readline().strip()))
self.end_stamps.append(float(f.readline().strip()))

self.begin_stamps.sort()
self.end_stamps.sort()
Expand Down

0 comments on commit 758f93e

Please sign in to comment.