hate that...

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Mon, Nov 3, 2014 at 2:26 PM, David E DeMarle <[email protected]>
wrote:

> The sphere source has a hardcoded limit of 1 million triangles for some
> reason .
>
> Plugins/MantaView/VTK/vtkMantaTestSource will generate as many as you want
> in parallel. The dataset is kind of nonsensical though, just a long strand
> of randomly jittered triangles.
>
> More recently I came up with the attached script that you can tune various
> parameters of to get something that more closely represents typical
> scientific data. I plan to push it into benchmark.py the next time I have
> an opportunity to benchmark ParaView.
>
> The logs do not indicate whether what kind of context the rendering takes
> place in. That would be a welcome addition. Until then, follow Burlen's
> suggestions and take a look at the VTK level test
> vtkRenderingOpenGLCxx-TestFBO which spits out all kinds of useful
> information.
>
>
>
>
>
>
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
> On Wed, Oct 29, 2014 at 11:31 PM, R C Bording <[email protected]> wrote:
>
>> Hi Utkarsh,
>>   Is there simple way to see if my installation of ParaView done using
>> the ParaViewSuperbuild is configure with the correct gl libs to run on the
>> GPUs.  Should I need to install a version with Mesa to benchmark against or
>> is there a way to that without installing a second version?
>>
>> Do the log files show if Paraview is rendering on Hardware or software?
>>
>> Cheers,
>> Chris B.
>>
>>
>> R. Christopher Bording
>> Supercomputing Team-iVEC@UWA
>> E: [email protected]
>> T: +61 8 6488 6905
>>
>> 26 Dick Perry Avenue,
>> Technology Park
>> Kensington, Western Australia.
>> 6151
>>
>>
>>
>>
>>
>> On 30/10/2014, at 12:36 AM, Utkarsh Ayachit wrote:
>>
>> That'd work. You can use the benchmark module [1] too to give you info
>> at a finer granularity.
>>
>> Utkarsh
>>
>> [1]
>> http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.benchmark.html
>>
>> On Mon, Oct 27, 2014 at 12:12 PM, R C Bording <[email protected]> wrote:
>>
>> Hi,
>>
>>  Is there a rendering model that you have for testing the performance of
>>
>> the paraview?
>>
>> I have install paraview on our GPU cluster and would like validated it
>>
>> someway other than
>>
>> just putting timing calls around the Render command in the
>> parallelSphere.py
>>
>> script.
>>
>>
>> Or is that sufficient?
>>
>>
>> Cheers,
>>
>> Chris B
>>
>>
>> R. Christopher Bording
>>
>> Supercomputing Team-iVEC@UWA
>>
>> E: [email protected]
>>
>> T: +61 8 6488 6905
>>
>>
>> 26 Dick Perry Avenue,
>>
>> Technology Park
>>
>> Kensington, Western Australia.
>>
>> 6151
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> Powered by www.kitware.com
>>
>>
>> Visit other Kitware open-source projects at
>>
>> http://www.kitware.com/opensource/opensource.html
>>
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>>
>> http://paraview.org/Wiki/ParaView
>>
>>
>> Follow this link to subscribe/unsubscribe:
>>
>> http://public.kitware.com/mailman/listinfo/paraview
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

import datetime as dt

exedir = 'bin/'
outlog_dir = './'

numServerProc = 0
outlog_filename = 'log'
record_memuse = True

records = []

import sys
for i in range(1, len(sys.argv)):
    arg = sys.argv[i]
    if arg == "-np":
        numServerProc = sys.argv[i+1]
    if arg == "-noMem":
        record_memuse = False
    if arg == "-ofile":
        outlog_filename = sys.argv[i+1]

outlog_filename = outlog_dir + outlog_filename

memfile = open(outlog_filename+".args.txt", "w")
memfile.write(str(dt.datetime.now())+"\n")
memfile.write(str(sys.argv)+"\n")
memfile.close

if numServerProc > 0:
    from subprocess import Popen
    Popen(["mpirun", "-np", numServerProc, exedir+"pvserver"])
    from time import sleep
    sleep(5)
    Connect("localhost",11111)

import paraview.benchmark as bm
bm.maximize_logs()

n0 = dt.datetime.now()

def memtime_stamp():
    global records
    global n0
    global record_memuse
    if record_memuse:
        m = bm.get_memuse()
    else:
        m = "?"
    n1 = dt.datetime.now()
    et = n1 - n0
    print et, m
    n0 = n1
    records.append([et, m])

memtime_stamp()

#instantiate the source
gen = ProgrammableSource( guiName="ProgrammableSource1", OutputDataSetType='vtkMultiblockDataSet', PythonPath='', ScriptRequestInformation='try:\n    ntimes\nexcept NameError:\n    ntimes = 100\nprint ntimes\n\ntimesteps = (range(0, ntimes, 1))\n\nexecutive = self.GetExecutive()\noutInfo = executive.GetOutputInformation(0)\noutInfo.Remove(executive.TIME_STEPS())\nfor timestep in timesteps:\n    outInfo.Append(executive.TIME_STEPS(), timestep)\noutInfo.Remove(executive.TIME_RANGE())\noutInfo.Append(executive.TIME_RANGE(), timesteps[0])\noutInfo.Append(executive.TIME_RANGE(), timesteps[-1])\n', Script='import vtk\nimport math\n\n#Specify parameters that control the synthetic\n#data\'s size and structure. These can be set \n#externally with the Parameter proxy\n\n#number of timesteps defined in RequestInformation\n\n#the shape of the multiblock tree we create\ntry:\n    nlevels\nexcept NameError:\n    nlevels = 0\ntry:\n    branchfactor\nexcept NameError:\n    branchfactor = 1\ntry:\n    nblocks\nexcept NameError:\n    nblocks = 64\n\ntotalblocks = pow(branchfactor, nlevels)*nblocks\n\n#define how the data arrays will be grown\ntry:\n    nArrays\nexcept NameError:\n    nArrays = 11\n\n\n#helper functions to simplify temporal processing\ndef GetUpdateTimestep(algorithm):\n    executive = algorithm.GetExecutive()\n    outInfo = executive.GetOutputInformation(0)\n    if not outInfo.Has(executive.UPDATE_TIME_STEP()):\n        return None\n    return outInfo.Get(executive.UPDATE_TIME_STEP())\n\ndef LookupTime(algorithm, req_time):\n    #find the lists of times we said we provided in RI\n    executive = algorithm.GetExecutive()\n    outInfo = executive.GetOutputInformation(0)\n    timesteps = outInfo.Get(executive.TIME_STEPS())\n    #find closest match for requested time\n    x = 0\n    lx = x\n    done = False\n    while x < len(timesteps) and not done:\n        if timesteps[x] < req_time:\n            lx = x\n            x = x + 1\n        else:\n            done = True\n    return timesteps[lx]\n\n#helper functions to simplify parallel processing\ndef GetPartition(algorithm):\n    #find out what the pipeline told us about where we are\n    executive = algorithm.GetExecutive()\n    outInfo = executive.GetOutputInformation(0)\n    procNum = 0\n    numProcs = 1\n    if outInfo.Has(executive.UPDATE_PIECE_NUMBER()):\n       procNum = outInfo.Get(executive.UPDATE_PIECE_NUMBER())\n    if outInfo.Has(executive.UPDATE_NUMBER_OF_PIECES()):\n       numProcs = outInfo.Get(executive.UPDATE_NUMBER_OF_PIECES())\n    return procNum, numProcs\n\ndef IOwnIt(block, nblocks):\n    if numProcs < 1:\n      return True\n    if nblocks == 1:\n      return True\n    if nblocks < numProcs:\n      if block == proc:\n        return True\n      return False\n    s = proc*nblocks/numProcs\n    e = (proc+1)*nblocks/numProcs\n    if block >= s:\n      if block < e or proc == numProcs-1:\n         return True\n    return False\n\n\n#a helper to place blocks in a decent pattern\nthirdroot = int(math.ceil(pow(totalblocks, 1.0/3.0)))\ndef getcoords(block, sx=1, sy=1, sz=1, scale=1):\n    x = block%thirdroot * (sx+scale)\n    y = block/thirdroot%thirdroot * (sy+scale)\n    z = block/(thirdroot*thirdroot) * (sz+scale)\n    return x,y,z\n\n#a pipeline to procedurally generate a sample dataset \n#we make many copies of it to populate the tree with\n#choose a different source to change it\n\n#extent of base data that this pipeline starts with\ntry:\n    baseExt\nexcept NameError:\n    baseExt = 25\nidp = vtk.vtkRTAnalyticSource()\nidp.SetWholeExtent(-baseExt,baseExt,-baseExt,baseExt,-baseExt,baseExt)\ntoUG = vtk.vtkThreshold()\ntoUG.SetInputConnection(idp.GetOutputPort())\ntoUG.ThresholdByUpper(70)\ntoUG.Update()\n\n#duplicate an attribute array to consume more space\n#if you use a different source, you might want a cell array\noutdata = toUG.GetOutput()\naPtArray = outdata.GetPointData().GetArray(0)\nfor a in range(0, nArrays):\n  acopy = aPtArray.NewInstance()\n  acopy.DeepCopy(aPtArray)\n  acopy.SetName("Copy_"+str(a))\n  outdata.GetPointData().AddArray(acopy)\n\n#get control over the geometry\ntf = vtk.vtkTransformFilter()\nxform = vtk.vtkTransform()\nxform.Identity()\ntf.SetTransform(xform)\ntf.SetInputData(outdata)\nxbds = outdata.GetBounds()[1]-outdata.GetBounds()[0]\nybds = outdata.GetBounds()[3]-outdata.GetBounds()[2]\nzbds = outdata.GetBounds()[5]-outdata.GetBounds()[4]\n\n#get requested time and lookup the corresponding time\nreq_time = GetUpdateTimestep(self)\ndata_time = LookupTime(self, req_time)\n\n#find out where we are in parallel\nproc, numProcs = GetPartition(self)\n\n#a global variable to keep track of location\nglobalvar_crsr = [0]\n\n# make an populate the tree\ndef makesublevel(currlevel, levelint):\n   if levelint < nlevels:\n      currlevel.SetNumberOfBlocks(branchfactor)\n      for b in range(0, branchfactor):\n         child = vtk.vtkMultiBlockDataSet()\n         currlevel.SetBlock(b, child)\n         makesublevel(child, levelint+1)\n   else:\n      currlevel.SetNumberOfBlocks(nblocks)\n      for b in range(0, nblocks):\n         crsr = globalvar_crsr[0]\n         globalvar_crsr[0] = crsr+1\n         #break up data in parallel\n         if IOwnIt(b, nblocks):\n           xform.Identity()\n           px,py,pz = getcoords(crsr, xbds, ybds, zbds, data_time)\n           xform.Translate(px, py, pz)\n           tf.SetTransform(xform)\n           tf.Update()\n           ds = tf.GetOutput().NewInstance()\n           ds.DeepCopy(tf.GetOutput())\n         else:\n           ds = None\n         currlevel.SetBlock(b, ds)\n\noutput = self.GetOutput()\noutput.GetInformation().Set(\n  vtk.vtkDataObject.DATA_TIME_STEP(), data_time)\nmakesublevel(output, 0)\n' )

ntimes = 5
nlevels = 0
branchfactor = 0
nblocks = 32
nArrays = 2
baseExt = 10

paramprop = gen.GetProperty("Parameters")
paramprop.SetElement(0, "ntimes")
paramprop.SetElement(1, str(ntimes))
paramprop.SetElement(2, "nlevels")
paramprop.SetElement(3, str(nlevels))
paramprop.SetElement(4, "branchfactor")
paramprop.SetElement(5, str(branchfactor))
paramprop.SetElement(6, "nblocks")
paramprop.SetElement(7, str(nblocks))
paramprop.SetElement(8, "nArrays")
paramprop.SetElement(9, str(nArrays))
paramprop.SetElement(10, "baseExt")
paramprop.SetElement(11, str(baseExt))
gen.UpdateProperty("Parameters")

gen.UpdatePipeline()

memtime_stamp()

RenderView1 = GetRenderView()
DataRepresentation1 = Show()

Render()
memtime_stamp()
RenderView1.ResetCamera()
Render()

ProgrammableSource0 = ProgrammableSource()
ProgrammableSource0.PythonPath = ''
ProgrammableSource0.ScriptRequestInformation = ''
ProgrammableSource0.Script = 'import resource\nimport os\npid = os.getpid()\nmem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss/1024/1024\nprint "[", pid, ":", mem, "]"'
ProgrammableSource0.UpdatePipeline()

#run through timesteps show data and obtain memory use after each time
for index in xrange(0,ntimes,1):
    RenderView1.ViewTime = index
    Render()
    memtime_stamp()

memfile = open(outlog_filename+".mem.txt", "w")
for x in records:
    memfile.write(str(x))
    memfile.write("\n")
memfile.close()
bm.parse_logs()
bm.dump_logs(outlog_filename+".log")
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to