Sbatch chdir flag partially working in submit job app

Hello,

I have an app which allows users to submit job to Slurm cluster.
I want output goes to working directory not under ondemand session directory:

ondemand/data/sys/dashboard/batch_connect/sys/submit-ansys-job/output/<session_id>/

I use --chdir in my submit script and I see that some output goes to the working directory, but when job starts solving and writing results it does it under session directory.

Is it possible to force all output to the working directory?

My job_script_options.json
{
“job_name”: “sys/dashboard/sys/submit-ansys-job”,
“workdir”: “~/ondemand/data/sys/dashboard/batch_connect/sys/submit-ansys-job/output/0a923d51-58e3-4a36-889a-43f2b910e241”,
“output_path”: “~/ondemand/data/sys/dashboard/batch_connect/sys/submit-ansys-job/output/0a923d51-58e3-4a36-889a-43f2b910e241/output.log”,
“shell_path”: “/bin/bash”,
“queue_name”: “sky,epyc,bdw”,
“qos”: “lowprio_8job”,
“wall_time”: 3600,
“native”: [
“–job-name”,
“test”,
“–ntasks”,
“200”,
“–license”,
“cfd_solve_level1@slurmdb:1,cfd_solve_level2@slurmdb:1,cfd_solve_level3@slurmdb:1,anshpc@slurmdb:200”,
“–chdir”,
“/cluster/data/misc/admins/sofya”,
“–error”,
“%x.%j.out”,
“–output”,
“%x.%j.out”
]
}

I see “%x.%j.out” goes to working directory but not actual job results.

According to these docs Batch Connect Script Options — Open OnDemand 3.1.0 documentation

Users cannot specify workdir this in batch connect applications. The same goes for output_path.

@jeff.ohrstrom am I out of luck and cannot change where the result of my job go?

No I don’t think you can.

Gotcha. I was able to go around by changing to my slurm working directory in my script.erb and starting job from there. I created a link from my session id folder to that slurm workdir.

Is not as elegant as having session id link in the web browser. I’m talking about this:

If I want to make another link on this screen pointing to slurm working directory which files should edit?

Can you please steer me in a right direction documentation wise?

Thank you