Hi list,

I'm using OBForceFields to perform quick preoptimizations in my code,
and I've noticed that when I try to run multiple preoptimizations
simultaneously using threads, I get random segfaults, usually in
portions of OpenBabel that assign hybridizations to atoms (This
happens during the call to OBForceField::Setup(obmol, constraints).
The preoptimization code makes these calls to OBForceField, in this
order (irrelevant code removed):

  ff = OBForceField::FindForceField("MMFF94s");
  ff = ff->MakeNewInstance();
  ff->SetLogFile(NULL);
  ff->SetLogLevel(OBFF_LOGLVL_NONE);
  ff->Setup(obmol, constraints);
  ff->SteepestDescentInitialize(steps, conv)
  while (not done) {
    ff->SteepestDescentTakeNSteps(n)
  }

If I wrap the whole process in a mutex, the crashes stop. So there
appears to be an issue in running these simultaneously, perhaps a
static variable somewhere? Does anyone know what could be going on, or
what could be done to fix it?

I'm willing to put the time in to fix this in OB, but any pointers to
what the problem may be would be very useful!

Dave

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to