Skip to content

Commit

Permalink
Merge pull request #1425 from knutfrode/dev
Browse files Browse the repository at this point in the history
[run-ex] Updated performance test
  • Loading branch information
knutfrode authored Oct 18, 2024
2 parents d2441ba + b3f5c78 commit 976bfa3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/benchmarks/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
print('= OpenDrift performance test =')
print('==============================================')
print('Reference machine:')
print(' Ubuntu PC with 8 GB memory and')
print(' 8 processors (Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz)')
print(' NumPy version 1.11.2')
print(' SciPy version 0.9.0')
print(' Matplotlib version 2.0.0')
print(' NetCDF4 version 1.0.7')
print(' Python version 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3]')
print(' Ubuntu PC with 32 GB memory and')
print(' 16 processors (x86_64)')
print(' NumPy version 1.26.4')
print(' SciPy version 1.14.0')
print(' Matplotlib version 3.9.1')
print(' NetCDF4 version 1.6.1')
print(' Python version 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:40:35) [GCC 12.3.0]')
print(' Graphics card:')
print(' 01:00.0 VGA compatible controller: NVIDIA Corporation GT218 [NVS 300] (rev a2)')
print(' 00:02.0 VGA compatible controller: Intel Corporation CometLake-S GT2 [UHD Graphics 630] (rev 05)')

print('------------------------------------------------')
print('This machine:')
Expand All @@ -53,7 +53,7 @@
print('\n')

print('Test 1: generation of landmask instance at full resolution')
print(' 54.0 seconds on reference machine.')
print(' 5.0 seconds on reference machine.')
start_time = datetime.now()
reader_landmask = reader_global_landmask.Reader()
time_spent = datetime.now() - start_time
Expand All @@ -62,13 +62,13 @@

print('------------------------------------------------')
print('Test 2: Reading from netCDF file')
print(' 0.05 seconds on reference machine.')
print(' 0.10 seconds on reference machine.')
o = OpenOil(loglevel=50) # Quiet
reader_arctic = reader_netCDF_CF_generic.Reader(o.test_data_folder() + '2Feb2016_Nordic_sigma_3d/Arctic20_1to5Feb_2016.nc')
x = reader_arctic.x[10:12]
y = reader_arctic.y[10:12]
z = np.array([-20, -10])
variables = ['sea_surface_elevation', 'sea_ice_area_fraction', 'y_sea_water_velocity', 'sea_floor_depth_below_sea_level', 'sea_water_salinity', 'x_sea_water_velocity', 'sea_water_temperature', 'sea_ice_thickness']
variables = ['sea_surface_height', 'sea_ice_area_fraction', 'y_sea_water_velocity', 'sea_floor_depth_below_sea_level', 'sea_water_salinity', 'x_sea_water_velocity', 'sea_water_temperature', 'sea_ice_thickness']
reader_arctic.buffer=1000 # read all
reader_arctic.verticalbuffer=1000 # read all
start_time = datetime.now()
Expand All @@ -80,7 +80,7 @@

print('--------------------------------------------------------')
print('Test 3: Interpolating 3D arrays onto particle positions')
print(' 2.5 seconds on reference machine.')
print(' 1.5 seconds on reference machine.')
start_time = datetime.now()
b = ReaderBlock(v, interpolation_horizontal='linearND')
num_points = 10000
Expand All @@ -96,7 +96,7 @@

print('--------------------------------------------------------')
print('Test 4: Vertical mixing with 50 elements and 7200 cycles (CPU-heavy)')
print(' 10.0 seconds on reference machine.')
print(' 2.2 seconds on reference machine.')
reader_arctic.buffer=10
reader_arctic.verticalbuffer=1
o = OpenOil(loglevel=50) # Quiet
Expand All @@ -114,7 +114,7 @@

print('--------------------------------------------------------')
print('Test 5: Vertical mixing with 500000 elements and 10 cycles (memory-heavy)')
print(' 38.0 seconds on reference machine.')
print(' 28.0 seconds on reference machine.')
o = OpenOil(loglevel=50) # Quiet
o.add_reader(reader_arctic)
o.set_config('environment:fallback:x_wind', 10)
Expand Down

0 comments on commit 976bfa3

Please sign in to comment.