Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Added optional argument for hostaddress #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/SlurmTree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local ipc = require 'libipc'
local Tree = require 'ipc.Tree'
local NullTree = require 'ipc.NullTree'

local function SlurmTree(fn, tasksPerGpu)
local function SlurmTree(fn, tasksPerGpu, hostAddress)
tasksPerGpu = tasksPerGpu or 1
local slurmProcId = tonumber(os.getenv("SLURM_PROCID"))
local numNodes = tonumber(os.getenv("SLURM_NTASKS"))
Expand Down Expand Up @@ -72,7 +72,7 @@ local function SlurmTree(fn, tasksPerGpu)
if numNodes == 1 then
tree = NullTree()
else
local nodeHost = sys.execute('/bin/hostname')
local nodeHost = hostAddress or sys.execute('/bin/hostname')
local nodePort = nil
if nodeIndex == 1 then
local server,nodePort = ipc.server(nodeHost, nodePort)
Expand Down