From: Raluca Mihaela ANDREI (r.andrei_at_sns.it)
Date: Tue Mar 31 2009 - 02:57:56 CDT

Hi,
sorry for the unclear message, when I talked about threads, I
was meaning asynchronous operations, and the question was
about the mol command.
As you asked, I send to you on the following my script code:

# VMD for LINUX, version 1.8.6 (March 18, 2009)

set chan [open "input.txt"]
gets $chan inputdir
gets $chan workdir
gets $chan filename
gets $chan num
close $chan

for {set x 1} {$x<=$num} {incr x} {

        #--- PQR file loading
        menu files off
        menu files on
        animate style Loop
        display resetview

        set tmpFile $inputdir$filename$x.pqr
        mol new $tmpFile type {pqr} first 0 last -1 step 1 waitfor 1
        animate style Loop
        menu files off
        #--------------------
        
        #--- Work PQR file
        menu apbsrun off
        menu apbsrun on

        set tmpFile $workdir$filename$x.pqr
        animate write pqr $tmpFile beg 0 end 0 skip 1 $x-1)
        #--------------------
        
        #--- POT.DX file creation
        set potname pot
        set potFile $workdir$potname.dx
        display resetview
        mol addfile $potFile type {dx} first 0 last -1 step 1 waitfor
1 $x-1
        animate style Loop
        menu apbsrun off
        #--------------------

        #--- Rename DX file
        set tmpFile $workdir$filename$x.dx
        file copy -force $potFile $tmpFile
        file delete $potFile
        #--------------------

        #--- Rendering (OBJ file creation)
          menu graphics off
        menu graphics on
        mol modstyle 0 0 Surf 1.400000 0.000000
        menu graphics off
        axes location Off
        menu render off
        menu render on
        set tmpFile $workdir$filename$x.obj
        render Wavefront $tmpFile true
        menu render off
        #--------------------

}

# VMD for LINUX, version 1.8.6 (March 18, 2009)
# end of log file.

Thank you very much.
Regards,

Raluca

On Sat, 28 Mar 2009 14:41:52 -0500
  John Stone <johns_at_ks.uiuc.edu> wrote:
>
> Hi,
> It's not clear to me what you're talking about when you
> refer to "thread" in the context of your script. The VMD
> command interpreter is single-threaded, although some
>operations
> are asynchronous by default (e.g. 'mol new', etc).
>
> Please send a copy of your script, as the single command you
> included below is insufficient to indicate the source of
>your
> problem.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
>
> On Fri, Mar 27, 2009 at 06:44:32PM +0100, Raluca Mihaela
>ANDREI wrote:
>> Hi,
>> I have to load different PQR files, and for each one I have
>>to
>> create the relevant pot.dx file and the relevant rendering
>> file.
>>
>> I would have to carry out these operations automatically by
>> running a tcl script, so I would include all relevant
>> statements in a "for" cycle.
>>
>> But I have a problem when the script runs the "mol" command
>>as
>> the following:
>>
>> "mol addfile $potFile type {dx} first 0 last -1 step 1
>>waitfor
>> -1 $molID"
>>
>> After this statement, a different thread creating the pot.dx
>> file runs, while the script continues to run the other
>> statements, without waiting for the end of the previous one.
>>
>> Is it possible, to wait for the end of the thread relevant
>>the
>> pot.dx creation, and to execute the other statements just
>>when
>> the pot.dx creation is finished?
>>
>> Thank you.
>>
>> Raluca
>
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078