<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">In the below code, I was trying to read and partition an unstructured grid data (11.7 GB). However, it always came out an error that:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">terminate called after throwing an instance of 'std::bad_alloc'</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  what():  std::bad_alloc</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">===================================================================================</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=   PID 14658 RUNNING AT compute001</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=   EXIT CODE: 134</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=   CLEANING UP REMAINING PROCESSES</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">=   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">===================================================================================</span></div></div><div class=""><br class=""></div><div class="">Actually the memory of my computer is about 1.5 TB (96*16 GB modules). I think the memory is enough. Can anyone help me about this problem? Any operation in the program is wrong?</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">int</span><span style="font-variant-ligatures: no-common-ligatures" class=""> main(</span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">int</span><span style="font-variant-ligatures: no-common-ligatures" class=""> argc, </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">char</span><span style="font-variant-ligatures: no-common-ligatures" class="">** argv)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  vtkMPIController *contr = vtkMPIController::New();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  contr->Initialize(&argc, &argv);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  vtkMultiProcessController::SetGlobalController(contr);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">int</span><span style="font-variant-ligatures: no-common-ligatures" class=""> numProcs = contr->GetNumberOfProcesses();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">int</span><span style="font-variant-ligatures: no-common-ligatures" class=""> me = contr->GetLocalProcessId();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  vtkUnstructuredGridReader *reader = vtkUnstructuredGridReader::New();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(83, 48, 225);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  vtkUnstructuredGrid *ds = </span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">NULL</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">; </span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(83, 48, 225);" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce7924" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (me == </span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">    reader->SetFileName(</span><span style="font-variant-ligatures: no-common-ligatures" class="">“data.vtk"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    ds = reader->GetOutput();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    reader->Update();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(195, 55, 32); font-variant-ligatures: no-common-ligatures;" class="">  </span><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span><span style="color: rgb(195, 55, 32); font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(206, 121, 36);" class="">else</span><span style="color: rgb(195, 55, 32); font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(83, 48, 225);" class="">   </span> ds = vtkUnstructuredGrid::New();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  vtkDistributedDataFilter *dd = vtkDistributedDataFilter::New();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  dd->SetInputData(ds);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  dd->SetController(contr);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  dd->UseMinimalMemoryOff();</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  dd->SetBoundaryModeToAssignToOneRegion();</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  dd->Update();</span></div><div style="margin: 0px; line-height: normal; color: rgb(83, 48, 225);" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #34bd26" class="">int</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ncells = vtkUnstructuredGrid::SafeDownCast(dd->GetOutput())->GetNumberOfCells();</span></div><div style="margin: 0px; line-height: normal; color: rgb(195, 55, 32);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  fprintf(</span><span style="font-variant-ligatures: no-common-ligatures" class="">stderr</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures" class="">"rank = </span><span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">%d</span><span style="font-variant-ligatures: no-common-ligatures" class="">, number of cells = </span><span style="font-variant-ligatures: no-common-ligatures; color: #d53bd3" class="">%d\n</span><span style="font-variant-ligatures: no-common-ligatures" class="">"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, me, ncells);</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(206, 121, 36);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span><span style="font-variant-ligatures: no-common-ligatures" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><br class=""></div></span></div></body></html>