Commit 46b60426 authored by alex's avatar alex Committed by mirone

adapted to debian 9, 10 , written CDI, fixed tryconstheader if multiframe!=0

adapted to debian9

small correction for setup

comincia a compilare debian10. Da levare warning

compila senza warning

scritto test

aggiunto run_test

ok

scritto test crayon

corretto

corretto

corretto

corretto

corretto

corretto

corretto

corretto

corretto

scritto test e controllo del test

rimpicciolito test

correzione

corr

test

corr

corr

corr

corr

corr

corr

corr

corr

corr

corr

corr

pronto per OAR

corr

corr

corr

corr

corr

corr

corr

corr

corr

corr

OK

OK

corr

OK

nuovi tests

OK

OK

OK

OK

OK

OK

finendo tutti i tests

lancio tests

OK

OK

ok

ok

ok

achille

achille

achille

achille

OK
parent 19ce86d5
test:
stage: test
only:
- testnslino
tags:
- nslino
script:
- echo 'current dir is '
- pwd
- export http_proxy=http://proxy.esrf.fr:3128/
- export https_proxy=http://proxy.esrf.fr:3128/
- export no_proxy='localhost,127.0.0.1,localaddress,.esrf.fr,.esrf.eu '
- unset PYTHONPATH
- export PATH=/usr/local/bin:/usr/bin:/bin:/opt/oar/utilities:/sbin:/usr/bin/X11:.::.
- unset LDFLAGS
- unset CPPFLAGS
- unset LD_LIBRARY_PATH
- rm -rf /tmp/chst_test/
- python setup.py install --prefix=/tmp/chst_test
- export PYTHONPATH=/tmp/chst_test/lib/python2.7/site-packages
- export PATH=/tmp/chst_test/bin:$PATH
- python run_tests.py -v --testcase nslino
- python run_tests.py -v --testcase nslinogpu
after_script:
- pwd
test:
stage: test
only:
- testachille
tags:
- achille
script:
- echo 'current dir is '
- pwd
- export http_proxy=http://proxy.esrf.fr:3128/
- export https_proxy=http://proxy.esrf.fr:3128/
- export no_proxy='localhost,127.0.0.1,localaddress,.esrf.fr,.esrf.eu '
- unset PYTHONPATH
- export PATH=/usr/local/bin:/usr/bin:/bin:/opt/oar/utilities:/sbin:/usr/bin/X11:.::.
- unset LDFLAGS
- unset CPPFLAGS
- unset LD_LIBRARY_PATH
- rm -rf /tmp/chst_test/
- python setup.py install --prefix=/tmp/chst_test
- export PYTHONPATH=/tmp/chst_test/lib/python2.7/site-packages
- export PATH=/tmp/chst_test/bin:$PATH
- python run_tests.py -v --testcase achille
- python run_tests.py -v --testcase achillegpu
after_script:
- pwd
testOAR:
stage: test
only:
- testoar
tags:
- scisoft12
script:
- chmod u+x ./test_script_for_oar.sh
- myoid=`oarsub -l"cpu=1/core=28,walltime=24:00:0" -p" gpu = 'NO' " ./test_script_for_oar.sh`
- echo $myoid
- myoid=`python extract_oarid.py "$myoid"`
- echo $myoid
- oarsub -a $myoid -I ; pwd
- code=`oarstat -f -j $myoid | grep exit`
- echo $code
- python check_oar_status.py "$code"
after_script:
- pwd
testOARgpu:
stage: test
only:
- testoargpu
tags:
- scisoft12
script:
- chmod u+x ./test_script_for_oar_gpu.sh
- myoid=`oarsub -l"cpu=1,walltime=24:00:0" -p" gpu = 'YES' " ./test_script_for_oar_gpu.sh`
- echo $myoid
- myoid=`python extract_oarid.py "$myoid"`
- echo $myoid
- oarsub -a $myoid -I ; pwd
- code=`oarstat -f -j $myoid | grep exit`
- echo $code
- python check_oar_status.py "$code"
after_script:
- pwd
testOAR2gpu:
stage: test
only:
- testoar2gpu
tags:
- scisoft12
script:
- chmod u+x ./test_script_for_oar_gpu.sh
- myoid=`oarsub -l"nodes=1,walltime=12:00:0" -p" gpu = 'YES' " ./test_script_for_oar_gpu.sh`
- echo $myoid
- myoid=`python extract_oarid.py "$myoid"`
- echo $myoid
- oarsub -a $myoid -I ; pwd
- code=`oarstat -f -j $myoid | grep exit`
- echo $code
- python check_oar_status.py "$code"
after_script:
- pwd
This diff is collapsed.
......@@ -38,6 +38,17 @@
#include<complex.h>
#include<cufft.h>
typedef float __complex__ fcomplex ;
// typedef fftwf_complex fcomplex ;
// fftw_complexf
#define MAXNTOKENS 100
#define max(a,b) ( (a)>(b)? (a):(b) )
......@@ -147,6 +158,7 @@ typedef struct {
} PRECOND_PARAMS_DL;
typedef struct lt_infos {
int Ng; // numero di gaussiane = max(j)+1
int Ng2s ; // numero di gaussiane che vanno sull'immagine centrale = max(J2s)+1
......@@ -179,7 +191,7 @@ typedef struct lt_infos {
int lt_reb;
float *fftwR ;
float complex * fftwC ;
fcomplex *fftwC ;
double force_per_gaussian;
int lt_max_step;
int lt_max_step_reb;
......@@ -904,8 +916,8 @@ struct Gpu_Context_struct {
int num_bins ;
// set by init
float complex *dev_iWork;
float complex *dev_iWork_copy;
fcomplex *dev_iWork;
fcomplex *dev_iWork_copy;
float *dev_Filter;
int planR2C,planC2R;
void * a_Proje_voidptr;
......@@ -1216,14 +1228,14 @@ struct CCspace_struct{
#ifndef FROMCU
void nnfbp_train(CCspace *self,int dim_fft,int num_bins, float *data_orig, int dimslice,float *SLICEcalc,
float * SINOGRAMMA, float **WORK, float *WORKbis, float *dumf, float complex *dumfC, float *WORK_perproje,
float * SINOGRAMMA, float **WORK, float *WORKbis, float *dumf, fcomplex *dumfC, float *WORK_perproje,
float *OVERSAMPLE, int oversampling, int ncpus,float cpu_offset_x,float cpu_offset_y, int Nfirstslice, int islice,
char *nomeout) ;
void nnfbp_reconstruct(CCspace *self,int dim_fft,int num_bins, float *data_orig, int dimslice,float *SLICEcalc,float *SLICE,
float * SINOGRAMMA, float **WORK, float *WORKbis, float *dumf, float complex *dumfC, float *WORK_perproje, float *OVERSAMPLE,
float * SINOGRAMMA, float **WORK, float *WORKbis, float *dumf, fcomplex *dumfC, float *WORK_perproje, float *OVERSAMPLE,
int oversampling, int ncpus,float cpu_offset_x,float cpu_offset_y);
......@@ -1234,7 +1246,7 @@ void CCspace_getSaturations(CCspace * self, double aMin,double aMax,
void CCspace_initialise (CCspace * self ) ;
void CCspace_addRawDataSpace(CCspace * self , float *token );
void CCspace_add2DataSpace(CCspace * self , float *token,char *key ) ;
void CCspace_add2DataSpace(CCspace * self , float *token,const char *key ) ;
void CCspace_read_chunk (CCspace * self , int sn, int ntok , int npbunches, int rotation_vertical, int binning,
int reduced_case, int red_start, int red_end, int red_scope);
void CCspace_tranpose_chunk (CCspace * self , int sn, int ntoktreated, int ntoktransposed , int npbunches, int STEAM_DIRECTION);
......@@ -1333,7 +1345,7 @@ void conic_driver( CCspace * self, float * data, float *SLICE, int nslices
int Nfirstslice,
int data_start,
float *dumf,
float complex *dumfC,
fcomplex *dumfC,
float *WORK_perproje,
float **WORK,
float *WORKbis,
......@@ -1361,13 +1373,13 @@ float FindNoise(CCspace * self,float *SLICE_a, int CALM_ZONE_LEN, int size_pa0,
void nlm_driver(CCspace *self,int dim0,int dim1,float *img,float *result , float bruit) ;
float rec_driver(CCspace *self, float **WORK,float *WORKbis,float *SLICEcalc, int num_bins, int dim_fft,
float * dumf, float complex *dumfC , float *WORK_perproje,float *OVERSAMPLE,int oversampling,
float * dumf, fcomplex *dumfC , float *WORK_perproje,float *OVERSAMPLE,int oversampling,
float * data, int ncpus,float cpu_offset_x,float cpu_offset_y, int preco, int is_tomolocal,
float *fidelity, int npj_offset);
// Typedef for plugins
typedef float (*rec_driver_func)(CCspace*, float **,float *,float *, int, int,
float * , float complex * , float *,float *,int ,
float * , fcomplex * , float *,float *,int ,
float * , int ,float ,float , int , int ,
float *) ;
......@@ -1388,13 +1400,13 @@ void correct_slice(CCspace *self,float *SLICE,float *SLICEcalc);
void prepare_correction(CCspace *self, float * data, float * data_origin, float *SINOGRAMMA,int num_bins ) ;
void passeggiaSINO(CCspace *self, float **WORK, float **WORKbis, int num_bins, int dim_fft,
float **dumf, float complex **dumfC , float * WORK_perproje, float **OVERSAMPLE,
float **dumf, fcomplex **dumfC , float * WORK_perproje, float **OVERSAMPLE,
int oversampling, int ncpus , float cpu_offset_x, float cpu_offset_y,
float *angles_per_proj, int dimslice,
float *SLICE, float *data, float * SINOGRAMMA, int solution, int nsteps);
void passeggiaSLICE(CCspace *self, float **WORK, float **WORKbis, int num_bins, int dim_fft,
float **dumf, float complex **dumfC , float * WORK_perproje, float **OVERSAMPLE,
float **dumf, fcomplex **dumfC , float * WORK_perproje, float **OVERSAMPLE,
int oversampling, int ncpus , float cpu_offset_x, float cpu_offset_y,
float *angles_per_proj, int dimslice,
float *SLICE, float *data, float * SINOGRAMMA, int nsteps);
......
This diff is collapsed.
......@@ -34,15 +34,15 @@
#include <stdlib.h>
#define PY_ARRAY_UNIQUE_SYMBOL chst_ARRAY_API
#define NO_IMPORT_ARRAY
//#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "numpy/arrayobject.h"
#include"structmember.h"
#include"cpyutils.h"
PyObject * cpyutils_get_pydic_Oval(PyObject *Odict, char *key ) {
PyObject * cpyutils_get_pydic_Oval(PyObject *Odict, const char *key ) {
PyObject *dic_key, *Oval;
if( !PyDict_Check(Odict)) {
......@@ -61,7 +61,7 @@ PyObject * cpyutils_get_pydic_Oval(PyObject *Odict, char *key ) {
}
}
int cpyutils_o2i_TB(PyObject *obj , char * callFILE, int callLINE ) {
int cpyutils_o2i_TB(PyObject *obj , const char * callFILE, int callLINE ) {
int res;
if(!PyInt_Check(obj)) {
fprintf(stderr, "failed conversion to int in %s line %d called from %s line %d \n", __FILE__, __LINE__, callFILE, callLINE );
......@@ -82,7 +82,7 @@ int cpyutils_o2i(PyObject *obj ) {
}
float cpyutils_o2f_TB(PyObject *obj, char * callFILE, int callLINE ) {
float cpyutils_o2f_TB(PyObject *obj, const char * callFILE, int callLINE ) {
float res;
if(!PyFloat_Check(obj) && !PyInt_Check(obj) ) {
fprintf(stderr, "failed conversion to float in %s line %d called from %s line %d \n", __FILE__, __LINE__, callFILE, callLINE);
......@@ -94,7 +94,7 @@ float cpyutils_o2f_TB(PyObject *obj, char * callFILE, int callLINE ) {
PyObject *cpyutils_getattribute(PyObject * obj ,char * string ) {
PyObject *cpyutils_getattribute(PyObject * obj ,const char * string ) {
PyObject *res;
res = PyObject_GetAttrString(obj, string);
if(!res) {
......@@ -137,21 +137,26 @@ char* cpyutils_getstring(PyObject *Otmp) {
#define ASSERT(A) if(!(A) ) { printf(" in subroutine called from file:%s line:%d\n", callFILE, callLINE); assert((A)); }
void *cpyutils_PyArray1D_as_array_TB(PyObject *OtmpA, int *listlenght,int pyarraytype, char * callFILE, int callLINE ) {
void *cpyutils_PyArray1D_as_array_TB(PyObject *OtmpA, int *listlenght,int pyarraytype, const char * callFILE, int callLINE ) {
PyObject *Otmp;
void *res ;
ASSERT(PyArray_Check(OtmpA ));
ASSERT( ((PyArrayObject *)OtmpA) ->descr->type_num == pyarraytype );
ASSERT( ((PyArrayObject*) OtmpA)->nd==1 );
// ASSERT( ((PyArrayObject *)OtmpA) ->descr->type_num == pyarraytype );
ASSERT( PyArray_DESCR(((PyArrayObject *)OtmpA) ) ->type_num == pyarraytype );
ASSERT( PyArray_NDIM ((PyArrayObject*) OtmpA) ==1 );
Otmp = PyArray_ContiguousFromObject(OtmpA, PyArray_NOTYPE, 1, 1);
// tmp = PyArray_ContiguousFromObject(OtmpA, PyArray_NOTYPE, 1, 1);
Otmp = PyArray_ContiguousFromAny(OtmpA, pyarraytype , 1, 1);
*listlenght = ((PyArrayObject *) Otmp)->dimensions[0];
*listlenght = PyArray_DIMS(((PyArrayObject *) Otmp) )[0];
res = (void *) malloc( (*listlenght) *PyArray_ITEMSIZE((PyArrayObject *) Otmp) ) ;
memcpy( res, ((PyArrayObject*) Otmp)->data, (*listlenght)*PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
memcpy( res, PyArray_DATA((PyArrayObject*) Otmp) , (*listlenght)*PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
Py_DECREF(Otmp);
return res;
......@@ -160,19 +165,19 @@ void *cpyutils_PyArray2D_as_array(PyObject *OtmpA, int *dim2, int *dim1,int py
PyObject *Otmp;
void *res ;
assert(PyArray_Check(OtmpA ));
assert( ((PyArrayObject *)OtmpA) ->descr->type_num == pyarraytype );
assert( ((PyArrayObject*) OtmpA)->nd==2 );
Otmp = PyArray_ContiguousFromObject(OtmpA, PyArray_NOTYPE, 2, 2);
assert( PyArray_DESCR((PyArrayObject *)OtmpA)->type_num == pyarraytype );
assert( PyArray_NDIM((PyArrayObject*) OtmpA) ==2 );
Otmp = PyArray_ContiguousFromObject(OtmpA, pyarraytype , 2, 2);
*dim2 = ((PyArrayObject *) Otmp)->dimensions[0];
*dim1 = ((PyArrayObject *) Otmp)->dimensions[1];
*dim2 = PyArray_DIMS((PyArrayObject *) Otmp)[0];
*dim1 = PyArray_DIMS((PyArrayObject *) Otmp)[1];
/* #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m)) */
/* #define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m)) */
res = (void *) malloc( (*dim2)*(*dim1) *PyArray_ITEMSIZE((PyArrayObject *) Otmp) ) ;
memcpy( res , ((PyArrayObject*) Otmp)->data, (*dim2)*(*dim1)*PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
memcpy( res , PyArray_DATA((PyArrayObject*) Otmp), (*dim2)*(*dim1)*PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
Py_DECREF(Otmp);
return res;
......@@ -184,22 +189,22 @@ void *cpyutils_PyArray5D_as_array(PyObject *OtmpA,int *dim5,
PyObject *Otmp;
void *res ;
assert(PyArray_Check(OtmpA ));
assert( ((PyArrayObject *)OtmpA) ->descr->type_num == pyarraytype );
assert( ((PyArrayObject*) OtmpA)->nd==5 );
Otmp = PyArray_ContiguousFromObject(OtmpA, PyArray_NOTYPE, 5, 5);
assert( PyArray_DESCR((PyArrayObject *)OtmpA) ->type_num == pyarraytype );
assert( PyArray_NDIM((PyArrayObject*) OtmpA) ==5 );
Otmp = PyArray_ContiguousFromObject(OtmpA, pyarraytype, 5, 5);
*dim5 = ((PyArrayObject *) Otmp)->dimensions[0];
*dim4 = ((PyArrayObject *) Otmp)->dimensions[1];
*dim3 = ((PyArrayObject *) Otmp)->dimensions[2];
*dim2 = ((PyArrayObject *) Otmp)->dimensions[3];
*dim1 = ((PyArrayObject *) Otmp)->dimensions[4];
*dim5 = PyArray_DIMS((PyArrayObject *) Otmp)[0];
*dim4 = PyArray_DIMS((PyArrayObject *) Otmp)[1];
*dim3 = PyArray_DIMS((PyArrayObject *) Otmp)[2];
*dim2 = PyArray_DIMS((PyArrayObject *) Otmp)[3];
*dim1 = PyArray_DIMS((PyArrayObject *) Otmp)[4];
/* #define PyArray_SIZE(m) PyArray_MultiplyList(PyArray_DIMS(m), PyArray_NDIM(m)) */
/* #define PyArray_NBYTES(m) (PyArray_ITEMSIZE(m) * PyArray_SIZE(m)) */
res = (void *) malloc( (*dim5)*(*dim4)*(*dim3) *(*dim2)*(*dim1) *PyArray_ITEMSIZE((PyArrayObject *) Otmp) ) ;
memcpy( res , ((PyArrayObject*) Otmp)->data, (*dim5)*(*dim4)*(*dim3) *(*dim2)*(*dim1) * PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
memcpy( res , PyArray_DATA((PyArrayObject*) Otmp), (*dim5)*(*dim4)*(*dim3) *(*dim2)*(*dim1) * PyArray_ITEMSIZE((PyArrayObject *) Otmp) );
Py_DECREF(Otmp);
return res;
......
......@@ -29,15 +29,15 @@
# Please contact the ESRF industrial unit (industry@esrf.fr) if this license
# is a problem for you.
#############################################################################*/
PyObject * cpyutils_get_pydic_Oval(PyObject *Odict, char *key ) ;
PyObject * cpyutils_get_pydic_Oval(PyObject *Odict, const char *key ) ;
// int cpyutils_o2i(PyObject *obj );
int cpyutils_o2i_TB(PyObject *obj , char * callFILE, int callLINE );
float cpyutils_o2f_TB(PyObject *obj , char * callFILE, int callLINE );
int cpyutils_o2i_TB(PyObject *obj , const char * callFILE, int callLINE );
float cpyutils_o2f_TB(PyObject *obj , const char * callFILE, int callLINE );
// float cpyutils_o2f(PyObject *obj );
PyObject *cpyutils_getattribute(PyObject * obj ,char * string ) ;
PyObject *cpyutils_getattribute(PyObject * obj , const char * string ) ;
char** cpyutils_getstringlist_from_list(PyObject *Otmp,int *listlenght) ;
void *cpyutils_PyArray1D_as_array(PyObject *Otmp, int *dim , int pyarraytype );
void *cpyutils_PyArray1D_as_array_TB(PyObject *OtmpA, int *listlenght,int pyarraytype, char * callFILE, int callLINE );
void *cpyutils_PyArray1D_as_array_TB(PyObject *OtmpA, int *listlenght,int pyarraytype, const char * callFILE, int callLINE );
void *cpyutils_PyArray2D_as_array(PyObject *Otmp, int *dim2, int *dim1,int pyarraytype );
......
......@@ -47,7 +47,6 @@ void tiffRead(char * nomefile, float * data, int n1, int s1, int n2, int s2) {
throw ((char * ) "n2+s2< img.height() ") ;
}
char *ptr ;
int w = img.width();
int h = img.height();
......
......@@ -29,7 +29,11 @@
# Please contact the ESRF industrial unit (industry@esrf.fr) if this license
# is a problem for you.
#############################################################################*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
......@@ -43,7 +47,8 @@
#define H5Dopen_vers 1
#include <hdf5.h>
///// temporary discativation
// #include <hdf5.h>
#undef NDEBUG
#include<assert.h>
......@@ -389,82 +394,85 @@ void read_data_from_h5( char * filename,
int binning
) {
hid_t file; /* handles */
hid_t dataset;
hid_t memspace;
hid_t dataspace;
fprintf(stderr, " TEMPORARY DISACTIVATION OF HDF5 in pyhst, do not use hdf5 for the moment ( due to different version on the cluster ) \n");
hsize_t dimsm[3]; /* dataset and chunk dimensions*/
hsize_t count[3];
hsize_t offset[3];
hsize_t count_out[3];
hsize_t offset_out[3];
/* hid_t file; /\* handles *\/ */
/* hid_t dataset; */
/* hid_t memspace; */
herr_t status;
int rank ;
/* hid_t dataspace; */
file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
dataset = H5Dopen(file, dsname);
/* hsize_t dimsm[3]; /\* dataset and chunk dimensions*\/ */
/* hsize_t count[3]; */
/* hsize_t offset[3]; */
/* hsize_t count_out[3]; */
/* hsize_t offset_out[3]; */
dataspace = H5Dget_space(dataset);
rank = H5Sget_simple_extent_ndims(dataspace);
assert(rank==3);
/* herr_t status; */
/* int rank ; */
/*
* descrive quale parte del dataset leggo
*/
/* file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT); */
/* dataset = H5Dopen(file, dsname); */
/* dataspace = H5Dget_space(dataset); */
/* rank = H5Sget_simple_extent_ndims(dataspace); */
/* assert(rank==3); */
offset[0] = nproj;
offset[1] = pos0;
offset[2] = pos1;
count[0] = 1;
count[1] = size0;
count[2] = size1;
/* /\* */
/* * descrive quale parte del dataset leggo */
/* *\/ */
/* offset[0] = nproj; */
/* offset[1] = pos0; */
/* offset[2] = pos1; */
/* count[0] = 1; */
/* count[1] = size0; */
/* count[2] = size1; */
status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL,
count, NULL);
/* status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, */
/* count, NULL); */
/*
* descrive la memoria su cui scrivo
*/
dimsm[0] = 1;
dimsm[1] = size0;
dimsm[2] = size1 ;
memspace = H5Screate_simple( 3, dimsm, NULL);
/*
* descrive quale parte di memoria scrivo
*/
offset_out[0] = 0;
offset_out[1] = 0;
offset_out[2] = 0;
count_out[0] = 1;
count_out[1] = size0;
count_out[2] = size1;
status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL,
count_out, NULL);
/*
* Read data from hyperslab in the file into the hyperslab in
* memory and display.
*/
/* /\* */
/* * descrive la memoria su cui scrivo */
/* *\/ */
/* dimsm[0] = 1; */
/* dimsm[1] = size0; */
/* dimsm[2] = size1 ; */
/* memspace = H5Screate_simple( 3, dimsm, NULL); */
/* /\* */
/* * descrive quale parte di memoria scrivo */
/* *\/ */
/* offset_out[0] = 0; */
/* offset_out[1] = 0; */
/* offset_out[2] = 0; */
/* count_out[0] = 1; */
/* count_out[1] = size0; */
/* count_out[2] = size1; */
/* status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, */
/* count_out, NULL); */
/* /\* */
/* * Read data from hyperslab in the file into the hyperslab in */
/* * memory and display. */
/* *\/ */
status = H5Dread(dataset, H5T_NATIVE_FLOAT, memspace, dataspace,
H5P_DEFAULT, target);
/* status = H5Dread(dataset, H5T_NATIVE_FLOAT, memspace, dataspace, */
/* H5P_DEFAULT, target); */
status=status;
/* status=status; */
H5Dclose(dataset);
H5Sclose(dataspace);
H5Sclose(memspace);
H5Fclose(file);
/* H5Dclose(dataset); */
/* H5Sclose(dataspace); */
/* H5Sclose(memspace); */
/* H5Fclose(file); */
}
......@@ -920,7 +928,7 @@ void read_data_from_edf_eli( char * filename,
void write_data_to_edf( float *SLICE, int num_y,int num_x, char * nomeout ) {
void write_data_to_edf( float *SLICE, int num_y,int num_x, const char * nomeout ) {
FILE *output = fopen(nomeout,"w") ;
if(!output) {
printf(" error opening output file for slice now stopping\n");
......@@ -950,7 +958,7 @@ void write_data_to_edf( float *SLICE, int num_y,int num_x, char * nomeout ) {
}
void write_data_to_edf_restrained( float *SLICE, int num_y,int num_x,
int start_y, int real_num_y,
char * nomeout ) {
const char * nomeout ) {
FILE *output = fopen(nomeout,"w") ;
if(!output) {
printf(" error opening output file for slice now stopping\n");
......@@ -990,7 +998,7 @@ void write_add_data_to_edf( float *SLICE, int num_y,int num_x, char * nomeout,
}
// printf( " per il file %s scrivo %d slices a partire da %d \n", nomeout, nlines, firstline);
float * dum = malloc(nlines*num_x*sizeof(float));
float * dum = (float *) malloc(nlines*num_x*sizeof(float));
lseek( fd ,1024+ firstline*num_x*sizeof(float), SEEK_SET);
ssize_t res_read = read( fd, dum, nlines*num_x*sizeof(float) );
if(0) assert( res_read == (nlines*num_x*sizeof(float)) ) ;
......
......@@ -53,7 +53,7 @@ void prereadEdfHeader_restrained( int *start_2 ,
) ;
void write_data_to_edf_restrained( float *SLICE, int num_y,int num_x,
int start_y, int real_num_y,
char * nomeout );
const char * nomeout );
void extended_fread( char *ptr, /* memory to write in */
int size_of_block,
int ndims ,
......@@ -112,7 +112,7 @@ void read_data_from_edf_eli( char * filename,
);
void write_data_to_edf( float *SLICE, int num_y,int num_x, char * nomeout ) ;
void write_data_to_edf( float *SLICE, int num_y,int num_x, const char * nomeout ) ;
......
......@@ -43,7 +43,14 @@ using namespace std;
#include <cublas.h>
#include <cuComplex.h>
#include<time.h>
#ifndef HUGE
#include<values.h>
#define HUGE MAXFLOAT
#endif
#define FROMCU
extern "C" {
#include<CCspace.h>
}
......
......@@ -18,23 +18,23 @@
#define myfread( a,b,c ,d ) {int res=fread(a,b,c,d); if(res<-1) printf(" gcc casse les pieds\n");}
void nnfbp_setup_fft(CCspace *self, float complex **fftSino, float complex **fftMult,float complex **fftSinoOrig, int dim_fft,int num_bins, float *data_orig, fftwf_plan *sinoB) {
void nnfbp_setup_fft(CCspace *self, fcomplex **fftSino, fcomplex **fftMult,fcomplex **fftSinoOrig, int dim_fft,int num_bins, float *data_orig, fftwf_plan *sinoB) {
int fftSize[] = {dim_fft};
int i,j;