diff --git a/arbor/fvm_lowered_cell_impl.hpp b/arbor/fvm_lowered_cell_impl.hpp index 3851ef02835955532520dc3fe39a4297d40ef216..701576cfd34a2628528c5b7dbe5f26e8a29b2ba8 100644 --- a/arbor/fvm_lowered_cell_impl.hpp +++ b/arbor/fvm_lowered_cell_impl.hpp @@ -540,7 +540,7 @@ void fvm_lowered_cell_impl<Backend>::initialize( throw arb::bad_source_description(gid, rec.num_sources(gid), cell.detectors().size());; } auto cell_targets = util::sum_by(cell.synapses(), [](auto& syn) {return syn.second.size();}); - if (cell_targets > rec.num_targets(gid)) { + if (rec.num_targets(gid) > cell_targets) { throw arb::bad_target_description(gid, rec.num_targets(gid), cell_targets); } diff --git a/test/unit/test_recipe.cpp b/test/unit/test_recipe.cpp index 888b4da80447b03249d22bf09901bb7797e9e2bb..c325af6497ab1a628cb5c5777f4dcacc782da7a1 100644 --- a/test/unit/test_recipe.cpp +++ b/test/unit/test_recipe.cpp @@ -141,7 +141,7 @@ TEST(recipe, num_targets) EXPECT_NO_THROW(simulation(recipe_0, decomp_0, context)); } { - auto recipe_1 = custom_recipe({cell}, {0}, {1}, {{}}, {{}}); + auto recipe_1 = custom_recipe({cell}, {0}, {3}, {{}}, {{}}); auto decomp_1 = partition_load_balance(recipe_1, context); EXPECT_THROW(simulation(recipe_1, decomp_1, context), arb::bad_target_description);