[vtkusers] For people at kitware : ReleaseDataFlagOn question

Naveen Kumar Polapally naveenpkumar at hotmail.com
Wed Nov 7 22:34:27 EST 2001


hi all,
For some time now i have been trying to use ReleaseData feature in my 
parallel program but couldn't do so. Now i found out that the problem is not 
with VTK but it is with MPI. It seems we cannot release the memory allocated 
after MPI::Init. I have a simple program here you can check the memory 
consumption on your machine .

I think some thing should be done about it because the release data feature 
is most useful in case of large datasets and parallel programs.


#include <iostream.h>
#include "mpi++.h"
#include <unistd.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{
  MPI::Init(argc, argv);

  int rank = MPI::COMM_WORLD.Get_rank();
  int size = MPI::COMM_WORLD.Get_size();

  int *Ptr=new int[10000000];

  for(int i=0;i<10000000;i++) Ptr[i]=0;
  cout<<" allocated  "<<endl;
  sleep(15);

  delete Ptr;
  cout<<" just deleted   "<<endl;
  sleep(15);

  cout << "Hello World! I am " << rank << " of " << size << endl;

  MPI::Finalize();
}


Thanks,
naveen.




>From: "Naveen Kumar Polapally" <naveenpkumar at hotmail.com>
>To: vtkusers at public.kitware.com
>Subject: Re: [vtkusers] ReleaseDataFlagOn question
>Date: Tue, 06 Nov 2001 22:37:59
>
>
>hi,
>
>For some days now i have been complaining that ReleaseData feature is not
>working for graphical pipeline while it is working for imaging pipeline. No
>wonder no one answered, because i was wrong.
>
>
>I am rephrasing my question,for a pipeline shown below the release data
>machanism is working. But when i parallelize it it does not work.
>
>vtkImageReader *reader = vtkImageReader::New();
>reader->SetDataByteOrderToBigEndian();
>reader->SetDataExtent(0, 511, 0,511,Mainzmin,Mainzmax);
>reader->SetFilePrefix("/home/devel/vtk/vtkdata/vfem/slice");
>reader->ReleaseDataFlagOn();
>reader->SetDataSpacing(1, 1, 1);
>
>
>vtkSynchronizedTemplates3D *iso =  vtkSynchronizedTemplates3D::New()
>iso->SetInput(reader->GetOutput());
>iso->SetValue(0,600);
>iso->Update();
>
>I narrowed my problem to the method shown below.
>
>vtkShortArray::~vtkShortArray()
>{
>  if ((this->Array) && (!this->SaveUserArray))
>    {
>      delete [] this->Array;
>    }
>  delete [] this->Tuple;
>}
>
>Both the parallel and sequential executions call this method and both of
>them delete the this->Array. This is the array which holds all the data of
>the output of vtkImageReader. But only in case of sequential program  i see
>a reduction of memory usage, while in case of parallel program i don't see
>any change in memory usage. I am unable to explain this as the memory gets
>allocated in vtkShortArray::Allocate method into Array when you delete it,
>it has to free the memory.
>
>
>Any help is appreciated.
>
>
>
>thanks,
>naveen.
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




More information about the vtkusers mailing list