C*********************************************************************C C** Mixed-Radix Complex FFT Test Program **C C** for Massively Parallel Processor HITACHI SR2201 **C C** **C C** All rights reserved, Copyright (C) 1998, Daisuke TAKAHASHI **C C** **C C*********************************************************************C c/*- c * Copyright (c) 1998 Information Promotion Agency of Japan and D.Takahashi c * All rights reserved. c * c * Redistribution and non-commercial use in source and binary forms, c * with or without modification, are permitted provided that the following c * conditions are met: c * c * 1. Redistributions of source code must retain the above copyright c * notice, this list of conditions and the following disclaimer. c * c * 2. Redistributions in binary form must reproduce the above copyright c * notice, this list of conditions and the following disclaimer in the c * documentation and/or other materials provided with the distribution. c * c * 3. All advertising materials mentioning features or use of this c * software must display the following acknowledgement: c * c * This product includes software developed by Information Promotion c * Agency of Japan and D.Takahashi c * c * 4. The name "Information Promotion Agency" or "D.Takahashi" should not be c * used to endorse or promote products derived from this software c * without specific prior written permission. c * c * 5. Any use of the source code or the binary in a commercial product, c * whether may it be the origial representation or in some modified form, c * is not permitted without specific prior written permission. c * c * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND c * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE c * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE c * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE c * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL c * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS c * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) c * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT c * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY c * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF c * SUCH DAMAGE. c */ IMPLICIT REAL*8 (A-H,O-Z) INCLUDE 'mpif.h' PARAMETER (NDA=1048576) COMPLEX*16 A(NDA+1),B(NDA),WW(NDA+1),WWW(NDA) COMMON A,B,WW,WWW DIMENSION IP(3) C CALL MPI_INIT(IERR) CALL MPI_COMM_RANK(MPI_COMM_WORLD,ME,IERR) CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NPU,IERR) C IF (ME .EQ. 0) THEN READ(5,*) (IP(I),I=1,3) END IF CALL MPI_BCAST(IP,3,MPI_INTEGER,0,MPI_COMM_WORLD,IERR) N=(2**IP(1))*(3**IP(2))*(5**IP(3)) NN=N/NPU C CALL INIT(A,NN,ME,NPU) CALL FFT(A,B,WW,WWW,N,IP,ME,NPU,1,IERR) CALL FFT(A,B,WW,WWW,N,IP,ME,NPU,2,IERR) CALL INIT(A,NN,ME,NPU) C CALL MPI_BARRIER(MPI_COMM_WORLD,IERR) IF (ME .EQ. 0) THEN TIME1=MPI_WTIME() END IF C CALL FFT(A,B,WW,WWW,N,IP,ME,NPU,1,IERR) CALL FFT(A,B,WW,WWW,N,IP,ME,NPU,2,IERR) C IF (ME .EQ. 0) THEN TIME2=MPI_WTIME() TIME0=TIME2-TIME1 WRITE(6,*) ' TIME=',TIME0 END IF C IF (ME .EQ. 0) WRITE(6,*) A(1) CALL MPI_BARRIER(MPI_COMM_WORLD,IERR) IF (ME .EQ. NPU-1) WRITE(6,*) A(NN) C CALL MPI_FINALIZE(IERR) STOP END SUBROUTINE INIT(A,NN,ME,NPU) IMPLICIT REAL*8 (A-H,O-Z) COMPLEX*16 A(*) C N=NN*NPU DO 10 I=1,NN A(I)=DCMPLX(DBLE(I-1)*DBLE(NPU)+DBLE(ME)+1.0D0, 1 N-(DBLE(I-1)*DBLE(NPU)+DBLE(ME)+1.0D0)+1.0D0) 10 CONTINUE RETURN END