vtkPythonAlgorithm : long running tasks and multiple computers ?

Hi @Nicholas_Yue, these are interesting use-cases.

Case 1:

VTK leverages task parallelism (the processes could be on the same machine or on different machines), using MPI. See https://gitlab.kitware.com/vtk/vtk/-/blob/master/Examples/ParallelProcessing/Generic/Cxx/ParallelIso.cxx. This is a C++ example, but it should work fine using vtk’s python bindings. In that example, the MyMain function is restricted to a single process. Ideally NodeA would be running that single process in your use case. You can then use CreateSubController or just SetMultipleMethod from vtkMPIController to farm out the successive task to all the processes (on the different machines).

Case 2:

Yes, again vtkMPIController provides this logic. As shown in the example above, you write your code once and then call the executable with mpi to run it on all different processes. The ordering logic should be managed in your code based on how you’d like to process which file.