[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference nicctr::dxml

Title:Digital Extended Math Library
Notice:Kit locations: 9.last (UNIX), 10.last (VMS)
Moderator:RTL::CHAOFGREN
Created:Mon Apr 30 1990
Last Modified:Tue Jun 03 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:324
Total number of notes:1402

315.0. "Problem to use cfft_grp" by ZPOVC::COLINTONG () Tue Mar 18 1997 09:40

    Hi there,
    
    I have problem to use the cfft_grp routine in a C program.
    
    The environment:
    		AS4100 5/400 with 4 CPUs and 2GB memory
    		DUX 4.0B, DXML 3.3a ( program link with dxmlp )
    		rowfft_no= 2048, size= 65536
    
    The array of data have no problem in the following do loop:
    
    	for ( i=0; i < rowfft_no; i++ )
    		status=cfft("c","c","f",fft[i],fft[i],&size,&stride)
    
    But the same array get error in the following call:
    
    	status= cfft_grp("c","c","f",fft,
                                     fft,
                                     &size,&grp_size,
                                     &lda,&stride,&grp_stride);
    The error is:
    
    # DECthreads Last Chance handler: thread 1 exiting on status exception
    0x177db01
    Exception: Arithmetic error (dce / thd)
    ./Run[15]: 6506 Resources lost
    
    I already set vpagemax and maxdsize and maxssize to very big number. I
    don't know if I miss anything related to threads here.
    
    This is a benchmark and I just want to use the group fft to improve the
    performance.
    
    Any comment are welcome
    
    Colin Tong, Singapore Sales Support
T.RTitleUserPersonal
Name
DateLines
315.1HPCGRP::MANLEYTue Mar 18 1997 14:3848
	What value are you using for stride?

	Regardless, this:

    	for ( i=0; i < rowfft_no; i++ )
    		status=cfft("c","c","f",fft[i],fft[i],&size,&stride)

	is not the same as this:

	status= cfft_grp("c","c","f",fft,
                                     fft,
                                     &size,&grp_size,
                                     &lda,&stride,&grp_stride);

	With CFFT you're taking the forward fft of a complex vector data of
	length 65536. Your loop performs "overlapping" ffts, is probably not
	what's intended, and accesses only 65536 + 2047 complex data points.

	On the other hand, CFFT_GRP accesses a 2-D array that probably contains
	2048*65536 complex data points.

	Your choice of routine depends on the way the data is stored. If
	the data is logically a complex matrix that looks something like:

		COMPLEX fft[rowfft_no][size]; /* C storage format */

	then you should use the loop logically re-written as:

                stride = 1;
		status = cfft_init( &size,&fft_struct,&TRUE );
		for( i=0;i<(size*rowfft_no);i+=size )
		  status = cfft_apply( "c","c","f",fft[i],fft[i],
                                        &fft_struct,&stride);

	If, however, the data is logically a complex matrix that looks
	something like:

                COMPLEX fft[size][rowfft_no]; /* Fortran storage format */

	then you should call the group fft using something like:

	lda = rowfft_no;
        stride = 1;
        grp_stride = 1;
	status = cfft_grp( "c","c","f",fft,fft,&size,&rowfft_no,&lda,
                           &stride,&grp_stride );