Esempio n. 1
0
    def build_nek(self, opts=None, usr_file=None):
        from lib.nekBinBuild import build_nek
        cls = self.__class__

        if not usr_file:
            usr_file = cls.case_name

        all_opts = dict(
            F77=self.f77,
            CC=self.cc,
            G=self.g,
            PPLIST=self.pplist,
            USR_LFLAGS=self.usr_lflags,
            IFMPI=str(self.ifmpi).lower(),
        )
        if opts:
            all_opts.update(opts)

        build_nek(
            source_root=self.source_root,
            usr_file=usr_file,
            cwd=os.path.join(self.examples_root, cls.example_subdir),
            opts=all_opts,
            verbose=self.verbose,
        )
Esempio n. 2
0
    def build_nek(self, opts=None, usr_file=None):
        from lib.nekBinBuild import build_nek
        cls = self.__class__

        if not usr_file:
            usr_file = cls.case_name

        all_opts = dict(
            F77 = self.f77,
            CC = self.cc,
            G = self.g,
            PPLIST = self.pplist,
            USR_LFLAGS = self.usr_lflags,
            IFMPI = str(self.ifmpi).lower(),
        )
        if opts:
            all_opts.update(opts)

        build_nek(
            source_root = self.source_root,
            usr_file    = usr_file,
            cwd         = os.path.join(self.examples_root, cls.example_subdir),
            opts        = all_opts,
            verbose     = self.verbose,
        )
Esempio n. 3
0
    def build_nek(self, usr_file=None):
        from lib.nekBinBuild import build_nek
        cls = self.__class__

        if not usr_file:
            usr_file = cls.case_name

        build_nek(source_root=self.source_root,
                  usr_file=usr_file,
                  cwd=os.path.join(self.examples_root, cls.example_subdir),
                  f77=self.f77,
                  cc=self.cc,
                  ifmpi=str(self.ifmpi).lower(),
                  verbose=self.verbose)
Esempio n. 4
0
    def build_nek(self, usr_file=None):
        from lib.nekBinBuild import build_nek
        cls = self.__class__

        if not usr_file:
            usr_file = cls.case_name

        build_nek(
            source_root = self.source_root,
            usr_file    = usr_file,
            cwd         = os.path.join(self.examples_root, cls.example_subdir),
            f77         = self.f77,
            cc          = self.cc,
            ifmpi       = str(self.ifmpi).lower(),
            verbose     = self.verbose
        )
Esempio n. 5
0
    def compare_runs(self):

        cls = self.__class__

        # First get the output w/o acc

        build_nek(source_root=self.source_root,
                  usr_file=cls.case_name,
                  cwd=os.path.join(self.examples_root, cls.example_subdir),
                  f77=self.f77.replace('-acc', ''),
                  cc=self.cc.replace('-acc', ''),
                  ifmpi=self.ifmpi,
                  verbose=self.verbose)

        run_nek(cwd=os.path.join(self.examples_root, cls.example_subdir),
                rea_file=cls.case_name,
                ifmpi=self.ifmpi,
                log_suffix=self.log_suffix + '.noacc',
                n_procs=self.mpi_procs,
                step_limit=cls.step_limit,
                verbose=self.verbose)

        # Then get the output with  ACC

        build_nek(source_root=self.source_root,
                  usr_file=cls.case_name,
                  cwd=os.path.join(self.examples_root, cls.example_subdir),
                  f77=self.f77.replace('-acc', '') + ' -acc -Minfo=accel',
                  cc=self.cc.replace('-acc', '') + ' -acc -Minfo=accel',
                  ifmpi=self.ifmpi,
                  verbose=self.verbose)

        run_nek(cwd=os.path.join(self.examples_root, cls.example_subdir),
                rea_file=cls.case_name,
                ifmpi=self.ifmpi,
                log_suffix=self.log_suffix + '.acc',
                n_procs=self.mpi_procs,
                step_limit=cls.step_limit,
                verbose=self.verbose)

        # Now compare output

        logfile_noacc = os.path.join(
            self.examples_root, cls.example_subdir,
            '{0}.log.{1}{2}.noacc'.format(cls.case_name, self.mpi_procs,
                                          self.log_suffix))

        logfile_acc = os.path.join(
            self.examples_root, cls.example_subdir,
            '{0}.log.{1}{2}.acc'.format(cls.case_name, self.mpi_procs,
                                        self.log_suffix))

        loglines_noacc = self.get_lines_from_log(cls.log_label, logfile_noacc)
        loglines_acc = self.get_lines_from_log(cls.log_label, logfile_acc)

        self.assertNotEqual(
            len(logfile_noacc), 0,
            'Could not find the label {0} in the logfile {1}'.format(
                cls.log_label, logfile_noacc))

        self.assertNotEqual(
            len(loglines_acc), 0,
            'Could not find the label {0} in the logfile {1}'.format(
                cls.log_label, logfile_acc))

        for (noacc, acc) in zip(loglines_noacc, loglines_acc):
            err_msg = 'The lines with/without ACC did not match after this point\n' + \
                      '\n---- Without ACC -----------------------------------------------------\n' + \
                      noacc + \
                      '\n---- With ACC --------------------------------------------------------\n' + \
                      acc
            self.assertEqual(noacc, acc, err_msg)
Esempio n. 6
0
    def compare_runs(self):

        cls = self.__class__

        # First get the output w/o acc

        build_nek(
            source_root = self.source_root,
            usr_file    = cls.case_name,
            cwd         = os.path.join(self.examples_root, cls.example_subdir),
            f77         = self.f77.replace('-acc',''),
            cc          = self.cc.replace('-acc',''),
            ifmpi       = self.ifmpi,
            verbose     = self.verbose
        )

        run_nek(
            cwd        = os.path.join(self.examples_root, cls.example_subdir),
            rea_file   = cls.case_name,
            ifmpi      = self.ifmpi,
            log_suffix = self.log_suffix + '.noacc',
            n_procs    = self.mpi_procs,
            step_limit = cls.step_limit,
            verbose    = self.verbose
        )

        # Then get the output with  ACC

        build_nek(
            source_root = self.source_root,
            usr_file    = cls.case_name,
            cwd         = os.path.join(self.examples_root, cls.example_subdir),
            f77         = self.f77.replace('-acc','') + ' -acc -Minfo=accel',
            cc          = self.cc.replace('-acc','') + ' -acc -Minfo=accel',
            ifmpi       = self.ifmpi,
            verbose     = self.verbose
        )

        run_nek(
            cwd        = os.path.join(self.examples_root, cls.example_subdir),
            rea_file   = cls.case_name,
            ifmpi      = self.ifmpi,
            log_suffix = self.log_suffix + '.acc',
            n_procs    = self.mpi_procs,
            step_limit = cls.step_limit,
            verbose    = self.verbose
        )

        # Now compare output

        logfile_noacc = os.path.join(
            self.examples_root,
            cls.example_subdir,
            '{0}.log.{1}{2}.noacc'.format(cls.case_name, self.mpi_procs, self.log_suffix)
        )

        logfile_acc = os.path.join(
            self.examples_root,
            cls.example_subdir,
            '{0}.log.{1}{2}.acc'.format(cls.case_name, self.mpi_procs, self.log_suffix)
        )

        loglines_noacc = self.get_lines_from_log(cls.log_label, logfile_noacc)
        loglines_acc = self.get_lines_from_log(cls.log_label, logfile_acc)

        self.assertNotEqual(
            len(logfile_noacc),
            0,
            'Could not find the label {0} in the logfile {1}'.format(cls.log_label, logfile_noacc)
        )

        self.assertNotEqual(
            len(loglines_acc),
            0,
            'Could not find the label {0} in the logfile {1}'.format(cls.log_label, logfile_acc)
        )

        for (noacc, acc) in zip(loglines_noacc, loglines_acc):
            err_msg = 'The lines with/without ACC did not match after this point\n' + \
                      '\n---- Without ACC -----------------------------------------------------\n' + \
                      noacc + \
                      '\n---- With ACC --------------------------------------------------------\n' + \
                      acc
            self.assertEqual(noacc, acc, err_msg)