# ------------------------------------------------------------------- if __name__ in ['__main__', '__builtin__']: # We may have been imported by test.py, if so we should redirect to logfile if __name__ == '__builtin__': testrunner = CustomTextTestRunner('ut_hsops.log', verbosity=2) else: from gpaw.utilities import devnull stream = (world.rank == 0) and sys.stdout or devnull testrunner = TextTestRunner(stream=stream, verbosity=2) parinfo = [] # Initial Verification only tests case : dtype = float for test in [UTBandParallelSetup_Blocked, UTBandParallelSetup_Strided]: info = ['', test.__name__, test.__doc__.strip('\n'), ''] testsuite = initialTestLoader.loadTestsFromTestCase(test) map(testrunner.stream.writeln, info) testresult = testrunner.run(testsuite) assert testresult.wasSuccessful(), 'Initial verification failed!' parinfo.extend([' Parallelization options: %s' % tci._parinfo for \ tci in testsuite._tests if hasattr(tci, '_parinfo')]) parinfo = np.unique(np.sort(parinfo)).tolist() testcases = [] for dtype in [float, complex]: for parstride_bands in [False, True]: for blocking in [ 'fast', 'light', 'intdiv', 'nonintdiv1', 'nonintdiv2' ]: for async in [False, True]: testcases.append(UTConstantWavefunctionFactory(dtype, \
# ------------------------------------------------------------------- if __name__ in ['__main__', '__builtin__']: # We may have been imported by test.py, if so we should redirect to logfile if __name__ == '__builtin__': testrunner = CustomTextTestRunner('ut_tddft.log', verbosity=2) else: from gpaw.utilities import devnull stream = (world.rank == 0) and sys.stdout or devnull testrunner = TextTestRunner(stream=stream, verbosity=2) parinfo = [] for test in [UTGroundStateSetup]: info = ['', test.__name__, test.__doc__.strip('\n'), ''] testsuite = initialTestLoader.loadTestsFromTestCase(test) map(testrunner.stream.writeln, info) testresult = testrunner.run(testsuite) assert testresult.wasSuccessful(), 'Initial verification failed!' parinfo.extend([' Parallelization options: %s' % tci._parinfo for \ tci in testsuite._tests if hasattr(tci, '_parinfo')]) parinfo = np.unique(np.sort(parinfo)).tolist() # Try all timesteps between 1 and 10 that factor the duration nicely timesteps = np.arange(1, min(10, UTStaticPropagatorSetup.duration) + 1) timesteps = timesteps[UTStaticPropagatorSetup.duration % timesteps == 0] testcases = [] for propagator in ['ECN', 'SICN', 'SITE', 'SIKE', 'ETRSCN']: testcases.append(UTStaticPropagatorFactory(timesteps, propagator))