Skip to content

Commit

Permalink
replace c++ deque with vector for event queue
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jul 26, 2024
1 parent 23dc955 commit e0b9390
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,34 @@ jobs:
# echo "------ running ziptool ------"
# ./bin/ziptool || true

- name: Setup Visual Studio build tools
# - name: Setup Visual Studio build tools
# if: matrix.platform == 'windows-latest'
# uses: actions/vs-build-tools@v1
# with:
# installPath: C:\BuildTools
# version: 16
# components: Microsoft.VisualStudio.Component.VC.Tools.x86.x64
#
# - name: Add clang-cl to PATH
# if: matrix.platform == 'windows-latest'
# run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\bin" >> $GITHUB_PATH

- name: Install Windows Dependencies
if: matrix.platform == 'windows-latest'
uses: actions/vs-build-tools@v1
uses: msys2/setup-msys2@v2
with:
installPath: C:\BuildTools
version: 16
components: Microsoft.VisualStudio.Component.VC.Tools.x86.x64
msystem: MINGW64
update: true
install: >
zip
git
cmake
ninja
- name: Add clang-cl to PATH
if: matrix.platform == 'windows-latest'
run: echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\bin" >> $GITHUB_PATH
- name: Build Windows
if: matrix.platform == 'windows-latest'
shell: msys2 {0}
run: |
echo "working dir is $PWD"
Expand All @@ -311,8 +325,8 @@ jobs:

cmake \
-G Ninja \
-DCMAKE_C_COMPILER="clang-cl.exe" \
-DCMAKE_CXX_COMPILER="clang-cl.exe" \
-DCMAKE_C_COMPILER="/c/Program Files/LLVM/bin/clang-cl.exe" \
-DCMAKE_CXX_COMPILER="/c/Program Files/LLVM/bin/clang-cl.exe" \
-DOPTION_TARGET_MESSAGING=OFF \
-DOPTION_TARGET_PARALLEL=OFF \
-DOPTION_TARGET_CHOMBO2D_SOLVER=OFF \
Expand Down
4 changes: 2 additions & 2 deletions VCellMessaging/include/VCELL/SimulationMessaging.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _SIMULATIONMESSAGING_H_
#define _SIMULATIONMESSAGING_H_

#include <deque>
#include <vector>
#ifdef USE_MESSAGING
#include <stdlib.h>
#include <stdio.h>
Expand Down Expand Up @@ -145,7 +145,7 @@ class SimulationMessaging
private:
SimulationMessaging();
static SimulationMessaging *m_inst;
std::deque<WorkerEvent *> events;
std::vector<WorkerEvent *> events;
int workerEventOutputMode;

void sendStatus();
Expand Down
5 changes: 4 additions & 1 deletion VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ void SimulationMessaging::sendStatus() {
WorkerEventLocker locker(*this);
if (events.size( ) > 0 ) {
workerEvent = events.front( );
events.pop_front( );
if (!events.empty())
{
events.erase(events.begin());
}
}
else {
return;
Expand Down

0 comments on commit e0b9390

Please sign in to comment.