[vtk-developers] VTK/Python in Parallel

Jeff Lee jeff at cdnorthamerica.com
Fri Dec 13 15:28:24 EST 2002


Andy Cedilnik wrote:

>Hi Jeff,
>
>Two unrelated questions here. Let me try to answer both, then if you
>guys don't agree, correct me.
>
>1. Why do we need vtk and vtkpython executables?
>
>Tclsh, Wish, and Python executables are all compiled with C. On some
>platforms (read HPUX, SunOS, Irix,...) when loading C++ library into C,
>C++ initialization might not happen correctly, hence the code might not
>work. I saw this happening on SunOS. Vtk and vtkpython executables are
>compiled with C++ so they do the right thing.
>
[ Jeff answers Andy and then hides in the bushes... ]

    Answering a question with another, why does java (hideously coded in 
c) work fine with this model, and python/tcl doesn't?  I don't know, my 
view is tainted with java, so perhaps I shouldn't have opened my mouth. 
 There are some switches in python build to use c++ compatible dlopen, 
but I thought (perhaps wrongly) that ldl was getting better about such 
things and the switch wasn't necessary.  I thought the big problem with 
python was global/static classes with constructors.  I have had problems 
with SunOS initialization even in c++ where the link order influenced 
the static initialization and caused problems.

-Jeff

>
>2. Why do we need pvtk and pvtkpython executables?
>
>MPI has to modify argc and argv to run correctly. The code in pvtk and
>pvtkpython does that using vtkMPIController.
>
>			Andy
>
>On Fri, 2002-12-13 at 13:50, Jeff Lee wrote:
>  
>
>>Why not let vtkMPIController::Initialize(...) and Finalize do the trick? 
>> There is really no need for the wrapper languages to know about 
>>MPI_Init and MPI_Finalize, is there?  The only trick is allowing the 
>>wrapper languages to pass in argv, argc (which is why 
>>vtkMPICommunicator::Initialize(...) isn't wrapped).  Also, doesn't the 
>>vtk static initialization happen when the lib is loaded into the wrapper 
>>language?  Then you could just run your python or java code which loads 
>>the vtk libs (which triggers static initialization) and then just call 
>>vtkMPIController::Initialize(...).  Am I missing something (probably)?
>>    
>>
>
>
>
>
>  
>

-- 
Jeff Lee <jeff at cdnorthamerica.com>
Software Engineer
CD North America
21 Lafayette Street, Suite 230
Lebanon, NH 03766
Tel:    (603) 643-9993 ext. 109
Fax:    (603) 643-9994





More information about the vtk-developers mailing list