[Trilinos-Users] HDF5 - segmentation fault

Villa Andrea (RSE) Andrea.Villa at rse-web.it
Sat Dec 22 02:06:57 MST 2012


I'm experiencing a segmentation fault running the following code with 4 processors.
I attach the driver below. The problem seems to be at line: hdf5.Write("nodes",nodes_epetra); 
Am I missing something?
Thankyou very much for any suggestion!



#include <cmath>
#include <iostream>

#include "Epetra_MpiComm.h"
#include "Epetra_Map.h"
#include "EpetraExt_DistArray.h"
#include "EpetraExt_HDF5.h"


int main(int argc, char *argv[])
{ 
  MPI_Init(&argc,&argv);
  Epetra_MpiComm epetraComm(MPI_COMM_WORLD);
  int numMyElements;
  int MyGlobalElements[4];
  
  if(epetraComm.MyPID() == 0)
  {
     numMyElements = 4;
     MyGlobalElements[0] = 0;
     MyGlobalElements[1] = 1;
     MyGlobalElements[2] = 2;
     MyGlobalElements[3] = 3;
  }
  
  if(epetraComm.MyPID() == 1)
  {
     numMyElements = 4;
     MyGlobalElements[0] = 4;
     MyGlobalElements[1] = 5;
     MyGlobalElements[2] = 6;
     MyGlobalElements[3] = 7;
  }
  
  if(epetraComm.MyPID() == 2)
  {
     numMyElements = 4;
     MyGlobalElements[0] = 8;
     MyGlobalElements[1] = 9;
     MyGlobalElements[2] = 10;
     MyGlobalElements[3] = 11;
  }
  
  if(epetraComm.MyPID() == 3)
  {
     numMyElements = 2;
     MyGlobalElements[0] = 12;
     MyGlobalElements[1] = 13;
  }
  
  Epetra_Map mappa(-1,numMyElements,MyGlobalElements,0,epetraComm);
  EpetraExt::DistArray<double> nodes_epetra(mappa,3);    
  
  EpetraExt::HDF5 hdf5(epetraComm);
  hdf5.Create("err.h5");
  hdf5.Write("nodes",nodes_epetra);
  hdf5.Close();

  MPI_Finalize();
}

RSE SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, in forza del quale l'assunzione di obbligazioni da parte della Società avviene con firma di un procuratore, munito di idonei poteri.
RSE adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). According to this RSE Compliance Programme, any commitment of RSE is taken by the signature of one Representative granted by a proper Power of Attorney. Le informazioni contenute in questo messaggio di posta elettronica sono riservate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o forma. Qualora Lei non fosse la persona destinataria del presente messaggio, La invitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazione al mittente. The information included in this e-mail and any attachments are confidential and may also be privileged. If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not to disclose the contents to any other person.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20121222/7a3dca78/attachment.html 


More information about the Trilinos-Users mailing list