《并行算法实践》附带的mpi源程序

源代码在线查看: readme.txt

软件大小: 834 K
上传用户: newyearday
关键词: mpi 并行算法 实践 源程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				1. compile:
				mpicc cjacobi.c -o cjacobi -lm
				
				2. run:
				mpirun -np 4 cjacobi
				
				3. result:
				Input of file "dataIn.txt"
				8        8
				1.000000        3.000000        4.000000        4.000000        5.000000        6.000000        7.000000        8.000000
				3.000000        1.000000        2.000000        2.000000        3.000000        4.000000        5.000000        6.000000
				4.000000        2.000000        1.000000        2.000000        3.000000        3.000000        2.000000        1.000000
				1.000000        2.000000        3.000000        4.000000        4.000000        6.000000        7.000000        8.000000
				4.000000        5.000000        5.000000        6.000000        7.000000        8.000000        1.000000        1.000000
				2.000000        2.000000        2.000000        3.000000        4.000000        5.000000        7.000000        3.000000
				2.000000        4.000000        5.000000        7.000000        9.000000        0.000000        2.000000        3.000000
				1.000000        2.000000        4.000000        6.000000        2.000000        7.000000        8.000000        1.000000
				the 0st envalue:-5.539342
				the 1st envalue:9.369179
				the 2st envalue:2.678424
				the 3st envalue:0.378010
				the 4st envalue:30.210718
				the 5st envalue:-1.180327
				the 6st envalue:-10.858351
				the 7st envalue:-3.058303
				
				Iteration num = 4
				Whole running time    = 0.142161 seconds
				Distribute data time  = 0.003757 seconds
				Parallel compute time = 0.132369 seconds
							

相关资源