【发布时间】:2016-01-23 10:11:38
【问题描述】:
我想给一些子程序计时。这是我用来写名称和执行时间的模板:
SUBROUTINE get_sigma_vrelp
...declarations...
real(8) :: starttime, endtime
CHARACTER (LEN = 200) timebuf
starttime = MPI_Wtime()
...do stuff...
endtime = MPI_Wtime()
write (timebuf, '(30a,e20.10e3)') 'get_sigma_vrelp',endtime-starttime
call pout(timebuf)
END SUBROUTINE get_sigma_vrelp
这是一个示例输出:
(thread 4):get_sigma_vrelp �>
为什么 endtime-starttime 打印的是一个奇怪的字符而不是一个数值?顺便说一句,pout() 只是以线程安全的方式将缓冲区写入特定于进程的文件。它应该与问题无关,但如果这里没有其他会导致错误输出的内容,那么我可以发布它的正文。
【问题讨论】:
标签: io formatting fortran mpi