Forum

Author Topic: One build script across multiple nodes  (Read 4959 times)

talldrinks

  • Newbie
  • *
  • Posts: 13
    • View Profile
One build script across multiple nodes
« on: April 05, 2017, 03:50:54 PM »
Hello!
I've got a script which does a complete build:
Match
Align
Dense
Mesh
Uv
*texture path swap
*disables all mono cameras before texturing
*texture projection
*loads reference CSV for orient and scale
*Export files
*save scene

My question is, what happens during the above starred* steps when the job is distributed across a farm of Agi nodes?

First off, do I just call the script from the control mode pc?
Does that script then get sent out to the other nodes for processing?
How does each node know which piece of the script it should run?

Do all results get returned to the main node for texture processing and file exports?

Thank you. I know it's many questions.

« Last Edit: April 05, 2017, 03:52:33 PM by talldrinks »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15159
    • View Profile
Re: One build script across multiple nodes
« Reply #1 on: April 05, 2017, 05:17:03 PM »
Hello talldrinks,

Common scripts are fully executed on the single node, since Run Script command doesn't support the fine level task distribution.

If you need to distribute something using Python, you need to create NetworkTask instances and send them to the server via Python. The rest of the tasks (that are performing some custom job) can be organized to a separate script that can be passed as an argument to the network server.
Best regards,
Alexey Pasumansky,
Agisoft LLC

talldrinks

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: One build script across multiple nodes
« Reply #2 on: April 05, 2017, 05:22:46 PM »
I see.
Do you happen to have any examples of such a script structure which interacts with nodes and utilizes custom python scripts?
Much appreciated!

talldrinks

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: One build script across multiple nodes
« Reply #3 on: April 05, 2017, 05:24:06 PM »
Oh, I don't think I mentioned, this is all being run from the command line.

I did find this snippet in the API reference:

Code: [Select]
import PhotoScan
task = PhotoScan.NetworkTask()
task.name = 'MatchPhotos'
task.params['keypoint_limit'] = 40000
client = PhotoScan.NetworkClient()
client.connect('127.0.0.1')
batch_id = client.createBatch('processing/project.psx', [task])
client.resumeBatch(batch_id)

Am I to understand that I can run a single python script from the server PC, which calls out individual nodes by IP address, and generates tasks for each with a unique task name as such?:

Code: [Select]
task1 = PhotoScan.NetworkTask()
task1.name = 'MatchPhotos'
task1.params['keypoint_limit'] = 40000
client1 = PhotoScan.NetworkClient()
client1.connect('127.0.0.1')
batch_id1 = client1.createBatch('processing/project.psx', [task1])
client1.resumeBatch(batch_id1)

task2 = PhotoScan.NetworkTask()
task2.name = 'AlignPhotos'
task2.params['Accuracy'] = HighAccuracy
client2 = PhotoScan.NetworkClient()
client2.connect('127.0.0.2')
batch_id2 = client2.createBatch('processing/project.psx', [task2])
client2.resumeBatch(batch_id2)
etc

for instance...?
« Last Edit: April 05, 2017, 05:35:32 PM by talldrinks »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15159
    • View Profile
Best regards,
Alexey Pasumansky,
Agisoft LLC

talldrinks

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: One build script across multiple nodes
« Reply #5 on: April 05, 2017, 05:36:07 PM »
Thank you. I'll review these.