Request for error fix: FileNotFoundError When Running Gaussian Locally Without a Scratch Directory

Viewed 26

**Gaussian: **
(chemsmart) laurage@Zixuans-MacBook-Pro server % chemsmart run --fake gaussian -p test -P 28472 -l dimethylundecane_test -c 0 -m 1 opt
...
2026-09-11 16:33:45,655 - INFO - [chemsmart.jobs.runner] Using job runner: <class 'chemsmart.jobs.gaussian.runner.FakeGaussianJobRunner'> for job: GaussianOptJob<folder=/Users/laurage/.chemsmart/server, label=dimethylundecane_test, jobrunner=JobRunner<server=YamlServerSettings: /Users/laurage/.chemsmart/server/local.yaml>>
2026-09-11 16:33:45,659 - INFO - [chemsmart.jobs.runner] Using scratch=True for job runner: <class 'chemsmart.jobs.gaussian.runner.FakeGaussianJobRunner'>
2026-09-11 16:33:45,659 - INFO - [chemsmart.jobs.gaussian.runner] Obtaining executable from server: /Users/laurage/.chemsmart/server/local.yaml
Traceback (most recent call last):
File "/Users/laurage/chemsmart/chemsmart/cli/chemsmart", line 9, in
sys.exit(main())
File "/Users/laurage/chemsmart/chemsmart/cli/main.py", line 91, in main
entry_point(obj=obj)
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/Users/laurage/chemsmart/chemsmart/utils/cli.py", line 109, in invoke
return super().invoke(ctx)
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 1666, in _process_result
value = ctx.invoke(self._result_callback, value, **ctx.params)
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/opt/miniconda3/envs/chemsmart/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/laurage/chemsmart/chemsmart/cli/run.py", line 138, in process_pipeline
_run_single_job(job, jobrunner)
File "/Users/laurage/chemsmart/chemsmart/cli/run.py", line 80, in _run_single_job
typed_runner = jobrunner.from_job(
File "/Users/laurage/chemsmart/chemsmart/jobs/runner.py", line 511, in from_job
return selected_runner(
File "/Users/laurage/chemsmart/chemsmart/jobs/gaussian/runner.py", line 411, in init
super().init(
File "/Users/laurage/chemsmart/chemsmart/jobs/gaussian/runner.py", line 125, in init
super().init(
File "/Users/laurage/chemsmart/chemsmart/jobs/runner.py", line 243, in init
self._set_scratch()
File "/Users/laurage/chemsmart/chemsmart/jobs/runner.py", line 327, in _set_scratch
raise FileNotFoundError(
FileNotFoundError: Specified scratch dir does not exist: /Users/laurage/scratch

Gaussian + -- no scratch:
(chemsmart) laurage@Zixuans-MacBook-Pro server % chemsmart run --no-scratch --fake gaussian -p test -P 28472 -l dimethylundecane_test -c 0 -m 1 opt
...
2026-09-11 16:34:22,220 - INFO - [chemsmart.jobs.runner] Using job runner: <class 'chemsmart.jobs.gaussian.runner.FakeGaussianJobRunner'> for job: GaussianOptJob<folder=/Users/laurage/.chemsmart/server, label=dimethylundecane_test, jobrunner=JobRunner<server=YamlServerSettings: /Users/laurage/.chemsmart/server/local.yaml>>
2026-09-11 16:34:22,220 - INFO - [chemsmart.jobs.runner] Using scratch=False for job runner: <class 'chemsmart.jobs.gaussian.runner.FakeGaussianJobRunner'>
2026-09-11 16:34:22,220 - INFO - [chemsmart.jobs.gaussian.job] Running GaussianJob GaussianOptJob<folder=/Users/laurage/.chemsmart/server, label=dimethylundecane_test, jobrunner=FakeGaussianJobRunner<server=YamlServerSettings: /Users/laurage/.chemsmart/server/local.yaml>> with jobrunner FakeGaussianJobRunner<server=YamlServerSettings: /Users/laurage/.chemsmart/server/local.yaml>
2026-09-11 16:34:22,220 - INFO - [chemsmart.jobs.gaussian.runner] Obtaining executable from server: /Users/laurage/.chemsmart/server/local.yaml
2026-09-11 16:34:22,225 - INFO - [chemsmart.jobs.gaussian.runner] Local run is True.
2026-09-11 16:34:22,229 - INFO - [chemsmart.jobs.gaussian.writer] Finished writing Gaussian input file: /Users/laurage/.chemsmart/server/dimethylundecane_test_fake.com
2026-09-11 16:34:22,357 - INFO - [chemsmart.jobs.runner] Removing file /Users/laurage/.chemsmart/server/dimethylundecane_test_fake.err.
2026-09-11 16:34:22,357 - INFO - [chemsmart.jobs.runner] Removing file /Users/laurage/.chemsmart/server/dimethylundecane_test_fake.pbserr.
2026-09-11 16:34:22,357 - INFO - [chemsmart.jobs.runner] Removing file /Users/laurage/.chemsmart/server/dimethylundecane_test_fake.slurmerr.

2 Answers

Thanks Zixuan for flagging this error. The error message says that

FileNotFoundError: Specified scratch dir does not exist: /Users/laurage/scratch

which means that the scratch directory is not set up. Adding a scratch folder in ~/scratch will solve this issue. CHEMSMART assumes that Gaussian job runs will execute in the scratch folder.

One can do the following to link scratch folder to ~/scratch:

ln -s /path/to/scratch/folder ~/scratch

which creates a symbolic link in home directory ~/scratch that points to the actual scratch path on the server/cluster/HPC.

By default, CHEMSMART will run Gaussian/ORCA jobs in scratch folder, as we want to avoid large .rwf/*tmp files flooding the job folder, if the calculation does not terminate normally.

Hope this helps!

As you can see, adding the flag --no-scratch will execute the job in job folder, without running in scratch.

This change of scratch detection in PR https://github.com/xinglong-zhang/chemsmart/pull/691 makes the job run in job submission folder, if scratch directory cannot be found.

It is advisable to set the scratch folder and run jobs in scratch to avoid filling the job folder with huge temperory files from intermediate or incomplete calculations. In installing and configuring CHEMSMART, you will be asked to provide the scratch path, but if that was not set, the symbolic link method in the previous answer works as well.

Related