In that repository in the subdirectory
~/ncsexamples/batchMode
you will find the Go source file
helloFrameGo.go
. To build the Binary Executable
helloFrameGo
, please follow these steps.
First, please install the Go compiler tools for your machine, from
https://golang.org/doc/install.
Next, build the aarch64 executable
helloFrameGo_aarch64
with this command:
GOARCH=arm64 GOOS=linux go build -o helloFrameGo_aarch64 helloFrameGo.go
Now you will have the binary executable file
helloFrameGo_aarch64
.
In the subdirectory
~/ncsexamples/batchMode
you will find the
runBatchBinaryGo.py command.
This script will create a set of instances running on mobile devices, one instance for each frame to
be computed (3 in the default example provided).
startFrame = 1,
endFrame = 3,
It will command the instances to receive the binary executable file
helloFrameGo_aarch64
, then run the executable:
workerBinFilePath = 'helloFrameGo_aarch64' # binary to copy to instance
commonInFilePath = binaryFrameProcessor.workerBinFilePath,
def frameCmd( self, frameNum ):
workerBinFileName = os.path.basename( self.workerBinFilePath )
cmd = './%s %d > %s' % \
(workerBinFileName, frameNum, self.frameOutFileName(frameNum))
return cmd
The output is a text file
frame_<n>.out
containing
"Hello World! From frameNum = n"
These output files will be sent back to the master host, and the master will then terminate the instances.