allow the user to tweak chunk sizes

This commit is contained in:
Martin Reinecke 2012-11-05 15:23:54 +01:00
parent 549d1c35e1
commit 5ab4577cf1
2 changed files with 10 additions and 1 deletions

View file

@ -43,9 +43,10 @@
typedef complex double dcmplx;
typedef complex float fcmplx;
static int chunksize_min=500, nchunks_max=10;
static void get_chunk_info (int ndata, int nmult, int *nchunks, int *chunksize)
{
static const int chunksize_min=500, nchunks_max=10;
*chunksize = IMAX(chunksize_min,(ndata+nchunks_max-1)/nchunks_max);
*chunksize = ((*chunksize+nmult-1)/nmult)*nmult;
*nchunks = (ndata+*chunksize-1) / *chunksize;
@ -625,6 +626,11 @@ void sharp_execute (sharp_jobtype type, int spin, int add_output, void *alm,
if (opcnt!=NULL) *opcnt = job.opcnt;
}
void sharp_set_chunksize_min(int new_chunksize_min)
{ chunksize_min=new_chunksize_min; }
void sharp_set_nchunks_max(int new_nchunks_max)
{ nchunks_max=new_nchunks_max; }
int sharp_get_nv_max (void)
{ return 6; }

View file

@ -179,6 +179,9 @@ void sharp_execute (sharp_jobtype type, int spin, int add_output, void *alm,
void *map, const sharp_geom_info *geom_info, const sharp_alm_info *alm_info,
int ntrans, int dp, int nv, double *time, unsigned long long *opcnt);
void sharp_set_chunksize_min(int new_chunksize_min);
void sharp_set_nchunks_max(int new_nchunks_max);
/*! \} */
#ifdef __cplusplus