AaroBEC scripts touch files indicating finished job.

Former-commit-id: 0786fba4eb57bcce086de0f123d53a80606e5bed
This commit is contained in:
Marek Nečada 2019-03-26 13:35:30 +02:00
parent f23edf0d71
commit 9b50196ae6
2 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,7 @@
# coding: utf-8
from qpms import Particle, CTMatrix, BaseSpec, FinitePointGroup, ScatteringSystem, TMatrixInterpolator, eV, hbar, c, MaterialInterpolator
from qpms.symmetries import point_group_info
from pathlib import Path
import numpy as np
import os
import sys
@ -55,7 +56,8 @@ k = n * omega / c
for iri in range(ss.nirreps):
destpath = os.path.join(outputdatadir, 'Nx%d_Ny%d_%geV_ir%d.npz'%(Nx, Ny, omega/eV*hbar, iri))
if os.path.isfile(destpath) and not rewrite_output:
touchpath = os.path.join(outputdatadir, 'Nx%d_Ny%d_%geV_ir%d.done'%(Nx, Ny, omega/eV*hbar, iri))
if (os.path.isfile(destpath) or os.path.isfile(touchpath)) and not rewrite_output:
print(destpath, 'already exists, skipping')
continue
mm_iri = ss.modeproblem_matrix_packed(k, iri)
@ -67,5 +69,6 @@ for iri in range(ss.nirreps):
S=S[starti:], omega=omega, Vh = Vh[starti:], iri=iri, Nx = Nx, Ny= Ny )
del S
del Vh
Path(touchpath).touch()
# Don't forget to conjugate Vh before transforming it to the full vector!

View File

@ -5,6 +5,7 @@ from qpms.symmetries import point_group_info
import numpy as np
import os
import sys
from pathlib import Path
nm = 1e-9
rewrite_output = '--rewrite-output' in sys.argv
@ -58,7 +59,8 @@ k = n * omega / c
for iri in range(ss.nirreps):
destpath = os.path.join(outputdatadir, 'Nx%d_Ny%d_%geV_ir%d_r%gnm.npz'%(Nx, Ny, omega/eV*hbar, iri, eqv_sph_radius/nm))
if os.path.isfile(destpath) and not rewrite_output:
touchpath = os.path.join(outputdatadir, 'Nx%d_Ny%d_%geV_ir%d_r%gnm.done'%(Nx, Ny, omega/eV*hbar, iri, eqv_sph_radius/nm))
if (os.path.isfile(destpath) or os.path.isfile(touchpath)) and not rewrite_output:
print(destpath, 'already exists, skipping')
continue
mm_iri = ss.modeproblem_matrix_packed(k, iri)
@ -70,5 +72,6 @@ for iri in range(ss.nirreps):
S=S[starti:], omega=omega, Vh = Vh[starti:], iri=iri, Nx = Nx, Ny= Ny )
del S
del Vh
Path(touchpath).touch()
# Don't forget to conjugate Vh before transforming it to the full vector!