Ejemplo n.º 1
0
    def main(self):
        coords = self._search_for_input_files(self.params.args)
        for coord in coords:
            gc3libs.log.info("Processing input file '%s' ..." % coord)
            # XXX: how do we get a unique name for each coord?  for
            # now, assume the directory containing the `coord` file
            # gives the unique name
            name = os.path.basename(os.path.dirname(coord))

            ridft_define_in = Template(
                RIDFT_DEFINE_IN, acceptable_ridft_basis_set,
                TITLE=name,
                ORB_BASIS=self.params.bas,
                RIJK_BASIS=self.params.jkbas,
                RIDFT_MEMORY = [self.params.memory]
                ) # end of RIDFT template

            ricc2_define_in = Template(
                RICC2_DEFINE_IN, acceptable_ricc2_basis_set,
                # the ORB_BASIS will be derived from the RIDFT_DEFINE_IN template
                CBAS_BASIS=self.params.cbas,
                CABS_BASIS=self.params.cabs,
                RICC2_MEMORY = [self.params.memory],
                ) # end of RICC2 template

            for ridft_in in expansions(ridft_define_in):
                orb_basis = ridft_in._keywords['ORB_BASIS']
                self._make_turbomole_files(
                    coord,
                    ridft_in,
                    # ricc2_ins
                    list(expansions(ricc2_define_in,
                                    ORB_BASIS=orb_basis)),
                    os.path.join(self.params.output_dir, name))
Ejemplo n.º 2
0
    def __init__(self,
                 title,
                 coord,
                 bases,
                 jkbases,
                 cbases,
                 cabses,
                 work_dir,
                 valid1=acceptable_ridft_basis_set,
                 valid2=acceptable_ricc2_basis_set,
                 **extra_args):
        """
        Create a new tasks that runs several analyses in parallel, one
        for each accepted combination of orbital and RIJK basis.
        """
        extra_args.setdefault('memory',
                              2000)  # XXX: check with `requested_memory`

        ridft_define_in = Template(RIDFT_DEFINE_IN,
                                   valid1,
                                   TITLE=title,
                                   ORB_BASIS=bases,
                                   RIJK_BASIS=jkbases,
                                   RIDFT_MEMORY=[extra_args['memory']
                                                 ])  # end of RIDFT template

        ricc2_define_in = Template(
            RICC2_DEFINE_IN,
            valid2,
            # the ORB_BASIS will be derived from the RIDFT_DEFINE_IN template
            CBAS_BASIS=cbases,
            CABS_BASIS=cabses,
            RICC2_MEMORY=[extra_args['memory']],
        )  # end of RICC2 template

        tasks = []
        for ridft in expansions(ridft_define_in):
            orb_basis = ridft._keywords['ORB_BASIS']
            tasks.append(
                BasisSweepPasses(
                    title + '.seq', coord, ridft,
                    list(expansions(ricc2_define_in, ORB_BASIS=orb_basis)),
                    work_dir, **extra_args))
        ParallelTaskCollection.__init__(self, title, tasks)
Ejemplo n.º 3
0
    def __init__(self, title, coord, bases, jkbases, cbases, cabses, work_dir,
                 valid1=acceptable_ridft_basis_set,
                 valid2=acceptable_ricc2_basis_set,
                 **extra_args):
        """
        Create a new tasks that runs several analyses in parallel, one
        for each accepted combination of orbital and RIJK basis.
        """
        extra_args.setdefault('memory', 2000) # XXX: check with `requested_memory`

        ridft_define_in = Template(
            RIDFT_DEFINE_IN, valid1,
            TITLE=title,
            ORB_BASIS=bases,
            RIJK_BASIS=jkbases,
            RIDFT_MEMORY = [extra_args['memory']]
            ) # end of RIDFT template

        ricc2_define_in = Template(
            RICC2_DEFINE_IN, valid2,
            # the ORB_BASIS will be derived from the RIDFT_DEFINE_IN template
            CBAS_BASIS=cbases,
            CABS_BASIS=cabses,
            RICC2_MEMORY = [extra_args['memory']],
            ) # end of RICC2 template

        tasks = [ ]
        for ridft in expansions(ridft_define_in):
            orb_basis = ridft._keywords['ORB_BASIS']
            tasks.append(
                BasisSweepPasses(
                    title + '.seq', coord, ridft,
                    list(expansions(ricc2_define_in,
                                    ORB_BASIS=orb_basis)),
                    work_dir, **extra_args))
        ParallelTaskCollection.__init__(self, title, tasks)
            acceptable_gbasis_and_ngauss,
            GBASIS=["STO", "N21", "N31", "N311"],
            NGAUSS=[2, 3, 4, 5, 6],
            NPFUNC=["", "NPFUNC=1"],
            NDFUNC=["", "NDFUNC=1"],
            NFFUNC=["", "NFFUNC=1"],
        ),
    ],  # end of BASIS
    ISPHER=[-1, +1],  # 0 is also a legal value; -1 is default
)  # end of GAMESS_INP

## main

if "__main__" == __name__:
    fmt = "gamess_%0" + str(options.width) + "d"
    for n, t in enumerate(expansions(GAMESS_INP)):
        if len(args) == 0:
            # no BASENAME, print to stdout
            print("==== Input file #" + (fmt % n) + " ====")
            print(t)
        else:
            if t._keywords.has_key('DFTTYP'):
                dfttyp = t._keywords['DFTTYP']
            else:
                dfttyp = 'NODFT'
            scftyp = t._keywords['SCFTYP']
            dirname = os.path.join(dfttyp, scftyp)
            if not os.path.exists(dirname):
                os.makedirs(dirname)
            filename = os.path.join(dirname, args[0] + (fmt % n) + '.inp')
            output = open(filename, 'w+')
Ejemplo n.º 5
0
            GBASIS=["STO", "N21", "N31", "N311"],
            NGAUSS=[2, 3, 4, 5, 6],
            NPFUNC=["", "NPFUNC=1"],
            NDFUNC=["", "NDFUNC=1"],
            NFFUNC=["", "NFFUNC=1"],
        ),
    ],  # end of BASIS
    ISPHER=[-1, +1],  # 0 is also a legal value; -1 is default
)  # end of GAMESS_INP


## main

if "__main__" == __name__:
    fmt = "gamess_%0" + str(options.width) + "d"
    for n, t in enumerate(expansions(GAMESS_INP)):
        if len(args) == 0:
            # no BASENAME, print to stdout
            print("==== Input file #" + (fmt % n) + " ====")
            print(t)
        else:
            if t._keywords.has_key("DFTTYP"):
                dfttyp = t._keywords["DFTTYP"]
            else:
                dfttyp = "NODFT"
            scftyp = t._keywords["SCFTYP"]
            dirname = os.path.join(dfttyp, scftyp)
            if not os.path.exists(dirname):
                os.makedirs(dirname)
            filename = os.path.join(dirname, args[0] + (fmt % n) + ".inp")
            output = open(filename, "w+")