提交 0e4709da 编写于 作者: D dongdaxiang

add mpi4py helper

上级 41e19eb4
from mpi4py import MPI
class MPIHelper(object):
def __init__(self):
self.comm = MPI.COMM_WORLD
def get_rank(self):
return self.comm.Get_rank()
def get_size(self):
return self.comm.Get_size()
def get_ip(self):
import socket
local_ip = socket.gethostbyname(socket.gethostname())
return local_ip
def get_hostname(self):
import socket
return socket.gethostname()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册