Commit 5671f4d5 authored by Claudio Gheller's avatar Claudio Gheller
Browse files

seg fault on one core execution

parent 57bf64fc
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -48,9 +48,7 @@ void init(int index)
   metaData_calculation();

   // Allocate Data Buffer
   // CLAAAAAA assume here that data shape/size will never change across multiple data read
   allocate_memory();
   //if (index == 0) allocate_memory();
   allocate_memory(index);
  
   // Reading Data
   readData();
@@ -354,7 +352,7 @@ void metaData_calculation() {

}

void allocate_memory() {
void allocate_memory(int index) {


     // DAV: all these arrays can be allocatate statically for the sake of optimization. However be careful that if MPI is used
@@ -371,6 +369,8 @@ void allocate_memory() {

     // Create sector grid
     
     if (index == 0)
     {
       size_of_grid = 2*param.num_w_planes*xaxis*yaxis;

       int size_of_grid_pointers = (3 + 2*(param.reduce_method != REDUCE_RING)) * size_of_grid;     
@@ -393,6 +393,7 @@ void allocate_memory() {
     // CLAAAAA these two arrays are need ONLY for I/O purposes. Can be improved!
       gridss_real = gridss_w + size_of_grid;
       gridss_img  = gridss_real + size_of_grid / 2;
     }
          
}

+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ void read_parameter_file(char *);
void fileName(char datapath[900], char file[30]);
void readMetaData(char fileLocal[1000]);
void metaData_calculation();
void allocate_memory();
void allocate_memory(int);
void readData();

#ifdef __cplusplus