Commit 6a95f707 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

change travis?

parent fc21ec77
...@@ -10,8 +10,7 @@ before_install: ...@@ -10,8 +10,7 @@ before_install:
- export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.3 - export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.3
script: script:
- mkdir build; cd build - cmake -DCMAKE_INSTALL_PREFIX=~/OpenMM -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG="-g -fsanitize=address -fno-omit-frame-pointer -O2" .
- cmake -DCMAKE_INSTALL_PREFIX=~/OpenMM -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG="-g -fsanitize=address -fno-omit-frame-pointer -O2" ..
- make - make
- make test - make test
- make install - make install
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include <stdlib.h>
#include "openmm/internal/ThreadPool.h" #include "openmm/internal/ThreadPool.h"
#include "openmm/internal/hardware.h" #include "openmm/internal/hardware.h"
...@@ -61,7 +62,15 @@ static void* threadBody(void* args) { ...@@ -61,7 +62,15 @@ static void* threadBody(void* args) {
} }
ThreadPool::ThreadPool() { ThreadPool::ThreadPool() {
numThreads = getNumProcessors(); char* openmmNumThreads = getenv("OPENMM_NUM_THREADS");
char* end = openmmNumThreads;
if (openmmNumThreads != NULL) {
numThreads = strtol(openmmNumThreads, &end, 0);
}
if (openmmNumThreads == NULL || openmmNumThreads==end) {
numThreads = getNumProcessors();
}
pthread_cond_init(&startCondition, NULL); pthread_cond_init(&startCondition, NULL);
pthread_cond_init(&endCondition, NULL); pthread_cond_init(&endCondition, NULL);
pthread_mutex_init(&lock, NULL); pthread_mutex_init(&lock, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment