copy_file_to_scratch

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

Move a file into scratch following the naming convention.

Parameters:
  • filename (str) – Full path to 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 ./temp /scratch/parrish/psi.12345.h2o.32
>>> copy_file_to_scratch('/tmp/temp', 'psi', 'h2o', 32):
Out[2]:  -cp /tmp/temp /scratch/parrish/psi.12345.h2o.32
>>> copy_file_to_scratch('/tmp/temp', 'psi', '', 32):
Out[3]:  -cp /tmp/temp /scratch/parrish/psi.12345.32
>>> copy_file_to_scratch('/tmp/temp', 'psi', '', 32, True):
Out[4]:  -mv /tmp/temp /scratch/parrish/psi.12345.32