F2Py_SSSO
F2Py_SSSO
Table of contents
1 Introduction
4 Real Application
5 Lessons Learned
https://modelingguru.nasa.gov/docs/DOC-2322
/discover/nobackup/jkouatch/pythonTrainingGSFC.tar.gz
After you untar the above file, you will obtain the directory
pythonTrainingGSFC/ that contains:
Examples/
Slides/
Settings on discover
Useful Links
Basic Facts
What is F2Py?
F2Py Features
Limitations
Initial Preparation
1 subroutine matrixMult (C , A , B , n )
2
3 implicit none
4
5 integer , intent ( in ) :: n
6 real *8 , intent ( in ) :: A (n , n )
7 real *8 , intent ( in ) :: B (n , n )
8 real *8 , intent ( out ) :: C (n , n )
9
10 C = matmul (A , B )
11
12 return
13
14 end subroutine matrixMult
How to Do It?
Run F2Py
9 A = np . random . rand (n , n )
10 B = np . random . rand (n , n )
11
12 begTime = time ()
13 AB = forMatMul . matrixmult (A , B )
14 endTime = time ()
Shell Script
#!/bin/csh -f
source /usr/share/modules/init/csh
module purge
module load other/comp/gcc-4.5-sp1
module load lib/mkl-10.1.2.024
module load other/SIVO-PyD/spd_1.9.0_gcc-4.5-sp1
./f2py_MGconvDiff2d.py 16
Things to Consider
References I
References II