#765794 Race condition when running scripts in "stdin" mode

#765794#5
Date:
2014-10-18 07:32:37 UTC
From:
To:
  Hello,

  I've been trying to make a small script that drives pymol completely
uninteractively using a pymol -c -p command.

  Unfortunately, pymol is polling from stdin DURING the reading of
scripts from within a @ command, which leads to painful race
conditions, as I'm wrapping the call to scripts to a cd in/cd out
command.

  For instance, I'm running

cd /home/vincent/Recherche/Proteines/CODH
@ CODH-clusters.pml
cd /home/vincent/tmp

The CODH-clusters.pml runs a series of pymol scripts by itself.

  As you can see below, the cd /home/vincent/tmp comes between

select prot, ((all) and (not ((fes) or (nifes))))

and

select s, /////S3

  Both of these commands are within the
"CODH-Chydrogenoformans-definitions.pml" script. This is really
painful, since one cannot assume that because one sends commands
sequentially, the previous one is finished before the next one starts.

============================================================
PyMOL>cd /home/vincent/Recherche/Proteines/CODH
 cd: now in /home/vincent/Recherche/Proteines/CODH
PyMOL>@ CODH-clusters.pml
PyMOL>@ CODH-vue-generale.pml
PyMOL>@ CODH-Chydrogenoformans-definitions.pml
PyMOL>load ../PDB/1SU8.pdb.gz, Ch;
[...]
PyMOL>select prot, ((all) and (not ((fes) or (nifes))))
 Selector: selection "prot" defined with 11466 atoms.
PyMOL>cd /home/vincent/tmp
PyMOL>select s, /////S3
============================================================

  I'll try to see if this can be easily fixed...

       Vincent

#765794#10
Date:
2015-06-13 14:11:59 UTC
From:
To:
forwarded 765794 http://sourceforge.net/p/pymol/bugs/130/
thanks

Hi Vincent,

This seems to be the same issue as
http://sourceforge.net/p/pymol/bugs/130/ do you agree?

Unfortunately, that bug saw no comment from upstream either, I will try
to bring it up on the mailing list.


Michael

#765794#17
Date:
2015-06-23 11:26:09 UTC
From:
To:
  Hi Michael,

  Sorry for not answering before, kinda missed your mail.

  This is definitely looking like that.

  Thanks. For the record, I'm trying to synchronize by outputting
something after each command and waiting for the correct output. I
haven't had problems so far, but I'm unsure this is the right way to
do that. Essentially, my memory is that the command input is flawed
and does not guarantee the correct ordering of the commands when
standard input is used.

  Cheers,

      Vincent