Skip to content

Commit

Permalink
Fix cwd bug in lsf_driver. Needs to be different from pbs
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Feb 12, 2024
1 parent 2f51097 commit c171a3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ert/scheduler/lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ async def _submit_once(
name,
script,
# skipping args for now, it might not work?
cwd, # assuming job_dispatch.py will handle cwd
]
)
logger.debug(f"Submitting to LSF with command {shlex.join(bsub_with_args)}")
process = await asyncio.create_subprocess_exec(
*bsub_with_args,
cwd=cwd,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
Expand All @@ -147,7 +147,7 @@ async def _submit_once(
f"Command \"{' '.join(bsub_with_args)}\" failed with error message: {stderr.decode()}"
)
raise RuntimeError from err
logger.info(f"Realization {iens} accepted by LSF, got LSF id {job_id}")
logger.info(f"Realization {iens} accepted by LSF, got id {job_id}")

(Path(cwd) / LSF_INFO_JSON_FILENAME).write_text(
json.dumps({"job_id": job_id}), encoding="utf-8"
Expand Down
6 changes: 3 additions & 3 deletions tests/integration_tests/scheduler/bin/bsub
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ do
done
shift $((OPTIND-1))

jobdir="${PYTEST_TMP_PATH}/mock_jobs"
jobdir="${PYTEST_TMP_PATH:-.}/mock_jobs"
jobid="${RANDOM}"

mkdir -p "${PYTEST_TMP_PATH}/mock_jobs"
mkdir -p "${PYTEST_TMP_PATH:-.}/mock_jobs"
echo $@ > "${jobdir}/${jobid}.script"
echo "$name" > "${PYTEST_TMP_PATH}/mock_jobs/${jobid}.name"
echo "$name" > "${PYTEST_TMP_PATH:-.}/mock_jobs/${jobid}.name"

bash "$(dirname $0)/lsfrunner" "${jobdir}/${jobid}" >/dev/null 2>/dev/null &
disown
Expand Down

0 comments on commit c171a3c

Please sign in to comment.