From 83687523038eb0cc90e09b133fdfb7748046ccaf Mon Sep 17 00:00:00 2001 From: Michael Hines Date: Fri, 4 Oct 2024 10:44:26 -0400 Subject: [PATCH] cv3 version of json file for test_netcvode.py --- src/nrncvode/cvodeobj.cpp | 2 +- test/cover/test_netcvode.py | 12 +- test/cover/test_netcvode_cv3.json | 544 ++++++++++++++++++++++++++++++ 3 files changed, 554 insertions(+), 4 deletions(-) create mode 100644 test/cover/test_netcvode_cv3.json diff --git a/src/nrncvode/cvodeobj.cpp b/src/nrncvode/cvodeobj.cpp index 5dc7677aa8..1a834e8062 100644 --- a/src/nrncvode/cvodeobj.cpp +++ b/src/nrncvode/cvodeobj.cpp @@ -1490,7 +1490,7 @@ void Cvode::matmeth() { /* attach the matrix and linear solver to CVode */ int flag = CVDlsSetLinearSolver(mem_, LS, A); - assert(flag); + assert(flag == CVDLS_SUCCESS); /* Set jacobian and allocate memory */ /* (TODO Michael Hines: is there a jacobian for dense matrix diff --git a/test/cover/test_netcvode.py b/test/cover/test_netcvode.py index 19ac3f2612..89d6ecab24 100644 --- a/test/cover/test_netcvode.py +++ b/test/cover/test_netcvode.py @@ -2,15 +2,21 @@ from neuron.expect_hocerr import expect_err from neuron.tests.utils.checkresult import Chk +cv = h.CVode() +pc = h.ParallelContext() + import io, math, os, re, sys +try: + jsonfile = "test_netcvode_cv%s.json" % (cv.version().split(".")[0],) +except: + jsonfile = "test_netcvode.json" + dir_path = os.path.dirname(os.path.realpath(__file__)) -chk = Chk(os.path.join(dir_path, "test_netcvode.json")) +chk = Chk(os.path.join(dir_path, jsonfile)) if hasattr(h, "usetable_hh"): h.usetable_hh = 0 # So same whether compiled with CoreNEURON or not. -cv = h.CVode() -pc = h.ParallelContext() # remove address info from cv.debug_event output def debug_event_filter(s): diff --git a/test/cover/test_netcvode_cv3.json b/test/cover/test_netcvode_cv3.json new file mode 100644 index 0000000000..4b27df87fa --- /dev/null +++ b/test/cover/test_netcvode_cv3.json @@ -0,0 +1,544 @@ +{ + "cv.statename": [ + "Cell0.soma.v(0.5)", + "Cell1.soma.v(0.5)", + "ExpSyn[2].g", + "ExpSyn[0].g", + "ExpSyn[3].g", + "ExpSyn[1].g", + "Cell0.soma.m_hh(0.5)", + "Cell0.soma.h_hh(0.5)", + "Cell0.soma.n_hh(0.5)", + "Cell1.soma.m_hh(0.5)", + "Cell1.soma.h_hh(0.5)", + "Cell1.soma.n_hh(0.5)" + ], + "cv.states": [ + -52.50938711497598, + -64.97554877215292, + 0.0, + 0.0, + 0.0, + 0.0, + 0.15582485144869637, + 0.55055775754716, + 0.3452546332246297, + 0.05305323269495299, + 0.5960693873718816, + 0.31771125645516396 + ], + "cv.dstates": [ + 12.560086669798395, + 0.020118199892408574, + -0.0, + -0.0, + -0.0, + -0.0, + 0.11207709505125722, + -0.06459562693011639, + 0.0370479067665413, + 0.00013522546304641636, + -9.443147521419767e-05, + 6.237977868226249e-05 + ], + "cv.error_weights": [ + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0 + ], + "cv.acor": [ + 0.0010812690723232437, + -1.4040774835404841e-08, + 0.0, + 0.0, + 0.0, + 0.0, + 4.657357986718185e-06, + -1.7872853616841512e-06, + 7.801498904080935e-07, + 1.0106810987514186e-09, + 4.997030297669551e-11, + -3.261713280559383e-11 + ], + "cv.statename lvardt": [ + "Cell0.soma.v(0.5)", + "ExpSyn[2].g", + "ExpSyn[0].g", + "Cell0.soma.m_hh(0.5)", + "Cell0.soma.h_hh(0.5)", + "Cell0.soma.n_hh(0.5)", + "Cell1.soma.v(0.5)", + "ExpSyn[3].g", + "ExpSyn[1].g", + "Cell1.soma.m_hh(0.5)", + "Cell1.soma.h_hh(0.5)", + "Cell1.soma.n_hh(0.5)" + ], + "cv.states lvardt": [ + -52.53545236589848, + 0.0, + 0.0, + 0.15558226635175665, + 0.5506282888605684, + 0.3452177082451229, + -64.9761957025603, + 0.0, + 0.0, + 0.05304893701102853, + 0.5960633730004943, + 0.31771495734633265 + ], + "cv.dstates lvardt": [ + 12.47685558511351, + -0.0, + -0.0, + 0.11156915048226415, + -0.06440599813381483, + 0.03695162889715873, + 0.02004031194638477, + -0.0, + -0.0, + 0.00013627477218227798, + -9.106569603587847e-05, + 5.988397486638602e-05 + ], + "cv.error_weights lvardt": [ + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0, + 1000.0 + ], + "cv.acor lvardt": [ + 0.001797648791297263, + 0.0, + 0.0, + 9.48714317398556e-06, + -3.308676418046889e-06, + 1.4307718973480343e-06, + -5.837135010288721e-05, + 0.0, + 0.0, + -1.5186446462501243e-06, + -4.173939436043979e-07, + 2.1475215349602923e-07 + ], + "AtolTool": [ + [ + "v", + 65.0, + 0.0024854818855429366 + ], + [ + "vext", + -1000000000.0, + -1000000000.0 + ], + [ + "nai", + -1000000000.0, + -1000000000.0 + ], + [ + "nao", + -1000000000.0, + -1000000000.0 + ], + [ + "ki", + -1000000000.0, + -1000000000.0 + ], + [ + "ko", + -1000000000.0, + -1000000000.0 + ], + [ + "m_hh", + 0.1560889907785202, + 0.00030912677821062876 + ], + [ + "h_hh", + 0.5961207535084603, + 2.49005552987478e-05 + ], + [ + "n_hh", + 0.34534183345837116, + 1.4084414690185844e-05 + ], + [ + "ExpSyn.g", + 0.0, + 0.0 + ], + [ + "Exp2Syn.A", + -1000000000.0, + -1000000000.0 + ], + [ + "Exp2Syn.B", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.e", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.vo", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.vi", + -1000000000.0, + -1000000000.0 + ], + [ + "Vector", + -1000000000.0, + -1000000000.0 + ] + ], + "state_magnitudes states": [ + 65.0, + 65.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.1560889907785202, + 0.5961207535084603, + 0.34534183345837116, + 0.05305355044613753, + 0.5961207535084603, + 0.3177114032079621 + ], + "state_magnitudes acor": [ + 0.0024854818855429366, + 2.504355613758206e-06, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00030912677821062876, + 2.49005552987478e-05, + 1.4084414690185844e-05, + 1.8204042386329376e-07, + 8.132383943998542e-09, + 6.27378631165311e-09 + ], + "AtolTool lvardt": [ + [ + "v", + 65.0, + 0.00236087209990945 + ], + [ + "vext", + -1000000000.0, + -1000000000.0 + ], + [ + "nai", + -1000000000.0, + -1000000000.0 + ], + [ + "nao", + -1000000000.0, + -1000000000.0 + ], + [ + "ki", + -1000000000.0, + -1000000000.0 + ], + [ + "ko", + -1000000000.0, + -1000000000.0 + ], + [ + "m_hh", + 0.158833417642452, + 0.00011959184172682607 + ], + [ + "h_hh", + 0.5961207535084603, + 1.979758873080762e-05 + ], + [ + "n_hh", + 0.34627618550058137, + 6.24144887929199e-06 + ], + [ + "ExpSyn.g", + 0.0, + 0.0 + ], + [ + "Exp2Syn.A", + -1000000000.0, + -1000000000.0 + ], + [ + "Exp2Syn.B", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.e", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.vo", + -1000000000.0, + -1000000000.0 + ], + [ + "VClamp.vi", + -1000000000.0, + -1000000000.0 + ], + [ + "Vector", + -1000000000.0, + -1000000000.0 + ] + ], + "state_magnitudes states lvardt": [ + 65.0, + 0.0, + 0.0, + 0.158833417642452, + 0.5961207535084603, + 0.34627618550058137, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "state_magnitudes acor lvardt": [ + 0.00236087209990945, + 0.0, + 0.0, + 0.00011959184172682607, + 1.979758873080762e-05, + 6.24144887929199e-06, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "record discrete tvec": [ + -55.73833959014465, + -56.164073429598, + -56.353197398035576, + -56.31417939595125, + -56.087804781948854, + -55.70415710330923, + -55.17496924198961, + -54.489315154531134 + ], + "record discrete savestate tvec": [ + -51.05761223577956, + -49.083613840583915, + -46.26523218155794, + -41.96064390742168, + -34.81024885330416, + -21.839144847655277, + 1.599154947822088, + 28.91849590614551 + ], + "record discrete dt": [ + -65.0, + -55.73833959014465, + -56.164073429598, + -56.353197398035576, + -56.31417939595125, + -56.087804781948854, + -55.70415710330923, + -55.17496924198961, + -54.489315154531134, + -53.618721296124875, + -52.50938711497598 + ], + "record discrete savestate dt": [ + -65.0, + -51.05761223577956, + -49.083613840583915, + -46.26523218155794, + -41.96064390742168, + -34.81024885330414, + -21.839144847655238, + 1.5991549478221518, + 28.918495906145555, + 38.93353691988716 + ], + "rtol=0.001 atol=0 tvec": [ + 0.0, + 0.022360679774997894, + 0.04472135954999579, + 0.1219190045167767, + 0.19911664948355762, + 0.2763142944503385, + 0.4269593925378439, + 0.5776044906253492, + 0.7282495887128546, + 0.87889468680036, + 1.0295397848878654, + 1.1801848829753707, + 1.330829981062876, + 1.4814750791503815, + 1.6321201772378868, + 1.7827652753253922, + 1.9334103734128976, + 2.0 + ], + "rtol=0.001 atol=0 vvec": [ + 0.001, + 0.0009781283844172107, + 0.0009567351364026562, + 0.0008864924820122856, + 0.0008208339645665602, + 0.0007598424280885463, + 0.0006531309232629807, + 0.0005611991539277455, + 0.00048213443770928115, + 0.00041418309680670457, + 0.00035579966610583554, + 0.00030564279649990115, + 0.0002625553854362881, + 0.00022554174307610442, + 0.00019374594442173116, + 0.00016643251636812263, + 0.00014296959461413495, + 0.00013365247854877708 + ], + "rtol=0 atol=0.001 tvec": [ + 0.0, + 0.0036865877408063983, + 0.582009367159784, + 1.5645270609956108, + 2.0 + ], + "rtol=0 atol=0.001 vvec": [ + 0.001, + 0.0009963269532682463, + 0.0006312567785627606, + 0.00025650358596811186, + 0.0001536542475067585 + ], + "stiff=0 lvardt tvec size": 69, + "stiff=0 tvec size": 73, + "stiff=1 tvec size": 72, + "stiff=2 tvec size": 67, + "jacobian 2 tvec size": 93, + "jacobian 1 tvec size": 78, + "jacobian 0 tvec size": 67, + "store_events": [ + 0.0, + 10.986122886681098, + 0.0, + 12.527629684953682, + 0.0, + 14.66337068793427, + 10.986122886681098, + 21.972245773362197, + 12.527629684953682, + 25.055259369907365 + ], + "event queue spikes": [ + [ + 10.986122886681098, + 12.527629684953682 + ], + [ + 0.0, + 1.0 + ] + ], + "print_event_queue": " NetCon[0] src=IntFire2[0] target=IntFire2[2] 13.9861228866811\n NetCon[1] src=IntFire2[0] target=IntFire2[2] 13.9861228866811\n SelfEvent target=IntFire2[2] 14.6633706879343 flag=1\n PreSyn src=IntFire2[1] 15.5276296849537\n SelfEvent target=IntFire2[0] 21.9722457733622 flag=1\n SelfEvent target=IntFire2[1] 25.0552593699074 flag=1\n", + "print_event_queue tvec": [ + 13.986122886681098, + 13.986122886681098, + 14.66337068793427, + 15.527629684953682, + 21.972245773362197, + 25.055259369907365 + ], + "event_queue_info(2...)": [ + [ + 13.986122886681098, + 13.986122886681098, + 15.527629684953682, + 15.527629684953682, + 15.527629684953682 + ], + [ + "NetCon[0]", + "NetCon[1]", + "NetCon[4]", + "NetCon[3]", + "NetCon[2]" + ] + ], + "event_queue_info(3...)": [ + [ + 14.66337068793427, + 21.972245773362197, + 25.055259369907365 + ], + [ + 1.0, + 1.0, + 1.0 + ], + [ + "IntFire2[2]", + "IntFire2[0]", + "IntFire2[1]" + ] + ], + "SaveState restore at 13": [ + [ + 14.709134369880251, + 21.972245773362197 + ], + [ + 2.0, + 0.0 + ] + ], + "playrecord debug_event": "send PlayRecordEvent 0 VecPlayStep Vector[N].x[0]\ndeliver PlayRecordEvent 0 VecPlayStep Vector[N].x[0]\nsend PlayRecordEvent 1 VecPlayStep Vector[N].x[1]\nmicrostep retreat from 1 (cvode_0x... is at 1) for event onset=1\n", + "interthread debug_event 2 serial threads": "send NetParEvent 0 t=4.975 tt-t=4.975\nsend NetParEvent 1 t=4.975 tt-t=4.975\nsend PreSyn src=Cell0.soma 6.7250000001\ninterthread send td=6.7250000001 DE type=4 thread=1 target=-1 ?\ninterthread enqueue td=6.7250000001 DE type=4 thread=1 target=-1 ?\nsend PreSyn src=Cell0.soma 6.7250000001\ndeliver NetParEvent 1 t=4.975 tt-t=-3.73035e-14\nsend NetParEvent 1 t=9.95 tt-t=4.975\ndeliver NetParEvent 0 t=4.975 tt-t=-3.73035e-14\nsend NetParEvent 0 t=9.95 tt-t=4.975\ndeliver PreSyn src=Cell0.soma 6.7250000001\ndeliver PreSyn src=Cell0.soma 6.7250000001\ndeliver NetParEvent 1 t=9.95 tt-t=3.01981e-14\nsend NetParEvent 1 t=14.925 tt-t=4.975\ndeliver NetParEvent 0 t=9.95 tt-t=3.01981e-14\nsend NetParEvent 0 t=14.925 tt-t=4.975\n" +}