OmniRPC User's Guide Version 1.2: http://www.omni.hpcc.jp/omnirpc/ <omnirpc@omni.hpcc.jp> | ||
---|---|---|
Prev | Next |
In this section, we explain how to program OmniRPC in FORTRAN. If you want to know more details about APIs, see Section FORTRAN API.
Let's think about this Fortran program. This program calculates the inner product of a matrix. The main program is called main.f, and ip.f is the subroutine that calculates the inner product.
main.f
double precision a(10),b(10),r do i = 1,10 a(i) = i b(i) = i+10 end do call innerprod(10,a,b,r) write(*,*) 'result=',r end
ip.f
subroutine innerprod(n,a,b,r) integer n double precision a(*),b(*),r integer i r = 0.0 do i = 1,n r = r+a(i)*b(i) end do return end
Let's set this program to call the innerprod subroutine with OmniRPC.