Obtaining current host name from Cray Fortran

2019-02-27 18:00发布

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

3条回答
祖国的老花朵
2楼-- · 2019-02-27 18:11

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.

查看更多
时光不老,我们不散
3楼-- · 2019-02-27 18:26

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

查看更多
Emotional °昔
4楼-- · 2019-02-27 18:26

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

查看更多
登录 后发表回答