Source
284
284
Float maxconv=abs(screen(0,0));
285
285
for (Int chunkId=nchunk-1; chunkId >= 0; --chunkId){
286
286
//cerr << "chunkId " << chunkId << endl;
287
287
Cube<Complex> convFuncSect( maxConvSize/2-1, maxConvSize/2-1, chunksize(chunkId));
288
288
convFuncSect.set(0.0);
289
289
Bool convFuncStor=false;
290
290
Complex *convFuncPtr=convFuncSect.getStorage(convFuncStor);
291
291
//////openmp like to share reference param ...but i don't like to share
292
292
Int cpConvSize=maxConvSize;
293
293
//cerr << "orig convsize " << convSize << endl;
294
-
// cpWConvSize produces not used compiler warning because omp not used I guess
295
-
Int cpWConvSize=wConvSize;
294
+
// Int cpWConvSize=wConvSize;
296
295
Double cpWscale=wScale;
297
296
Int wstart=planesPerChunk*chunkId;
298
297
Int wend=wstart+chunksize(chunkId)-1;
299
298
#ifdef _OPENMP
300
299
omp_set_nested(0);
301
300
#endif
302
-
#pragma omp parallel for default(none) firstprivate(cpWConvSize, cpConvSize, convFuncPtr, s0, s1, wsaveptr, lsav, cor, inner, cpWscale, wstart, wend)
301
+
#pragma omp parallel for default(none) firstprivate(/*cpWConvSize,*/ cpConvSize, convFuncPtr, s0, s1, wsaveptr, lsav, cor, inner, cpWscale, wstart, wend)
303
302
for (Int iw=wstart; iw < (wend+1) ; ++iw) {
304
303
Matrix<Complex> screen1(cpConvSize, cpConvSize);
305
304
makeGWplane(screen1, iw, s0, s1, wsaveptr, lsav, inner, cor, cpWscale);
306
305
ooLong offset=ooLong(ooLong(iw-wstart)*ooLong(cpConvSize/2-1)*ooLong(cpConvSize/2-1));
307
306
for (ooLong y=0; y< ooLong(cpConvSize/2)-1; ++y){
308
307
for (ooLong x=0; x< ooLong(cpConvSize/2)-1; ++x){
309
308
////////convFuncPtr[offset+y*(convSize/2-1)+x] = quarter(x,y);
310
309
convFuncPtr[offset+y*ooLong(cpConvSize/2-1)+x] = screen1(x,y);
311
310
}
312
311
}
313
312
314
313
}//iw
315
314
convFuncSect.putStorage(convFuncPtr, convFuncStor);
316
315
for (uInt iw=0; iw< uInt(chunksize(chunkId)); ++iw){
317
316
convFuncSect.xyPlane(iw)=convFuncSect.xyPlane(iw)/(maxconv);
318
317
}
319
318
convFuncPtr=convFuncSect.getStorage(convFuncStor);
320
319
Int thischunkSize=chunksize(chunkId);
321
320
//cerr << "chunkId* planesPerChunk " << chunkId* planesPerChunk << " chunksize " << thischunkSize << endl;
322
-
#pragma omp parallel for default(none) firstprivate(suppstor, cpConvSize, cpWConvSize, convFuncPtr, maxConvSize, thischunkSize, wstart, planesPerChunk, chunkId) reduction(+: warner)
321
+
#pragma omp parallel for default(none) firstprivate(suppstor, cpConvSize, /*cpWConvSize,*/ convFuncPtr, maxConvSize, thischunkSize, wstart, planesPerChunk, chunkId) reduction(+: warner)
323
322
for (Int iw=0; iw<thischunkSize; iw++) {
324
323
Bool found=false;
325
324
Int trial=0;
326
325
ooLong ploffset=(ooLong)(cpConvSize/2-1)*(ooLong)(cpConvSize/2-1)*(ooLong)iw;
327
326
for (trial=cpConvSize/2-2;trial>0;trial--) {
328
327
// if((abs(convFunc(trial,0,iw))>1e-3)||(abs(convFunc(0,trial,iw))>1e-3) ) {
329
328
if((abs(convFuncPtr[(ooLong)(trial)+ploffset])>1e-3)||(abs(convFuncPtr[(ooLong)(trial*(cpConvSize/2-1))+ploffset])>1e-3) ) {
330
329
//cout <<"iw " << iw << " x " << abs(convFunc(trial,0,iw)) << " y "
331
330
// <<abs(convFunc(0,trial,iw)) << endl;
332
331
found=true;