diff --git a/docs/advanced.rst b/docs/advanced.rst index a76e90c2ca..71b1a82327 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -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 diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 43b1458ca9..7e450458bf 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -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 diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index 27323cdc3d..a5b3d27453 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -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 diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index 632bcbc412..96732d3319 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -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 diff --git a/unittests/test_launchers.py b/unittests/test_launchers.py index f4847e4711..207753e62e 100644 --- a/unittests/test_launchers.py +++ b/unittests/test_launchers.py @@ -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') diff --git a/unittests/test_policies.py b/unittests/test_policies.py index 0423dda65d..4af6263e20 100644 --- a/unittests/test_policies.py +++ b/unittests/test_policies.py @@ -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: @@ -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()