Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ endif ()
#set(WCS_VERTEX_LIST_TYPE "::boost::listS"
# CACHE STRING "The BGL vertex list type to use in WCS")

######################### For clang ###############################
#set(WCS_OUT_EDGE_LIST_TYPE "::boost::vecS"
# CACHE STRING "The BGL out edge list type to use in WCS")

######################### For clang ###############################
# Setup specific to using clang on Livermore Computing (LC) platforms
#
# Currently, to use clang on Livermore Computing (LC) platforms with
Expand Down Expand Up @@ -563,6 +563,28 @@ if (WCS_HAS_METIS)
list(APPEND WCS_EXEC_TARGETS ssa_partition-bin)
endif (WCS_HAS_METIS)

# add executable ssa_partition_inline
if (WCS_HAS_METIS)
add_executable( ssa_partition_inline-bin src/ssa_partition_inline.cpp)
target_include_directories(ssa_partition_inline-bin PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>)

target_include_directories(ssa_partition_inline-bin
PRIVATE $<TARGET_PROPERTY:wcs,INTERFACE_INCLUDE_DIRECTORIES>
${Protobuf_DIR}/include ${Boost_INCLUDE_DIRS})

target_link_libraries(ssa_partition_inline-bin wcs ${LIB_FILESYSTEM}
-L${Boost_LIBRARY_DIRS} boost_program_options)

set_target_properties(ssa_partition_inline-bin PROPERTIES OUTPUT_NAME ssa_partition_inline)
set_target_properties(ssa_partition_inline-bin PROPERTIES CMAKE_INSTALL_RPATH
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
list(APPEND WCS_EXEC_TARGETS ssa_partition_inline-bin)
endif (WCS_HAS_METIS)

# add executable graphml2dot
add_executable( graphml2dot-bin src/utils/graphml2dot.cpp )
set_target_properties(graphml2dot-bin PROPERTIES OUTPUT_NAME graphml2dot)
Expand Down
6 changes: 6 additions & 0 deletions src/sim_methods/ssa_nrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ bool SSA_NRM::advance_time_and_iter(const sim_time_t t_new)
m_sim_time = t_new;
return true;
}

void SSA_NRM::advance_step(const sim_time_t t_new)
{
++ m_sim_iter;
m_sim_time = t_new;
}
#endif // defined(_OPENMP) && defined(WCS_OMP_RUN_PARTITION)

bool SSA_NRM::forward(const revent_t firing)
Expand Down
1 change: 1 addition & 0 deletions src/sim_methods/ssa_nrm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class SSA_NRM : public Sim_Method {
#if defined(_OPENMP) && defined(WCS_OMP_RUN_PARTITION)
/// Used in parallel mode with partitioned network
bool advance_time_and_iter(const sim_time_t t_new);
void advance_step(const sim_time_t t_new);
void update_reactions(const sim_time_t t_fired,
const Sim_Method::affected_reactions_t& affected,
reaction_times_t& affected_rtimes);
Expand Down
6 changes: 6 additions & 0 deletions src/ssa_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ void wcs_init(const wcs::SSA_Params& cfg, const partition_idx_t& parts)
#endif
omp_set_dynamic(0);
omp_set_schedule(omp_sched_static, 0);

if (omp_get_max_threads() < shared_state.m_nparts) {
WCS_THROW("Set OMP_NUM_THREADS env variable larger than " \
+ std::to_string(shared_state.m_nparts));
// The globl states have already been created.
}
omp_set_num_threads(shared_state.m_nparts);

shared_state.m_max_time = cfg.m_max_time;
Expand Down
Loading