diff --git a/dashboards/dashboard_walberla.py b/dashboards/dashboard_walberla.py index 6b53252300080f4a5b5333dcde479fb03c75af66..d75c1ee06bc58888d6ff1617961c4f903306a71f 100644 --- a/dashboards/dashboard_walberla.py +++ b/dashboards/dashboard_walberla.py @@ -2,7 +2,8 @@ from dashboards.dashboard_base import (DashboardOptions, build_dashboard, get_commit_annotation, pack_in_row, - Repeat,) + Repeat, + get_grid_pos) from dashboards.panels import PanelInfos, get_time_series_panel @@ -244,3 +245,75 @@ def dashboard_uniformgridgpu_profile(): rows=[row], templating=[*filter_vars], annotations=annotations) + + +def dashboard_fslbmgravitywave(): + data_source = 'InfluxDB-1' + arch = 'CPU' + measurment_name = 'FSLBM_gravitywave' + + options = DashboardOptions( + title='Free Surface LBM - Gravity Wave', + description="Benchmark dashboard for the FSBLM Gravitywave Benchmark from walberla", + tags=[arch, 'benchmark', 'walberla', 'FSLBM'], + timezone="browser", + ) + + filters = [ + Filter("host"), + Filter("project_id", multi=True, default_value='walberla/walberla'), + Filter("branch", multi=True, default_value='master'), + Filter("numMPIProcess"), + ] + + fields = [PanelInfos("simulationTime", Units.seconds), ] + + filter_vars = [get_dashboard_variable(filter, measurment_name, data_source) for filter in filters] + + where = join_variable_and([f.name for f in filters]) + annotations = get_commit_annotation(data_source, "red", "commits", measurment_name) + + panels = [ + get_time_series_panel( + field, + data_source, + measurment_name, + where=where, + group_by=[f.name for f in filters], + gridPos=get_grid_pos(12, 24, 0, idx*(13)) + ) + for idx, field in enumerate(fields)] + panels.append( + get_time_series_panel( + PanelInfos("/.*_percentage/", Units.percent), + data_source, + measurment_name, + where=where, + group_by=[f.name for f in filters], + gridPos=get_grid_pos(12, 12, 0, len(fields)*(13)), + drawStyle="bars", + stacking={"mode": "normal"}, + fillOpacity=70, + gradientMode="Opacity", + tooltipMode="single", + )) + + panels.append( + get_time_series_panel( + PanelInfos("/Communication.*_percentage/", Units.percent), + data_source, + measurment_name, + where=where, + group_by=[f.name for f in filters], + gridPos=get_grid_pos(12, 12, 12, len(fields)*(13)), + drawStyle="bars", + stacking={"mode": "normal"}, + fillOpacity=70, + gradientMode="Opacity", + tooltipMode="single", + )) + + return build_dashboard(options, + panels=panels, + templating=filter_vars, + annotations=annotations) diff --git a/dashboards/deploy.py b/dashboards/deploy.py index 3f48831047608bac9e319d605443112c1905548b..f703d23c656b8ad9422d0d9526555b0ac77778bd 100644 --- a/dashboards/deploy.py +++ b/dashboards/deploy.py @@ -5,7 +5,7 @@ import dashboards.dashboard_list as boards from dashboards.upload import upload_dashboard from dashboards.dashboard_fe2ti import dashboard_fe2ti from dashboard_pystencils import dashboard_pystencils_cpu, dashboard_pystencils_gpu -from dashboard_walberla import dashboard_uniformgridcpu, dashboard_uniformgridgpu, dashboard_uniformgridgpu_profile +from dashboard_walberla import dashboard_uniformgridcpu, dashboard_uniformgridgpu, dashboard_uniformgridgpu_profile, dashboard_fslbmgravitywave logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) @@ -45,6 +45,7 @@ def main(): upload_dashboard(dashboard_uniformgridcpu(), folder=walberla_folder) upload_dashboard(dashboard_uniformgridgpu(), folder=walberla_folder) upload_dashboard(dashboard_uniformgridgpu_profile(), folder=walberla_folder) + upload_dashboard(dashboard_fslbmgravitywave(), folder=walberla_folder) else: board = getattr(boards, board_name) upload_dashboard(board(), folder=walberla_folder) diff --git a/dashboards/panels.py b/dashboards/panels.py index 9a202ed9a9674e92c1d1cb1ccea2cd15a3de2277..8fd80e149ed86016e313551b5944891a2cc02731 100644 --- a/dashboards/panels.py +++ b/dashboards/panels.py @@ -16,29 +16,32 @@ class PanelInfos: absthreshold: Number = field(default=None) +def is_regex(name): + return name[0] == "/" and name[-1] == "/" + + def get_time_series_panel(panel_infos: PanelInfos, data_source: str, measurment_name: str, *, where=None, group_by=None, - overrides=None): - is_regex = False - if measurment_name[0] == '/' and measurment_name[-1] == '/': - is_regex = True + overrides=None, + **kwargs): query = Query(select_=panel_infos.name, from_=measurment_name, where_=where, group_by=group_by, - from_string=not is_regex) - kwargs = {} + from_string=not is_regex(measurment_name), + select_string=not is_regex(panel_infos.name)) + new_kwargs = {**kwargs} if panel_infos.absthreshold is not None: - kwargs.update({'thresholdType': 'absolute', - 'thresholds': [Threshold('green', 0, 0.0), - Threshold('red', index=1, value=float(panel_infos.absthreshold), op='lt'), ], - 'thresholdsStyleMode': 'line', - } - ) + new_kwargs.update({'thresholdType': 'absolute', + 'thresholds': [Threshold('green', 0, 0.0), + Threshold('red', index=1, value=float(panel_infos.absthreshold), op='lt'), ], + 'thresholdsStyleMode': 'line', + } + ) return TimeSeries( title=panel_infos.name, @@ -47,7 +50,7 @@ def get_time_series_panel(panel_infos: PanelInfos, unit=panel_infos.unit, pointSize=9, overrides=overrides, - **kwargs, + **new_kwargs, )