diff --git a/.gitignore b/.gitignore index ca4a542..074d256 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Custom _* +outputs/ *.log log/ data/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 9016ff9..c942169 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/README.md b/README.md index 8c9c5a9..e6a9fd6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 33796b2..ffed66f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "zhangjun990222@gmail.com" }, diff --git a/python/before-all-manylinux.sh b/python/before-all-manylinux.sh index ff7f8fc..ef99d40 100755 --- a/python/before-all-manylinux.sh +++ b/python/before-all-manylinux.sh @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2bfea47..5cea916 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}") @@ -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}) diff --git a/src/entity/person/person.cu b/src/entity/person/person.cu index af88d6c..a07e6af 100644 --- a/src/entity/person/person.cu +++ b/src/entity/person/person.cu @@ -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) { @@ -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; @@ -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); diff --git a/src/output/output.cu b/src/output/output.cu index aafe5a0..59fad77 100644 --- a/src/output/output.cu +++ b/src/output/output.cu @@ -66,10 +66,10 @@ void StepOutput::Write(float t, const MArr& 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: