Skip to content

Commit

Permalink
v1.2.2: use static link for avro and boost; try to fix segment fault …
Browse files Browse the repository at this point in the history
…for some specific cases in output
  • Loading branch information
Sweetnow committed Jan 9, 2025
1 parent 4f8bc68 commit 18c581a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Custom
_*
outputs/
*.log
log/
data/
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF CACHE BOOL "")
set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF CACHE BOOL "")
FetchContent_MakeAvailable(fmt yaml-cpp argparse pybind11 cityproto)

set(Boost_USE_STATIC_LIBS ON CACHE BOOL "")
# the CMakelists.txt of avro is in the /lang/c++/ directory
FetchContent_Declare(
avro
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ wget -O boost_1_86_0.tar.gz https://archives.boost.io/release/1.86.0/source/boos
tar -zxvf boost_1_86_0.tar.gz
cd boost_1_86_0
./bootstrap.sh --with-libraries=filesystem,iostreams,program_options,regex,system --prefix=/usr/local # avro dependency
./b2 install
./b2 cxxflags=-fPIC install
cd ..
rm -r boost_1_86_0
rm boost_1_86_0.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "python-moss"
version = "1.2.1"
version = "1.2.2"
description = "MObility Simulation System"
authors = [
{ name = "Jun Zhang", email = "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion python/before-all-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wget -O boost_1_86_0.tar.gz https://archives.boost.io/release/1.86.0/source/boos
tar -zxf boost_1_86_0.tar.gz
cd boost_1_86_0
./bootstrap.sh --with-libraries=filesystem,iostreams,program_options,regex,system --prefix=/usr/local # avro dependency
./b2 install
./b2 cxxflags=-fPIC install
cd ..
rm -r boost_1_86_0
rm boost_1_86_0.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ target_link_libraries(moss
PRIVATE argparse
PRIVATE fmt
PRIVATE yaml-cpp
PRIVATE avrocpp
PRIVATE avrocpp_s
)
target_compile_definitions(moss PRIVATE VERSION="build.${DATE}")

Expand Down Expand Up @@ -95,7 +95,7 @@ target_link_libraries(_moss
PRIVATE cityproto
PRIVATE CUDA::nvToolsExt
PRIVATE fmt
PRIVATE avrocpp
PRIVATE avrocpp_s
)
target_compile_definitions(_moss PRIVATE VERSION="build.${DATE}")
target_include_directories(_moss PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
7 changes: 5 additions & 2 deletions src/entity/person/person.cu
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ __global__ void Prepare(Person* persons, PersonOutput* outputs, uint size,
return;
}
auto& p = persons[id];
// write output
auto& o = outputs[id];
if (!p.enable) {
o.status = -1;
return;
}
switch (p.runtime.status) {
Expand All @@ -169,8 +172,6 @@ __global__ void Prepare(Person* persons, PersonOutput* outputs, uint size,
} break;
}
p.snapshot = p.runtime;
// write output
auto& o = outputs[id];
o.t = t;
o.id = p.id;
o.x = p.runtime.x;
Expand All @@ -180,6 +181,8 @@ __global__ void Prepare(Person* persons, PersonOutput* outputs, uint size,
o.parent_id = p.runtime.aoi->id;
} else if (p.runtime.lane) {
o.parent_id = p.runtime.lane->id;
} else {
o.parent_id = -1;
}
o.direction = p.runtime.dir;
o.status = int(p.runtime.status);
Expand Down
4 changes: 2 additions & 2 deletions src/output/output.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ void StepOutput::Write(float t, const MArr<PersonOutput>& person_outputs,
_person_schema);
for (const auto& person_output : person_outputs) {
switch (person_output.status) {
case int(PersonStatus::DRIVING): {
case int32_t(PersonStatus::DRIVING): {
veh_writer.write(person_output);
} break;
case int(PersonStatus::WALKING): {
case int32_t(PersonStatus::WALKING): {
ped_writer.write(person_output);
} break;
default:
Expand Down

0 comments on commit 18c581a

Please sign in to comment.