[vtkusers] A problem of data partitioning
张江
zhangjiang.dudu at gmail.com
Tue Jul 5 11:33:24 EDT 2016
Hi,
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:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 14658 RUNNING AT compute001
= EXIT CODE: 134
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
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?
int main(int argc, char** argv)
{
vtkMPIController *contr = vtkMPIController::New();
contr->Initialize(&argc, &argv);
vtkMultiProcessController::SetGlobalController(contr);
int numProcs = contr->GetNumberOfProcesses();
int me = contr->GetLocalProcessId();
vtkUnstructuredGridReader *reader = vtkUnstructuredGridReader::New();
vtkUnstructuredGrid *ds = NULL;
if (me == 0) {
reader->SetFileName(“data.vtk");
ds = reader->GetOutput();
reader->Update();
} else {
ds = vtkUnstructuredGrid::New();
}
vtkDistributedDataFilter *dd = vtkDistributedDataFilter::New();
dd->SetInputData(ds);
dd->SetController(contr);
dd->UseMinimalMemoryOff();
dd->SetBoundaryModeToAssignToOneRegion();
dd->Update();
int ncells = vtkUnstructuredGrid::SafeDownCast(dd->GetOutput())->GetNumberOfCells();
fprintf(stderr, "rank = %d, number of cells = %d\n", me, ncells);
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160705/101b69b1/attachment-0001.html>
More information about the vtkusers
mailing list