Esempio n. 1
0
 def postprocess(self):
     if self.gzipped:
         if "edique" in os.environ["PBS_JOBID"] or "hopque" in os.environ["PBS_JOBID"]:
             cur_dir = os.getcwd()
             file_list = [os.path.join(cur_dir, name) for name in glob.glob("*")]
             gzip_cmd = shlex.split("aprun -n1 -N1 gzip") + file_list
             subprocess.call(gzip_cmd)
         else:
             gzip_dir(".")
Esempio n. 2
0
 def postprocess(self):
     if self.gzipped:
         if "PBS_JOBID" in os.environ and "edique" in os.environ["PBS_JOBID"]:
             cur_dir = os.getcwd()
             file_list = [os.path.join(cur_dir, name) for name in glob.glob("*")]
             nodelist = os.environ["QCNODE"]
             gzip_cmd = shlex.split("aprun -n1 -N1 -L {} gzip".format(nodelist)) + file_list
             subprocess.call(gzip_cmd)
         else:
             gzip_dir(".")
Esempio n. 3
0
 def postprocess(self):
     if self.gzipped:
         if "NERSC_HOST" in os.environ and os.environ["NERSC_HOST"] == "edison":
             cur_dir = os.getcwd()
             file_list = [os.path.join(cur_dir, name) for name in glob.glob("*")]
             nodelist = os.environ["QCNODE"]
             gzip_cmd = shlex.split("srun -N 1 --ntasks-per-node 1 --nodelist  "
                                    "{} gzip".format(nodelist)) + file_list
             subprocess.call(gzip_cmd)
         else:
             gzip_dir(".")
Esempio n. 4
0
 def postprocess(self):
     if self.gzipped:
         if "NERSC_HOST" in os.environ and os.environ["NERSC_HOST"] == "edison":
             cur_dir = os.getcwd()
             file_list = [os.path.join(cur_dir, name) for name in glob.glob("*")]
             nodelist = os.environ["QCNODE"]
             gzip_cmd = shlex.split("srun -N 1 --ntasks-per-node 1 --nodelist  "
                                    "{} gzip".format(nodelist)) + file_list
             subprocess.call(gzip_cmd)
         else:
             gzip_dir(".")
Esempio n. 5
0
    def postprocess(self):
        """
        Postprocessing includes renaming and gzipping where necessary.
        Also copies the magmom to the incar if necessary
        """
        for f in VASP_OUTPUT_FILES + [self.output_file]:
            if os.path.exists(f):
                if self.final and self.suffix != "":
                    shutil.move(f, "{}{}".format(f, self.suffix))
                elif self.suffix != "":
                    shutil.copy(f, "{}{}".format(f, self.suffix))

        if self.copy_magmom and not self.final:
            try:
                outcar = Outcar("OUTCAR")
                magmom = [m['tot'] for m in outcar.magnetization]
                incar = Incar.from_file("INCAR")
                incar['MAGMOM'] = magmom
                incar.write_file("INCAR")
            except:
                logging.error('MAGMOM copy from OUTCAR to INCAR failed')

        if self.gzipped:
            gzip_dir(".")
Esempio n. 6
0
 def postprocess(self):
     if self.gzipped:
         gzip_dir(".")