Obtaining current host name from Cray Fortran

时光总嘲笑我的痴心妄想 提交于 2019-12-02 05:04:32

问题


Anyone knows how to get the current host name from a Cray Fortran program? I want basically the output of UNIX gethostname(). After scouring Craydocs pages, I see that the PXF* functions do not seem to contain this information.

Wirawan


回答1:


Cray Fortran is quite ahead in modern Fortran features. You can call the gethostname() using C interoperability features of Fortran 2003. The name would be null terminated. You can also probably use GET_ENVIRONMENT_VARIABLE intrinsic subroutine from Fortran 2003.




回答2:


Try using PXFGETENV to get the value of the HOSTNAME environment variable.




回答3:


Since all Cray machines have MPI, you can use MPI_Get_processor_name from any dialect of Fortran.



来源:https://stackoverflow.com/questions/13419569/obtaining-current-host-name-from-cray-fortran

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!