def test_schedule(self): omp_set_schedule(OMP_SCHED_STATIC, 100000) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_STATIC) self.assertEqual(modifier, 100000) omp_set_schedule(OMP_SCHED_DYNAMIC, 10000) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_DYNAMIC) self.assertEqual(modifier, 10000) omp_set_schedule(OMP_SCHED_GUIDED, 100) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_GUIDED) self.assertEqual(modifier, 100) omp_set_schedule(OMP_SCHED_AUTO, 10) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_AUTO) self.assertNotEqual(modifier, 10) # The modifier argument is ignored,
def test_schedule(self): omp_set_schedule(OMP_SCHED_STATIC, 100000) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_STATIC) self.assertEqual(modifier, 100000) omp_set_schedule(OMP_SCHED_DYNAMIC, 10000) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_DYNAMIC) self.assertEqual(modifier, 10000) omp_set_schedule(OMP_SCHED_GUIDED, 100) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_GUIDED) self.assertEqual(modifier, 100) omp_set_schedule(OMP_SCHED_AUTO, 10) kind, modifier = omp_get_schedule() self.assertEqual(kind, OMP_SCHED_AUTO) # The modifier argument is ignored, # so it will be set to the previous # value of 100. self.assertNotEqual(modifier, 10)
longMessage = True class WRFInterpTest(ut.TestCase): longMessage = True class WRFLatLonTest(ut.TestCase): longMessage = True if __name__ == "__main__": from wrf import (omp_set_num_threads, omp_set_schedule, omp_get_schedule, omp_set_dynamic, omp_get_num_procs, OMP_SCHED_STATIC) omp_set_num_threads(omp_get_num_procs() // 2) omp_set_schedule(OMP_SCHED_STATIC, 0) omp_set_dynamic(False) ignore_vars = [] # Not testable yet wrf_vars = [ "avo", "eth", "cape_2d", "cape_3d", "ctt", "dbz", "mdbz", "geopt", "helicity", "lat", "lon", "omg", "p", "pressure", "pvo", "pw", "rh2", "rh", "slp", "ter", "td2", "td", "tc", "theta", "tk", "tv", "twb", "updraft_helicity", "ua", "va", "wa", "uvmet10", "uvmet", "z", "cfrac", "zstag", "geopt_stag", "height_agl", "wspd_wdir", "wspd_wdir10", "uvmet_wspd_wdir", "uvmet10_wspd_wdir" ] interp_methods = ["interplevel", "vertcross", "interpline", "vinterp"] latlon_tests = ["xy", "ll"] for dir, ref_nc_file, nest in zip(DIRS, REF_NC_FILES, NEST):