Skip to content

Commit

Permalink
Improve default scratch_dir selection
Browse files Browse the repository at this point in the history
  • Loading branch information
smcolby committed Aug 9, 2023
1 parent fc4b7f5 commit cfb953e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions isicle/qm.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ def save_geometry(self, fmt='xyz'):
".pdb", ".pkl".
'''
# Path operationspyth
self.temp_dir = isicle.utils.mkdtemp()
# Path operations
self.fmt = fmt.lower()
geomfile = os.path.join(self.temp_dir,
'{}.{}'.format(self.geom.basename,
Expand All @@ -156,7 +155,7 @@ def save_geometry(self, fmt='xyz'):
isicle.io.save(geomfile, self.geom)
self.geom.path = geomfile

def _configure_header(self, scratch_dir='/scratch', mem_global=1600,
def _configure_header(self, scratch_dir=None, mem_global=1600,
mem_heap=100, mem_stack=600):
'''
Generate header block of NWChem configuration.
Expand Down Expand Up @@ -662,7 +661,7 @@ def configure(self, tasks='energy', functional='b3lyp',
basis_set='6-31g*', ao_basis='cartesian', charge=0,
atoms=['C', 'H'], bonds=1, temp=298.15, cosmo=False, solvent='H2O',
gas=False, max_iter=150, mem_global=1600, mem_heap=100,
mem_stack=600, scratch_dir='/scratch', processes=12, command='nwchem'):
mem_stack=600, scratch_dir=None, processes=12, command='nwchem'):
'''
Configure NWChem simulation.
Expand Down Expand Up @@ -721,6 +720,10 @@ def configure(self, tasks='energy', functional='b3lyp',
cosmo = safelist(cosmo)
solvent = safelist(solvent)

# Set scratch directory
if scratch_dir is None:
scratch_dir = isicle.utils.mkdtemp()

# Container for final configuration script
config = ''

Expand Down

0 comments on commit cfb953e

Please sign in to comment.