Skip to content

Commit

Permalink
PEP
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-seaice committed Sep 3, 2024
1 parent e455023 commit 75cc917
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions test/models/access-om3/test_access_om3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

MODEL = 'access-om3'

# Tests of cesm_cmeps

def setup_module(module):
"""
Put any test-wide setup code in here, e.g. creating test files
Expand Down Expand Up @@ -63,7 +61,7 @@ def cmeps_config(ncpu):


def teardown_cmeps_config():
# Teardown
# Teardown
os.remove(config_path)


Expand Down Expand Up @@ -100,17 +98,17 @@ def get(self, section, variable, value=None):


@pytest.mark.parametrize("ncpu, moc_ntasks, moc_nthreads, moc_pestride, moc_rootpe", [
(1,1,1,1,0), #min
(4,4,1,1,0), #min tasks
(4,2,2,2,0), #min tasks * threads
(4,2,1,1,2), #min tasks + rootpe
(4,1,2,2,2), #min threads + rootpe
(4,1,1,1,3), #max rootpe
(5,2,1,4,0), #max stride
(13,4,1,3,1), #odd ncpu
(13,2,3,3,1), #odd ncpu
(100000,50000,1,2,0), #max cpu
(100000,1,1,1,99999), #max cpu
(1, 1, 1, 1, 0), #min
(4, 4, 1, 1, 0), #min tasks
(4, 2, 2, 2, 0), #min tasks * threads
(4, 2, 1, 1, 2), #min tasks + rootpe
(4, 1, 2, 2, 2), #min threads + rootpe
(4, 1, 1, 1, 3), #max rootpe
(5, 2, 1, 4, 0), #max stride
(13, 4, 1, 3, 1), #odd ncpu
(13, 2, 3, 3, 1), #odd ncpu
(100000, 50000, 1, 2, 0), #max cpu
(100000, 1, 1, 1, 99999), #max cpu
])
def test__setup_checks_npes(ncpu, moc_ntasks, moc_nthreads, moc_pestride, moc_rootpe):

Expand Down Expand Up @@ -139,16 +137,16 @@ def test__setup_checks_npes(ncpu, moc_ntasks, moc_nthreads, moc_pestride, moc_ro


@pytest.mark.parametrize("ncpu, moc_ntasks, moc_nthreads, moc_pestride, moc_rootpe", [
(1,1,1,1,1), #min
(4,5,1,1,0), #min tasks
(4,2,2,2,1), #min tasks * threads
(2,1,2,1,1), #threads > strides
(4,1,3,1,2), #min threads + rootpe
(4,1,1,1,4), #max rootpe
(13,4,1,4,1), #odd ncpu
(13,2,7,7,0), #odd ncpu
(100000,50001,1,2,0), #max cpu
(100000,1,1,1,100000), #max cpu
(1, 1, 1, 1, 1), #min
(4, 5, 1, 1, 0), #min tasks
(4, 2, 2, 2, 1), #min tasks * threads
(2, 1, 2, 1, 1), #threads > strides
(4, 1, 3, 1, 2), #min threads + rootpe
(4, 1, 1, 1, 4), #max rootpe
(13, 4, 1, 4, 1), #odd ncpu
(13, 2, 7, 7, 0), #odd ncpu
(100000, 50001, 1, 2, 0), #max cpu
(100000, 1, 1, 1, 100000), #max cpu
])
def test__setup_checks_too_many_pes(ncpu, moc_ntasks, moc_nthreads, moc_pestride, moc_rootpe):

Expand Down Expand Up @@ -178,12 +176,12 @@ def test__setup_checks_too_many_pes(ncpu, moc_ntasks, moc_nthreads, moc_pestride


@pytest.mark.parametrize("ncpu, pio_numiotasks, pio_stride, pio_root, pio_typename", [
(1,1,1,0,"netcdf"), #min
(2,1,1,1,"netcdf"), #max root
(2,2,1,0,"netcdf4p"), #min tasks + rootpe
(2,1,1,1,"netcdf4p"), #max rootpe
(5,3,2,0,"netcdf4p"),
(100000,50001,1,2,"netcdf4p"), #odd ncpu
(1, 1, 1, 0, "netcdf"), #min
(2, 1, 1, 1, "netcdf"), #max root
(2, 2, 1, 0, "netcdf4p"), #min tasks + rootpe
(2, 1, 1, 1, "netcdf4p"), #max rootpe
(5, 3, 2, 0, "netcdf4p"),
(100000, 50001, 1, 2, "netcdf4p"), #odd ncpu
])
def test__setup_checks_io(ncpu, pio_numiotasks, pio_stride, pio_root, pio_typename):

Expand Down Expand Up @@ -215,12 +213,12 @@ def test__setup_checks_io(ncpu, pio_numiotasks, pio_stride, pio_root, pio_typena


@pytest.mark.parametrize("ncpu, pio_numiotasks, pio_stride, pio_root, pio_typename", [
(1,1,1,0,"netcdf4c"),
(2,1,1,2,"netcdf"), #root too big
(2,3,1,0,"netcdf4p"), #too manu tasks
(2,2,2,0,"netcdf4p"), #stride too big
(5,2,2,3,"netcdf4p"), #stride too big
(100000,50000,2,2,"netcdf4p"), #odd ncpu
(1, 1, 1, 0, "netcdf4c"),
(2, 1, 1, 2, "netcdf"), #root too big
(2, 3, 1, 0, "netcdf4p"), #too manu tasks
(2, 2, 2, 0, "netcdf4p"), #stride too big
(5, 2, 2, 3, "netcdf4p"), #stride too big
(100000, 50000, 2, 2, "netcdf4p"), #odd ncpu
])
def test__setup_checks_bad_io(ncpu, pio_numiotasks, pio_stride, pio_root, pio_typename):

Expand Down

0 comments on commit 75cc917

Please sign in to comment.