从Cray Fortran获取当前主机名 [英] Obtaining current host name from Cray Fortran

查看:166
本文介绍了从Cray Fortran获取当前主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何从Cray Fortran程序获取当前主机名?我基本上需要UNIX gethostname()的输出。浏览Craydocs页面后,我看到PXF *函数似乎没有包含这些信息。



Wirawan

解决方案

Cray Fortran在现代Fortran特性中处于领先地位。
您可以使用Fortran 2003的C互操作性功能调用 gethostname()。该名称将以null结尾。
您也可以使用Fortran 2003中的 GET_ENVIRONMENT_VARIABLE 内部子例程。


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

解决方案

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.

这篇关于从Cray Fortran获取当前主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆