1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>HPF Interface to ScaLAPACK</TITLE>
<META NAME="description" CONTENT="HPF Interface to ScaLAPACK">
<META NAME="keywords" CONTENT="slug">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="slug.css">
</HEAD>
<BODY LANG="EN" >
<A NAME="tex2html4463" HREF="node182.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html4461" HREF="node179.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html4457" HREF="node180.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html4465" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="http://www.netlib.org/utk/icons/contents_motif.gif"></A> <A NAME="tex2html4466" HREF="node190.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="http://www.netlib.org/utk/icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html4464" HREF="node182.html">Quick Reference Guides</A>
<B>Up:</B> <A NAME="tex2html4462" HREF="node179.html">Example Programs</A>
<B> Previous:</B> <A NAME="tex2html4458" HREF="node180.html">Example Program #2</A>
<BR> <P>
<H1><A NAME="SECTION041020000000000000000">HPF Interface to ScaLAPACK</A></H1>
<A NAME="hpfexample"> </A><A NAME="6833"> </A><A NAME="6834"> </A>
<A NAME="6835"> </A>
<A NAME="6836"> </A><A NAME="6837"> </A>
<P>
We are investigating issues related to interfacing ScaLAPACK with
High Performance Fortran (HPF) [<A HREF="node189.html#hpf">91</A>]. As a part of this effort, we
have provided
prototype interfaces to some of the ScaLAPACK routines. We are collecting
user feedback on these codes, as well as allowing additional time for compiler
maturation, before providing a more complete interface.
<P>
Initially, interfaces are provided for the following ScaLAPACK
routines: the general and symmetric positive definite linear equation
solvers (PxGESV and PxPOSV), the linear least squares solver (PxGELS),
and the PBLAS matrix multiply routine (PxGEMM).
<A NAME="6839"> </A><A NAME="6840"> </A>
<A NAME="6841"> </A><A NAME="6842"> </A>
<A NAME="6843"> </A><A NAME="6844"> </A>
<A NAME="6845"> </A><A NAME="6846"> </A>
<P>
<PRE> LA_GESV(A, B, IPIV, INFO)
TYPE, intent(inout), dimension(:,:) :: A, B
integer, optional, intent(out) :: IPIV(:), INFO
LA_POSV(A, B, UPLO, INFO)
TYPE, intent(inout), dimension(:,:) :: A, B
character(LEN=1), optional, intent(in) :: UPLO
integer, optional, intent(out) :: INFO
LA_GELS(A, B, TRANS, INFO)
TYPE, intent(inout), dimension(:,:) :: A, B
character(LEN=1), optional, intent(in) :: TRANS
integer, optional, intent(out) :: INFO
LA_GEMM(A, B, C, transA, transB, alpha, beta)
TYPE, intent(in), dimension(:,:) :: A, B
TYPE, intent(inout), dimension(:,:) :: C
character(LEN=1), optional, intent(in) :: transA, transB
TYPE, optional, intent(in) :: alpha, beta</PRE>
<P>
With this interface, all matrices are inherited, and query functions are used
to determine the distribution of the matrices. Only when ScaLAPACK cannot
handle the user's distribution are the matrices redistributed. In such a
case, it is done transparently to the user, and only performance will show
that it has occurred.
<P>
The prototype interfaces can be downloaded from <EM>netlib</EM> at the following
URL:
<BLOCKQUOTE> <TT>http://www.netlib.org/scalapack/prototypes/slhpf.tar.gz</TT>
</BLOCKQUOTE>
<P>
Questions or comments on these routines may be mailed to
<TT>scalapack@cs.utk.edu</TT>.
<P>
The following example code is a complete HPF code calling and testing the
ScaLAPACK LU factorization/solve in HPF.
<P>
<B>This program is also available in the scalapack directory on netlib <BR>
(http://www.netlib.org/scalapack/examples/sample_hpf_gesv.f).</B>
<P>
<PRE> program simplegesv
use HPF_LAPACK
integer, parameter :: N=500, NRHS=20, NB=64, NBRHS=64, P=1, Q=3
integer, parameter :: DP=kind(0.0D0)
integer :: IPIV(N)
real(DP) :: A(N, N), X(N, NRHS), B(N, NRHS)
!HPF$ PROCESSORS PROC(P,Q)
!HPF$ DISTRIBUTE A(cyclic(NB), cyclic(NB)) ONTO PROC
!HPF$ DISTRIBUTE (cyclic(NB), cyclic(NBRHS)) ONTO PROC :: B, X
!
! Randomly generate the coefficient matrix A and the solution
! matrix X. Set the right hand side matrix B such that B = A * X.
!
call random_number(A)
call random_number(X)
B = matmul(A, X)
!
! Solve the linear system; the computed solution overwrites B
!
call la_gesv(A, B, IPIV)
!
! As a simple test, print the largest difference (in absolute value)
! between the computed solution (B) and the generated solution (X).
!
print*,'MAX( ABS(X~ - X) ) = ',maxval( abs(B - X) )
!
! Shutdown the ScaLAPACK system, I'm done
!
call SLhpf_exit()
stop
end</PRE>
<P>
<BR> <HR>
<P><ADDRESS>
<I>Susan Blackford <BR>
Tue May 13 09:21:01 EDT 1997</I>
</ADDRESS>
</BODY>
</HTML>
|