[vtkusers] writing parallel files from a serial process
John Vines (CISD/HPCD)
jvines at arl.army.mil
Fri Nov 21 14:59:28 EST 2008
Jean,
The format is vtkPolyData, I believe the unstructured path is where I will start.
Thanks for the help,
John
Jean Favre wrote:
> John Vines (CISD/HPCD) wrote:
>
>> All,
>> I have a large amount of data, a single file is approximately 10GB.
>> The files were written in a serial format and I need to convert them
>> to a parallel format, how could I do this in VTK?
>>
> you're not saying what type of data you have... I see two solutions:
>
> 1) if it is structured, all the vtkXMLP*Writer will do that on a serial
> pipe.
>
> for example:
>
> int N = 4;
> vtkXMLPImageDataWriter piw = vtkXMLPImageDataWriter::New();
> piw->SetInputConnection(reader->GetOutputPort());
> piw->SetFileName("/pathtofilename/file.pvti");
> piw->SetNumberOfPieces(N);
> piw->SetStartPiece(0);
> piw->SetEndPiece(N-1);
> piw->WriteSummaryFileOn();
> piw->Write()
>
> 2) if is is unstructured, you need D3 to cut the data, and D3 needs a
> parallel controller. I do not think you can do it with a serial process.
>
> running pvpython with a parallel pvserver and executing the following
> should do the job:
>
> from paraview import servermanager as sm
> sm.Connect("name") # with the name of your host running pvserver
> reader = sm.sources.XMLUnstructuredGridReader(FileName="mesh.vtu")
> d3 = sm.filters.D3()
> d3.Input = reader
> d3.BoundaryMode = 0 #Assign cells uniquely
> writer = sm.writers.XMLPUnstructuredGridWriter(FileName="/tmp/umesh.pvtu")
> writer.NumberOfPieces = 4
> writer.Input = d3
> writer.UpdatePipeline()
>
> Jean --
> Swiss National Supercomputing Center
>
More information about the vtkusers
mailing list