Commit e02b5537 authored by myron's avatar myron

further acceleration of hdf5 reading

parent af0a209f
......@@ -635,6 +635,9 @@ void CCspace_initialise(CCspace * self ) {
MPI_Comm_rank(MPI_COMM_WORLD,&(self->iproc));
MPI_Comm_size(MPI_COMM_WORLD,&(self->nprocs));
self->shared_h5id = -1;
self->shared_h5DSid = -1;
self->slicesrequest=NULL;
......@@ -6502,8 +6505,12 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
pos_s_[2*sn_nb], pos_s_[2*sn_nb+1],
size_s_[2*sn_nb +0], size_s_[2*sn_nb +1],
rotation_vertical,
binning
binning,
&(self->shared_h5id),
&(self->shared_h5DSid)
) ;
}
} else {// ==================================
float *Bptr = NULL;
......
......@@ -37,6 +37,7 @@
#include<complex.h>
#include<cufft.h>
#include"edftools.h"
float quickselect(float * A, int left, int right, int k);
......@@ -1206,7 +1207,10 @@ struct CCspace_struct{
CCreading_infos reading_infos;
int iproc;
int nprocs;
hid_t shared_h5id ;
hid_t shared_h5DSid ;
int *snXtoken;
int **ff_read_status;
sem_t ff_sem;
......
......@@ -588,14 +588,12 @@ void read_data_from_h5_eli( char * filename,
* descrive quale parte del dataset leggo
*/
printf(" ofsets %d %d %d \n", nproj, pos0_clipped_, pos1 ) ;
offset[0] = nproj;
offset[1] = pos0_clipped_;
offset[2] = pos1;
int v_span = 1;
printf(" count %d %d %d \n", v_span, size0_clipped_-(pos0_clipped_-pos0_) , size1 ) ;
count[0] = v_span ;
......@@ -609,7 +607,6 @@ void read_data_from_h5_eli( char * filename,
* descrive la memoria su cui scrivo
*/
printf(" dimsm %d %d %d \n", v_span, size0_clipped_-(pos0_clipped_-pos0_) , size1 ) ;
dimsm[0] = v_span;
dimsm[1] = size0_clipped_-(pos0_clipped_-pos0_);
......@@ -711,11 +708,13 @@ void read_projSequence_from_h5( char * filename,
long int pos0 , long int pos1 ,
long int size0 , long int size1,
int rotation_vertical,
int binning
int binning,
hid_t *file,
hid_t *dataset
) {
hid_t file; /* handles */
hid_t dataset;
/* hid_t file; /\* handles *\/ */
/* hid_t dataset; */
hid_t memspace;
hid_t dataspace;
hsize_t dimsm[3]; /* dataset and chunk dimensions*/
......@@ -726,11 +725,13 @@ void read_projSequence_from_h5( char * filename,
herr_t status;
int rank ;
if(*file==-1) {
*file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
*dataset = H5Dopen(*file, dsname);
}
file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
dataset = H5Dopen(file, dsname);
dataspace = H5Dget_space(dataset);
dataspace = H5Dget_space(*dataset);
rank = H5Sget_simple_extent_ndims(dataspace);
assert(rank==3);
......@@ -750,7 +751,7 @@ void read_projSequence_from_h5( char * filename,
int v_span = nproj_intervals[ 2*iv+1 ] - nproj_intervals[ 2*iv ];
printf(" Reading %d projections starting at %d\n", v_span, offset[0] ) ;
printf(" Reading %d projections starting at %ld\n", v_span, (long int) offset[0] ) ;
offset[1] = pos0;
offset[2] = pos1;
......@@ -789,17 +790,17 @@ void read_projSequence_from_h5( char * filename,
*/
status = H5Dread(dataset, H5T_NATIVE_FLOAT, memspace, dataspace,
status = H5Dread(*dataset, H5T_NATIVE_FLOAT, memspace, dataspace,
H5P_DEFAULT, target + Ntot*size0*size1 );
status=status;
}
H5Dclose(dataset);
// H5Dclose(dataset);
H5Sclose(dataspace);
H5Sclose(memspace);
H5Fclose(file);
// H5Fclose(file);
}
......
......@@ -32,7 +32,7 @@
#include<semaphore.h>
#define H5Dopen_vers 1
#include <hdf5.h>
#include<hdf5.h>
......@@ -106,7 +106,9 @@ void read_projSequence_from_h5( char * filename,
long int pos0 , long int pos1 ,
long int size0 , long int size1,
int rotation_vertical,
int binning
int binning,
hid_t *file,
hid_t *dataset
) ;
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>
#include<hdf5.h>
///
/// HDF5 simple wrapper for basics operations
......
......@@ -517,7 +517,7 @@ def do_pyhst():
runtime_library_dirs=[CUDA['lib']],
extra_compile_args={'gcc': ["-fPIC", "-O3"],
'nvcc': CUDA["arch"] + ["--compiler-options", "-fPIC,-O3" ,"-D_FORCE_INLINES"]},
include_dirs=[numpy.get_include(), CUDA['include'], 'PyHST/Cspace'])
include_dirs=[numpy.get_include(), CUDA['include'], 'PyHST/Cspace']+ hdf5_dirs)
return module
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment