copy_file_from_scratch

psi4.driver.copy_file_from_scratch(filename, prefix, namespace, unit, move=False)[source]

Move a file out of scratch following the naming convention.

Parameters:
  • filename (str) – Full path to target file.

  • prefix (str) – Computation prefix, usually ‘psi’.

  • namespace (str) – Context namespace, usually molecule name.

  • unit (int) – Unit number, e.g. 32

  • move (bool) – Whether to copy (default) or move?

Examples

>>> # Assume PID is 12345 and SCRATCH is /scratch/parrish/
>>> copy_file_to_scratch('temp', 'psi', 'h2o', 32):
Out[1]:  -cp /scratch/parrish/psi.12345.h2o.32 .temp
>>> copy_file_to_scratch('/tmp/temp', 'psi', 'h2o', 32):
Out[2]:  -cp /scratch/parrish/psi.12345.h2o.32 /tmp/temp
>>> copy_file_to_scratch('/tmp/temp', 'psi', '', 32):
Out[3]:  -cp /scratch/parrish/psi.12345.32 /tmp/temp
>>> copy_file_to_scratch('/tmp/temp', 'psi', '', 32, True):
Out[4]:  -mv /scratch/parrish/psi.12345.32 /tmp/temp