Commit 93b9a1ae authored by myron's avatar myron

semaphore

parent e02b5537
......@@ -631,6 +631,7 @@ void CCspace_initialise(CCspace * self ) {
sem_init(&(self->proupdate_sem), 0, 1);
sem_init(&(self->filereading_sem),0,10) ;
sem_init(&(self->hdf5sequence_sem),0,1) ;
MPI_Comm_rank(MPI_COMM_WORLD,&(self->iproc));
MPI_Comm_size(MPI_COMM_WORLD,&(self->nprocs));
......@@ -6497,6 +6498,7 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
} else if (strcmp(self->reading_infos.proj_reading_type , "h5")==0){
if(self->params.DZPERPROJ==0) {
if( hfd5stack_done++ == 0) {
sem_wait( &(self->hdf5sequence_sem));
read_projSequence_from_h5( proj_file_list[ 0 ],
self->reading_infos.proj_h5_dsname,
Ninterval,
......@@ -6509,8 +6511,7 @@ void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches,
&(self->shared_h5id),
&(self->shared_h5DSid)
) ;
sem_post( &(self->hdf5sequence_sem));
}
} else {// ==================================
float *Bptr = NULL;
......
......@@ -1225,6 +1225,7 @@ struct CCspace_struct{
sem_t islicetracker_sem;
sem_t proupdate_sem;
sem_t filereading_sem;
sem_t hdf5sequence_sem;
Gpu_Context * gpu_context;
......
......@@ -77,8 +77,10 @@ if len(ff_indxs):
fname = "pyhst2_ff%05d.h5"%ff_pos
fname = os.path.join(rep, fname)
s_files+=""" "{}",""".format(fname=
create_virtual_file( vsource, ffblock, datasource_shape, mydtype, fname )
create_virtual_file( vsource, ffblock, datasource_shape, mydtype, fname ) )
pyhst2_input += """
FF_PREFIX={ffprefix}]
FF_DS_NAME = "data"
FF_INTERVALS={intervals}]
......
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