<div dir="ltr"><div><div><div>Hi Joan,<br><br></div>Is fname different between the different MPI controllers? Other than that everything looks correct to me. If that's not the issue could you share some sample code that demonstrates the problem? I know I've done this sort of thing in the past and it worked properly but it's possible that this became broken somewhere along the way.<br><br></div>Best,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 20, 2018 at 1:07 PM, Joan Baiges <span dir="ltr"><<a href="mailto:joan.baiges@upc.edu" target="_blank">joan.baiges@upc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>I am trying to write several .vtu and .pvtu files by using several MPI_Communicators. For this, I Splitinitialize a vtkMPIController object, and then set this controller as the controller for a vtkXMLPUnstructuredGridWriter.</div><div><br></div><div>However, when I ask the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">vtkXMLPUnstructuredGridWri<wbr>ter->Write(), only one .pvtu file is written, while I would expect that one .pvtu file is written for each of the communicators the MPI_COMM_WORLD has been subdivided into. On the other hand, the .vtu files are written properly for all the processors in all the split mpi controllers.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">The code I am writing looks approximately like this:</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div>vtkMPIController* controller;</div><div>vtkMPICommunicator* communicator;</div><div><div>vtkSmartPointer<<wbr>vtkUnstructuredGrid> unstructuredGrid;</div><div>vtkSmartPointer<<wbr>vtkXMLPUnstructuredGridWriter> parallelwriter;</div></div></span></div><div><br></div><div>//New communicator and spliting of the communicator</div><div><div>communicator = vtkMPICommunicator::New();</div><div>communicator = vtkMPICommunicator::<wbr>GetWorldCommunicator();</div><div>communicator->SplitInitialize(<wbr>communicator,MulticommColor,<wbr>MPIrank);<br></div><div><br></div><div>//Setting the split communicator as the communicator for the controller</div><div><div> controller = vtkMPIController::New();</div><div> controller->SetCommunicator(<wbr>communicator);<br></div><div> controller->Initialize();<br></div><div> controller-><wbr>SetGlobalController(<wbr>controller);<br></div></div><div><br></div><div>//Initializing the parallelwriter with the controller</div><div><div>parallelwriter = vtkSmartPointer<<wbr>vtkXMLPUnstructuredGridWriter><wbr>::New();</div><div>   parallelwriter-><wbr>SetController(controller);</div><div>   parallelwriter-><wbr>SetNumberOfPieces(MPIsize);</div><div>   parallelwriter-><wbr>SetGhostLevel(1);</div><div>   parallelwriter-><wbr>SetStartPiece(MPIrank);</div><div>   parallelwriter->SetEndPiece(<wbr>MPIrank);</div></div><div><br></div><div>//setting file name</div><div><div>fname = std::string(filename);</div><div><span style="white-space:pre-wrap"> </span>fname.append(".pvtu");</div><div><span style="white-space:pre-wrap"> </span>parallelwriter->SetFileName(<wbr>fname.c_str());</div></div><div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br class="m_4571177740588631540gmail-Apple-interchange-newline">//Setting the grid</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">unstructuredGrid = vtkSmartPointer<<wbr>vtkUnstructuredGrid>::New();<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">parallelwriter->SetInputData(<wbr>unstructuredGrid);</div><br></div><div><br></div><div>//After writing the grid info, we call the parallelwriter to write</div><div>parallelwriter->Write();<br></div><div><br></div><div>This final line causes all the processors to write the .vtu files, however only one processor writes the .pvtu file, while I would expect/like one .pvtu file per split mpi communicator.</div><div><br></div><div>Thank you in advance for your help,</div><div><br></div><div>Joan</div><div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>