Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CRAY-style vector functions in AltiVec?



Hello,

I have compiled a f77 gravitational N-body tree-code on my PBook G4 (OSX10.2.8, g77), and its performance is not great - similar to the same code running on a Sun ultra5. I have found plenty documentation about the G4 only being competitive for HPC when using AltiVec, which makes sense, and learned the basics of writing C wrapper functions to allow a call to altivec from fortran. This was tricky with g77 but managed to make it work using an example given in a useful posting by Craig Hunter (fortran lists, April 2002). BTW I noted a nasty feature, subroutine names with underscores within the name do not seem to be acceptable - the linker does not find the corresponding C functions.

My question is, does vecLib or AltiVec have all the functions the treecode calls? The code is Hernquist's (1990) fortran version of the Barnes-Hut (1996) treecode, which Hernquist vectorized for the CRAY by calling a number of CRAY vector functions. The functions and subroutines are listed below, in f77.

Does anyone know if those functions are available in AltiVec? I found an AltiVec Instruction Cross-Reference in Apple DC, and inspection suggests that it will require some work before knowing if AltiVec provides the answers I need. It would be much better if a library exists somewhere which directly implements the CRAY functions. Any ideas or suggestions welcome.

I suppose buying Absoft and VAST would go some way toward speeding up the code, but I would like first to explore what free compilers can do.

Many thanks,

Marc Balcells
Instituto de Astrofisica de Canarias


C***********************************************************************
FUNCTION ismax(n,x,inc)
C
C Function to locate index of maximum element of a real vector.
C=======================================================================
FUNCTION ismin(n,x,inc)
C
C Function to locate index of minimum element of a real vector.
C=======================================================================
C
FUNCTION isrchigt(n,iarray,inc,itarget)
C
C Function to return index of first element of iarray greater
C than itarget, or n+1 if none is found.
C=======================================================================
SUBROUTINE wheneq(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector equal to itarget.
C=======================================================================
SUBROUTINE whenfgt(n,array,inc,target,index,nval)
C
C Subroutine to return locations of all elements of a real
C vector greater than target.
C=======================================================================
SUBROUTINE whenflt(n,array,inc,target,index,nval)
C
C Subroutine to return locations of all elements of a real
C vector less than target.
C=======================================================================
SUBROUTINE whenige(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector greater than or equal to itarget.
C=======================================================================
SUBROUTINE whenigt(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector greater than itarget.
C=======================================================================
SUBROUTINE whenile(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector less than or equal to itarget.
C=======================================================================
SUBROUTINE whenilt(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector less than itarget.
C=======================================================================
SUBROUTINE whenne(n,iarray,inc,itarget,index,nval)
C
C Subroutine to return locations of all elements of an integer
C vector not equal to itarget.
C=======================================================================
_______________________________________________
fortran-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/fortran-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.