From 6fa2a92ffee8e528cc4c4b8914672a661032d9da Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Wed, 9 Oct 2019 16:31:30 +0200 Subject: [PATCH 1/9] resolves https://jira.cscs.ch/browse/MAINT-66 --- cscs-checks/apps/paraview/paraview_check.py | 28 +++-- .../apps/paraview/src/newcoloredSphere.py | 109 ++++++++++++++++++ 2 files changed, 128 insertions(+), 9 deletions(-) create mode 100644 cscs-checks/apps/paraview/src/newcoloredSphere.py diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 5801620ef8..6cf10adede 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -6,22 +6,32 @@ class ParaViewCheck(rfm.RunOnlyRegressionTest): def __init__(self): super().__init__() - self.name = 'paraview_gpu_check' - self.descr = 'ParaView GPU check' - self.valid_systems = ['daint:gpu', 'dom:gpu'] + self.name = 'paraview_check' + self.descr = 'ParaView check' + self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu'] self.valid_prog_environs = ['PrgEnv-gnu'] self.num_tasks = 12 self.num_tasks_per_node = 12 self.modules = ['ParaView'] + #self.pre_run = ['module use /scratch/snx3000tds/jfavre/daint/modules/all'] - # FIXME: The test runs fine, but the process does not exit until the - # job times out self.time_limit = (0, 1, 0) self.executable = 'pvbatch' - self.executable_opts = ['coloredSphere.py'] - - self.sanity_patterns = sn.assert_found( - 'Vendor: NVIDIA Corporation', self.stdout) + #self.executable_opts = ['coloredSphere.py'] + self.executable_opts = ['newcoloredSphere.py'] self.maintainers = ['JF'] self.tags = {'scs', 'production'} + + def setup(self, partition, environ, **job_opts): + if partition.fullname == 'daint:mc': + self.sanity_patterns = sn.assert_found('Vendor: VMware, Inc.', self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: llvmpipe', self.stdout) + elif partition.fullname == 'daint:gpu': + self.sanity_patterns = sn.assert_found('Vendor: NVIDIA Corporation', self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) + elif partition.fullname == 'dom:gpu': + self.sanity_patterns = sn.assert_found('Vendor: NVIDIA Corporation', self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) + + super().setup(partition, environ, **job_opts) diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py new file mode 100644 index 0000000000..e8231c57c2 --- /dev/null +++ b/cscs-checks/apps/paraview/src/newcoloredSphere.py @@ -0,0 +1,109 @@ + +import os +basename = os.getenv('SCRATCH') +if basename == None: + basename = "/tmp" + +try: paraview.simple +except: from paraview.simple import * + +Version = str(GetParaViewVersion()) +if(GetParaViewVersion() > 5.6): + from paraview.modules.vtkPVClientServerCoreCorePython import vtkProcessModule + info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) +else: + #from vtkPVClientServerCoreCorePython import vtkProcessModule + from paraview.servermanager import vtkProcessModule + from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation + info = vtkPVOpenGLInformation() + info.CopyFromObject(None) + +rank = vtkProcessModule.GetProcessModule().GetPartitionId() +nbprocs = servermanager.ActiveConnection.GetNumberOfDataPartitions() + +if rank == 0: + print("ParaView Version ", Version) + print("rank=", rank, "/", nbprocs) + print("Vendor: %s" % info.GetVendor()) + print("Version: %s" % info.GetVersion()) + print("Renderer: %s" % info.GetRenderer()) + +Vendor = info.GetVendor().split()[0] + +""" +>>> info.GetRenderer() +'SWR (LLVM 8.0, 256 bits)' +>>> info.GetVendor() +'Intel Corporation' +>>> info.GetVersion() +'3.3 (Core Profile) Mesa 18.3.3' +""" + +view = GetRenderView() +view.CameraPosition = [1.6422081156588224, 1.973803830856227, 2.1455501786429405] +view.CameraViewUp = [-0.4101827585121338, -0.49285756436638195, 0.7673601018206604] +view.CameraFocalPoint = [0.0, 0.0, 0.0] +view.OrientationAxesVisibility = 0 + +sphere = Sphere() +sphere.ThetaResolution = 1024 +sphere.PhiResolution = 1024 + +pidscal = ProcessIdScalars(sphere) + +rep = Show(pidscal, view) +ColorBy(rep, 'ProcessId') +processIdLUT = GetColorTransferFunction('ProcessId') +processIdLUT.AnnotationsInitialized = 1 +processIdLUT.InterpretValuesAsCategories = 1 + +# we take colors from the pre-defined "KAAMS" found in +# ParaViewCore/ServerManager/Rendering/ColorMaps.json +IndexedColors = [ +1.0,1.0,1.0, +1.0,0.0,0.0, +0.0,1.0,0.0, +0.0,0.0,1.0, +1.0,1.0,0.0, +1.0,0.0,1.0, +0.0,1.0,1.0, +0.63,0.63,1.0, +0.67,0.5,0.33, +1.0,0.5,0.75, +0.53,0.35,0.7, +1.0,0.75,0.5] + +a=[] +for i in range(nbprocs): + a.append(str(i)) + a.append(str(i)) +processIdLUT.Annotations = a +processIdLUT.IndexedColors = IndexedColors + +processIdLUTColorBar = GetScalarBar(processIdLUT, view) +processIdLUTColorBar.Title = 'PId' +processIdLUTColorBar.ComponentTitle = '' + +# set color bar visibility +processIdLUTColorBar.Visibility = 1 + +# show color legend +rep.SetScalarBarVisibility(view, True) + +view.Background = [.7, .7, .7] + +Render() + +view.ViewSize = [1024, 1024] +# change the pathname to a place where you have write access +filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" +SaveScreenshot(filename = filename, view=view) +print("writing ",filename) + + + +#ExportView(basename + "/coloredSphere.eps" ,view=view, Plottitle='Earth GL2PS Export', Rendertextaspaths=1) + +#from paraview.benchmark import * +#get_logs() +#dump_logs("/users/jfavre/logs.txt") From 6fd3371ed5e415b2098270e2272700f42515972b Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Wed, 9 Oct 2019 17:04:20 +0200 Subject: [PATCH 2/9] corrected indentation and other coding style errors --- cscs-checks/apps/paraview/paraview_check.py | 22 ++++-- .../apps/paraview/src/newcoloredSphere.py | 75 ++++++++----------- 2 files changed, 47 insertions(+), 50 deletions(-) diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 6cf10adede..9c231e53bb 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -13,11 +13,9 @@ def __init__(self): self.num_tasks = 12 self.num_tasks_per_node = 12 self.modules = ['ParaView'] - #self.pre_run = ['module use /scratch/snx3000tds/jfavre/daint/modules/all'] self.time_limit = (0, 1, 0) self.executable = 'pvbatch' - #self.executable_opts = ['coloredSphere.py'] self.executable_opts = ['newcoloredSphere.py'] self.maintainers = ['JF'] @@ -25,13 +23,21 @@ def __init__(self): def setup(self, partition, environ, **job_opts): if partition.fullname == 'daint:mc': - self.sanity_patterns = sn.assert_found('Vendor: VMware, Inc.', self.stdout) - self.sanity_patterns = sn.assert_found('Renderer: llvmpipe', self.stdout) + self.sanity_patterns = sn.assert_found('Vendor: VMware, Inc.', + self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: llvmpipe', + self.stdout) elif partition.fullname == 'daint:gpu': - self.sanity_patterns = sn.assert_found('Vendor: NVIDIA Corporation', self.stdout) - self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) + self.sanity_patterns = sn.assert_found( + 'Vendor: NVIDIA Corporation', + self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', + self.stdout) elif partition.fullname == 'dom:gpu': - self.sanity_patterns = sn.assert_found('Vendor: NVIDIA Corporation', self.stdout) - self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) + self.sanity_patterns = sn.assert_found( + 'Vendor: NVIDIA Corporation', + self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', + self.stdout) super().setup(partition, environ, **job_opts) diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py index e8231c57c2..283b87eb9f 100644 --- a/cscs-checks/apps/paraview/src/newcoloredSphere.py +++ b/cscs-checks/apps/paraview/src/newcoloredSphere.py @@ -1,32 +1,30 @@ import os basename = os.getenv('SCRATCH') -if basename == None: - basename = "/tmp" +if basename is None: + basename = "/tmp" -try: paraview.simple -except: from paraview.simple import * +from paraview.simple import * Version = str(GetParaViewVersion()) if(GetParaViewVersion() > 5.6): - from paraview.modules.vtkPVClientServerCoreCorePython import vtkProcessModule - info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) + from paraview.modules.vtkPVClientServerCoreCorePython import vtkProcessModule + info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) else: - #from vtkPVClientServerCoreCorePython import vtkProcessModule - from paraview.servermanager import vtkProcessModule - from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation - info = vtkPVOpenGLInformation() - info.CopyFromObject(None) + from paraview.servermanager import vtkProcessModule + from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation + info = vtkPVOpenGLInformation() + info.CopyFromObject(None) rank = vtkProcessModule.GetProcessModule().GetPartitionId() nbprocs = servermanager.ActiveConnection.GetNumberOfDataPartitions() if rank == 0: - print("ParaView Version ", Version) - print("rank=", rank, "/", nbprocs) - print("Vendor: %s" % info.GetVendor()) - print("Version: %s" % info.GetVersion()) - print("Renderer: %s" % info.GetRenderer()) + print("ParaView Version ", Version) + print("rank=", rank, "/", nbprocs) + print("Vendor: %s" % info.GetVendor()) + print("Version: %s" % info.GetVersion()) + print("Renderer: %s" % info.GetRenderer()) Vendor = info.GetVendor().split()[0] @@ -40,8 +38,8 @@ """ view = GetRenderView() -view.CameraPosition = [1.6422081156588224, 1.973803830856227, 2.1455501786429405] -view.CameraViewUp = [-0.4101827585121338, -0.49285756436638195, 0.7673601018206604] +view.CameraPosition = [1.642208, 1.973803, 2.14555] +view.CameraViewUp = [-0.410182, -0.492857, 0.76736] view.CameraFocalPoint = [0.0, 0.0, 0.0] view.OrientationAxesVisibility = 0 @@ -60,23 +58,24 @@ # we take colors from the pre-defined "KAAMS" found in # ParaViewCore/ServerManager/Rendering/ColorMaps.json IndexedColors = [ -1.0,1.0,1.0, -1.0,0.0,0.0, -0.0,1.0,0.0, -0.0,0.0,1.0, -1.0,1.0,0.0, -1.0,0.0,1.0, -0.0,1.0,1.0, -0.63,0.63,1.0, -0.67,0.5,0.33, -1.0,0.5,0.75, -0.53,0.35,0.7, -1.0,0.75,0.5] + 1.0, 1.0, 1.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + 1.0, 1.0, 0.0, + 1.0, 0.0, 1.0, + 0.0, 1.0, 1.0, + 0.63, 0.63, 1.0, + 0.67, 0.5, 0.33, + 1.0, 0.5, 0.75, + 0.53, 0.35, 0.7, + 1.0, 0.75, 0.5 +] a=[] for i in range(nbprocs): - a.append(str(i)) - a.append(str(i)) + a.append(str(i)) + a.append(str(i)) processIdLUT.Annotations = a processIdLUT.IndexedColors = IndexedColors @@ -97,13 +96,5 @@ view.ViewSize = [1024, 1024] # change the pathname to a place where you have write access filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" -SaveScreenshot(filename = filename, view=view) -print("writing ",filename) - - - -#ExportView(basename + "/coloredSphere.eps" ,view=view, Plottitle='Earth GL2PS Export', Rendertextaspaths=1) - -#from paraview.benchmark import * -#get_logs() -#dump_logs("/users/jfavre/logs.txt") +SaveScreenshot(filename=filename, view=view) +print("writing ", filename) From df3a230995ffe474396191ef6e9ae0ae1f4a9e07 Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Wed, 9 Oct 2019 17:16:57 +0200 Subject: [PATCH 3/9] corrected indentation and other coding style errors. Take 2 --- cscs-checks/apps/paraview/paraview_check.py | 6 ++---- cscs-checks/apps/paraview/src/newcoloredSphere.py | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 9c231e53bb..93983eb6ec 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -29,14 +29,12 @@ def setup(self, partition, environ, **job_opts): self.stdout) elif partition.fullname == 'daint:gpu': self.sanity_patterns = sn.assert_found( - 'Vendor: NVIDIA Corporation', - self.stdout) + 'Vendor: NVIDIA Corporation', self.stdout) self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) elif partition.fullname == 'dom:gpu': self.sanity_patterns = sn.assert_found( - 'Vendor: NVIDIA Corporation', - self.stdout) + 'Vendor: NVIDIA Corporation', self.stdout) self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py index 283b87eb9f..71245679d2 100644 --- a/cscs-checks/apps/paraview/src/newcoloredSphere.py +++ b/cscs-checks/apps/paraview/src/newcoloredSphere.py @@ -1,14 +1,14 @@ - +from paraview.simple import * import os basename = os.getenv('SCRATCH') if basename is None: basename = "/tmp" -from paraview.simple import * Version = str(GetParaViewVersion()) if(GetParaViewVersion() > 5.6): - from paraview.modules.vtkPVClientServerCoreCorePython import vtkProcessModule + from paraview.modules.vtkPVClientServerCoreCorePython import + vtkProcessModule info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) else: from paraview.servermanager import vtkProcessModule @@ -73,7 +73,7 @@ ] a=[] -for i in range(nbprocs): +for i in range( nbprocs ): a.append(str(i)) a.append(str(i)) processIdLUT.Annotations = a From f765fc6f8cbe26506881a671b5ff4b4b853969fe Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Thu, 10 Oct 2019 16:25:41 +0200 Subject: [PATCH 4/9] more syntax correction with suggestions from Theo --- cscs-checks/apps/paraview/paraview_check.py | 3 --- cscs-checks/apps/paraview/src/newcoloredSphere.py | 10 ++++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 93983eb6ec..281f99de1d 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -1,13 +1,10 @@ import reframe as rfm import reframe.utility.sanity as sn - @rfm.simple_test class ParaViewCheck(rfm.RunOnlyRegressionTest): def __init__(self): super().__init__() - self.name = 'paraview_check' - self.descr = 'ParaView check' self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu'] self.valid_prog_environs = ['PrgEnv-gnu'] self.num_tasks = 12 diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py index 71245679d2..4c3679232a 100644 --- a/cscs-checks/apps/paraview/src/newcoloredSphere.py +++ b/cscs-checks/apps/paraview/src/newcoloredSphere.py @@ -4,11 +4,10 @@ if basename is None: basename = "/tmp" - Version = str(GetParaViewVersion()) if(GetParaViewVersion() > 5.6): - from paraview.modules.vtkPVClientServerCoreCorePython import - vtkProcessModule + from paraview.modules.vtkPVClientServerCoreCorePython import ( + vtkProcessModule) info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) else: from paraview.servermanager import vtkProcessModule @@ -72,10 +71,9 @@ 1.0, 0.75, 0.5 ] -a=[] +a = [] for i in range( nbprocs ): - a.append(str(i)) - a.append(str(i)) + a.extend((str(i), str(i))) processIdLUT.Annotations = a processIdLUT.IndexedColors = IndexedColors From 0d767056571c8e294aa8c96c9bbb284a7da1e640 Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Fri, 11 Oct 2019 10:49:00 +0200 Subject: [PATCH 5/9] syntax correction and replaced SERVERS by RENDER_SERVER) --- cscs-checks/apps/paraview/src/newcoloredSphere.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py index 4c3679232a..6fa6e8d7e4 100644 --- a/cscs-checks/apps/paraview/src/newcoloredSphere.py +++ b/cscs-checks/apps/paraview/src/newcoloredSphere.py @@ -8,7 +8,7 @@ if(GetParaViewVersion() > 5.6): from paraview.modules.vtkPVClientServerCoreCorePython import ( vtkProcessModule) - info = GetOpenGLInformation(location=servermanager.vtkSMSession.SERVERS) + info = GetOpenGLInformation(location=servermanager.vtkSMSession.RENDER_SERVER) else: from paraview.servermanager import vtkProcessModule from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation @@ -72,7 +72,7 @@ ] a = [] -for i in range( nbprocs ): +for i in range(nbprocs): a.extend((str(i), str(i))) processIdLUT.Annotations = a processIdLUT.IndexedColors = IndexedColors From bb03675ae5554abb6d6bfa30d1664d179cdbbac2 Mon Sep 17 00:00:00 2001 From: Jean M Favre Date: Fri, 11 Oct 2019 10:53:25 +0200 Subject: [PATCH 6/9] added a check for dom:mc since ParaView is now installed there as well --- cscs-checks/apps/paraview/paraview_check.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 281f99de1d..82c5d070fa 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -5,7 +5,7 @@ class ParaViewCheck(rfm.RunOnlyRegressionTest): def __init__(self): super().__init__() - self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu'] + self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] self.valid_prog_environs = ['PrgEnv-gnu'] self.num_tasks = 12 self.num_tasks_per_node = 12 @@ -34,5 +34,10 @@ def setup(self, partition, environ, **job_opts): 'Vendor: NVIDIA Corporation', self.stdout) self.sanity_patterns = sn.assert_found('Renderer: Tesla P100', self.stdout) + elif partition.fullname == 'dom:mc': + self.sanity_patterns = sn.assert_found('Vendor: VMware, Inc.', + self.stdout) + self.sanity_patterns = sn.assert_found('Renderer: llvmpipe', + self.stdout) super().setup(partition, environ, **job_opts) From 01e71eed3b67cce1a7d979e58f3111f4ea1eb57d Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 11 Oct 2019 13:28:17 +0200 Subject: [PATCH 7/9] Overwrite old coloredShpere.py with the new one + final PEP8 fixes --- .../apps/paraview/src/coloredSphere.py | 144 ++++++++++-------- .../apps/paraview/src/newcoloredSphere.py | 98 ------------ 2 files changed, 82 insertions(+), 160 deletions(-) delete mode 100644 cscs-checks/apps/paraview/src/newcoloredSphere.py diff --git a/cscs-checks/apps/paraview/src/coloredSphere.py b/cscs-checks/apps/paraview/src/coloredSphere.py index fd4d076786..6fa6e8d7e4 100644 --- a/cscs-checks/apps/paraview/src/coloredSphere.py +++ b/cscs-checks/apps/paraview/src/coloredSphere.py @@ -1,78 +1,98 @@ - -# Version = "4.4" # tested succesfully on Fri Nov 13 15:54:52 CET 2015 -Version = "5.4" # tested succesfully on Fri Nov 13 15:54:52 CET 2015 - +from paraview.simple import * import os basename = os.getenv('SCRATCH') +if basename is None: + basename = "/tmp" + +Version = str(GetParaViewVersion()) +if(GetParaViewVersion() > 5.6): + from paraview.modules.vtkPVClientServerCoreCorePython import ( + vtkProcessModule) + info = GetOpenGLInformation(location=servermanager.vtkSMSession.RENDER_SERVER) +else: + from paraview.servermanager import vtkProcessModule + from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation + info = vtkPVOpenGLInformation() + info.CopyFromObject(None) + +rank = vtkProcessModule.GetProcessModule().GetPartitionId() +nbprocs = servermanager.ActiveConnection.GetNumberOfDataPartitions() + +if rank == 0: + print("ParaView Version ", Version) + print("rank=", rank, "/", nbprocs) + print("Vendor: %s" % info.GetVendor()) + print("Version: %s" % info.GetVersion()) + print("Renderer: %s" % info.GetRenderer()) -try: paraview.simple -except: from paraview.simple import * -from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation +Vendor = info.GetVendor().split()[0] -info = vtkPVOpenGLInformation() -info.CopyFromObject(None) -print("Vendor: %s" % info.GetVendor()) -print("Version: %s" % info.GetVersion()) -print("Renderer: %s" % info.GetRenderer()) -# should print -# "Vendor: NVIDIA Corporation" -# "Version: 4.5.0 NVIDIA 375.66" -# "Renderer: Tesla P100-PCIE-16GB/PCIe/SSE2" +""" +>>> info.GetRenderer() +'SWR (LLVM 8.0, 256 bits)' +>>> info.GetVendor() +'Intel Corporation' +>>> info.GetVersion() +'3.3 (Core Profile) Mesa 18.3.3' +""" view = GetRenderView() +view.CameraPosition = [1.642208, 1.973803, 2.14555] +view.CameraViewUp = [-0.410182, -0.492857, 0.76736] +view.CameraFocalPoint = [0.0, 0.0, 0.0] +view.OrientationAxesVisibility = 0 sphere = Sphere() -sphere.ThetaResolution = 2048 -sphere.PhiResolution = 2048 +sphere.ThetaResolution = 1024 +sphere.PhiResolution = 1024 pidscal = ProcessIdScalars(sphere) -rep = Show(pidscal) - -if(GetParaViewVersion() >= 5.5): - from vtkmodules.vtkPVClientServerCoreCorePython import vtkProcessModule -else: - from vtkPVClientServerCoreCorePython import vtkProcessModule - -print("rank=", vtkProcessModule.GetProcessModule().GetPartitionId()) -print("total=", vtkProcessModule.GetProcessModule().GetNumberOfLocalPartitions()) -nbprocs = servermanager.ActiveConnection.GetNumberOfDataPartitions() -drange = [0, nbprocs-1] - -lt = MakeBlueToRedLT(drange[0], drange[1]) -lt.NumberOfTableValues = nbprocs +rep = Show(pidscal, view) +ColorBy(rep, 'ProcessId') +processIdLUT = GetColorTransferFunction('ProcessId') +processIdLUT.AnnotationsInitialized = 1 +processIdLUT.InterpretValuesAsCategories = 1 + +# we take colors from the pre-defined "KAAMS" found in +# ParaViewCore/ServerManager/Rendering/ColorMaps.json +IndexedColors = [ + 1.0, 1.0, 1.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + 1.0, 1.0, 0.0, + 1.0, 0.0, 1.0, + 0.0, 1.0, 1.0, + 0.63, 0.63, 1.0, + 0.67, 0.5, 0.33, + 1.0, 0.5, 0.75, + 0.53, 0.35, 0.7, + 1.0, 0.75, 0.5 +] + +a = [] +for i in range(nbprocs): + a.extend((str(i), str(i))) +processIdLUT.Annotations = a +processIdLUT.IndexedColors = IndexedColors + +processIdLUTColorBar = GetScalarBar(processIdLUT, view) +processIdLUTColorBar.Title = 'PId' +processIdLUTColorBar.ComponentTitle = '' + +# set color bar visibility +processIdLUTColorBar.Visibility = 1 + +# show color legend +rep.SetScalarBarVisibility(view, True) -rep.LookupTable = lt -rep.ColorArrayName = ("POINT_DATA", "ProcessId") +view.Background = [.7, .7, .7] -bar = CreateScalarBar(LookupTable=lt, Title="PID") -bar.TitleColor = [0, 0, 0] -bar.LabelColor = [0, 0, 0] -# bar.NumberOfLabels = 6 -view.Representations.append(bar) +Render() -view.Background = [.7, .7, .7] -view.CameraViewUp = [0, 1, 0] -view.StillRender() -view.ResetCamera() view.ViewSize = [1024, 1024] # change the pathname to a place where you have write access -SaveScreenshot(filename=basename + "/coloredSphere_v" + Version + "_00.png", - view=view) -# SaveScreenshot(filename = "/users/jfavre/coloredSphere_v" + Version + "_00.png", view=view) - -view.CameraViewUp = [0, 0, 1] -view.CameraFocalPoint = [0, 0, 0] -view.CameraPosition = [0, 1, 0] -view.ResetCamera() -# change the pathname to a place where you have write access -SaveScreenshot(filename=basename + "/coloredSphere_v" + Version + "_01.png", - view=view) - -view.CameraViewUp = [0, 0, 1] -view.CameraFocalPoint = [0, 0, 0] -view.CameraPosition = [0, -1, 0] -view.ResetCamera() -# change the pathname to a place where you have write access -SaveScreenshot(filename=basename + "/coloredSphere_v" + Version + "_02.png", - view=view) +filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" +SaveScreenshot(filename=filename, view=view) +print("writing ", filename) diff --git a/cscs-checks/apps/paraview/src/newcoloredSphere.py b/cscs-checks/apps/paraview/src/newcoloredSphere.py deleted file mode 100644 index 6fa6e8d7e4..0000000000 --- a/cscs-checks/apps/paraview/src/newcoloredSphere.py +++ /dev/null @@ -1,98 +0,0 @@ -from paraview.simple import * -import os -basename = os.getenv('SCRATCH') -if basename is None: - basename = "/tmp" - -Version = str(GetParaViewVersion()) -if(GetParaViewVersion() > 5.6): - from paraview.modules.vtkPVClientServerCoreCorePython import ( - vtkProcessModule) - info = GetOpenGLInformation(location=servermanager.vtkSMSession.RENDER_SERVER) -else: - from paraview.servermanager import vtkProcessModule - from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation - info = vtkPVOpenGLInformation() - info.CopyFromObject(None) - -rank = vtkProcessModule.GetProcessModule().GetPartitionId() -nbprocs = servermanager.ActiveConnection.GetNumberOfDataPartitions() - -if rank == 0: - print("ParaView Version ", Version) - print("rank=", rank, "/", nbprocs) - print("Vendor: %s" % info.GetVendor()) - print("Version: %s" % info.GetVersion()) - print("Renderer: %s" % info.GetRenderer()) - -Vendor = info.GetVendor().split()[0] - -""" ->>> info.GetRenderer() -'SWR (LLVM 8.0, 256 bits)' ->>> info.GetVendor() -'Intel Corporation' ->>> info.GetVersion() -'3.3 (Core Profile) Mesa 18.3.3' -""" - -view = GetRenderView() -view.CameraPosition = [1.642208, 1.973803, 2.14555] -view.CameraViewUp = [-0.410182, -0.492857, 0.76736] -view.CameraFocalPoint = [0.0, 0.0, 0.0] -view.OrientationAxesVisibility = 0 - -sphere = Sphere() -sphere.ThetaResolution = 1024 -sphere.PhiResolution = 1024 - -pidscal = ProcessIdScalars(sphere) - -rep = Show(pidscal, view) -ColorBy(rep, 'ProcessId') -processIdLUT = GetColorTransferFunction('ProcessId') -processIdLUT.AnnotationsInitialized = 1 -processIdLUT.InterpretValuesAsCategories = 1 - -# we take colors from the pre-defined "KAAMS" found in -# ParaViewCore/ServerManager/Rendering/ColorMaps.json -IndexedColors = [ - 1.0, 1.0, 1.0, - 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0, - 1.0, 1.0, 0.0, - 1.0, 0.0, 1.0, - 0.0, 1.0, 1.0, - 0.63, 0.63, 1.0, - 0.67, 0.5, 0.33, - 1.0, 0.5, 0.75, - 0.53, 0.35, 0.7, - 1.0, 0.75, 0.5 -] - -a = [] -for i in range(nbprocs): - a.extend((str(i), str(i))) -processIdLUT.Annotations = a -processIdLUT.IndexedColors = IndexedColors - -processIdLUTColorBar = GetScalarBar(processIdLUT, view) -processIdLUTColorBar.Title = 'PId' -processIdLUTColorBar.ComponentTitle = '' - -# set color bar visibility -processIdLUTColorBar.Visibility = 1 - -# show color legend -rep.SetScalarBarVisibility(view, True) - -view.Background = [.7, .7, .7] - -Render() - -view.ViewSize = [1024, 1024] -# change the pathname to a place where you have write access -filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" -SaveScreenshot(filename=filename, view=view) -print("writing ", filename) From 549a740fc0ac99134cfd6361b5e2536eafa8882c Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 11 Oct 2019 13:35:31 +0200 Subject: [PATCH 8/9] Add omitted file --- cscs-checks/apps/paraview/src/coloredSphere.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cscs-checks/apps/paraview/src/coloredSphere.py b/cscs-checks/apps/paraview/src/coloredSphere.py index 6fa6e8d7e4..dbcdc1faea 100644 --- a/cscs-checks/apps/paraview/src/coloredSphere.py +++ b/cscs-checks/apps/paraview/src/coloredSphere.py @@ -8,7 +8,8 @@ if(GetParaViewVersion() > 5.6): from paraview.modules.vtkPVClientServerCoreCorePython import ( vtkProcessModule) - info = GetOpenGLInformation(location=servermanager.vtkSMSession.RENDER_SERVER) + info = GetOpenGLInformation( + location=servermanager.vtkSMSession.RENDER_SERVER) else: from paraview.servermanager import vtkProcessModule from vtk.vtkPVClientServerCoreRendering import vtkPVOpenGLInformation From cd8245de3af20fc3b4da1d181c0f64f10158c306 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 11 Oct 2019 13:51:59 +0200 Subject: [PATCH 9/9] Update Paraview check --- cscs-checks/apps/paraview/paraview_check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cscs-checks/apps/paraview/paraview_check.py b/cscs-checks/apps/paraview/paraview_check.py index 82c5d070fa..91769ddb0a 100644 --- a/cscs-checks/apps/paraview/paraview_check.py +++ b/cscs-checks/apps/paraview/paraview_check.py @@ -1,6 +1,7 @@ import reframe as rfm import reframe.utility.sanity as sn + @rfm.simple_test class ParaViewCheck(rfm.RunOnlyRegressionTest): def __init__(self): @@ -13,7 +14,7 @@ def __init__(self): self.time_limit = (0, 1, 0) self.executable = 'pvbatch' - self.executable_opts = ['newcoloredSphere.py'] + self.executable_opts = ['coloredSphere.py'] self.maintainers = ['JF'] self.tags = {'scs', 'production'}