From 5ed2997eaefc30aaf5d22c6d33951e0404b684fe Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 1 Nov 2023 18:25:54 +0000 Subject: [PATCH 1/3] debug: netpyne --- example/example.zip | Bin 629 -> 713 bytes example/example_dir/example.py | 21 +++++++++++++-------- example/testParam.properties | 5 +++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/example/example.zip b/example/example.zip index e39fd0e84c958c784994224faff9f91d5b1b3212..cebaa23109b2ad21a49bcbd8d56fd37206708d4c 100644 GIT binary patch literal 713 zcmWIWW@h1H00Gg-iQ!-dl;B~IVMwh=%q_@CjZeue(hm*cWMFODnh;7+GF0 zGcbUO0H7%%Kz$rwQ_l2OSmiS^Fmy99Fo>a<0yR;upc0>Xxf2iO-8SH9dtb%nH~rWF zHIciz4cu#DqrYt8eOoBOa&?)kqM2$yNO1Ct-Tt0)mT0f)R_Xfl^W*euQFr(3Fy!MX zoD{0y!TVc7fzd*E%7OmlyV;lK{cZ3*P`j>ka?o`}zc;_99yt2*X!wtx6|BAriT|gl z76k3e(7swI(HQW^g`=*gku~Uu+RDSJR&tMbZST=c$urP=YQ16FosMfxvCZ4cO6IM( z>dl(!`b~xV?}Sd9uk2gQ|1|qE?f(|+dVNi7|4E6(+FMuOuZVQ)@Zgr+bVSE3&ZVAh z??uraEO+;vT^YJOePjBQC#Tfopk1!p8bkU z?usUj9< literal 629 zcmWIWW@h1H0D+z=`EW1;O7JkqFr-!_<`(3n#;0T!>4%1JGB7V+_#tH_5SLbPGcdAz zWn^Gr5do?X0Ga}#IT(&lkPjEToV-OED0Kmd#n4QFny6P$2{y0o#D|o2AVxDUc7nhE zVFR9{?|+IMTOQ^lD7D>l?}zXhhFtfSWtW!C-Ky7_GkvX7P5GwMGbMM#%E4Hu+j(zucWQo5~`4VGksAg1ow%}T||2|u_If*4ITMlO*LYNsOSMwe~W)}F5TWWRhdX6=f38$P-|A>j+|^ zMj$IB0?`5+Vj`~SgO~`6NrokjZfGVVM<&p0P-J45&B_LH2NMvk1JWBo1~C8tKcLvf diff --git a/example/example_dir/example.py b/example/example_dir/example.py index 57c2c22..3bded64 100644 --- a/example/example_dir/example.py +++ b/example/example_dir/example.py @@ -7,16 +7,21 @@ """ +from netpyne import specs import sys import pkg_resources -print("Running example script to list Python packages...") +if __name__ == "__main__": + print("Running example script to list Python packages...") -with open("output.txt", "w") as f: - print(f"Python version is: {sys.version}", file=f) - print("Installed packages on NSG:", file=f) - dists = [str(d).replace(" ", "==") for d in pkg_resources.working_set] - for i in dists: - print(i, file=f) + with open("output.txt", "w") as f: + print(f"Python version is: {sys.version}", file=f) + print("Installed packages on NSG:", file=f) + dists = [str(d).replace(" ", "==") for d in pkg_resources.working_set] + for i in dists: + print(i, file=f) -print("Done!") \ No newline at end of file + print(f"Args are: {sys.argv}") + if sys.argv.count("-nogui") > 0: + print("nogui found") + print("Done!") diff --git a/example/testParam.properties b/example/testParam.properties index 885f985..5397125 100644 --- a/example/testParam.properties +++ b/example/testParam.properties @@ -1,7 +1,8 @@ toolId=OSBv2_EXPANSE_0_7_3 -number_cores_=1 +number_cores_=2 number_nodes_=1 -tasks_per_node_=1 +tasks_per_node_=2 runtime_=0.5 nrnivmodl_o_=0 filename_=example.py +cmdlineopts_=-nogui From 2baf02706e6ad55c44dbed14538ee21831c02d7f Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Thu, 2 Nov 2023 08:11:56 +0000 Subject: [PATCH 2/3] feat: add netpyne reproducer --- example/example_dir/example.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example/example_dir/example.py b/example/example_dir/example.py index 3bded64..9791994 100644 --- a/example/example_dir/example.py +++ b/example/example_dir/example.py @@ -8,6 +8,9 @@ from netpyne import specs +from netpyne import sim +from netpyne import __version__ as version + import sys import pkg_resources @@ -21,6 +24,10 @@ for i in dists: print(i, file=f) + for k in sys.modules.keys(): + if "matplotlib" in k: + print(f"matplotlib still loaded: {k}") + print(f"Args are: {sys.argv}") if sys.argv.count("-nogui") > 0: print("nogui found") From 0fb52603f2aeec0e8c14664f509a237f9616812f Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Mon, 6 Nov 2023 09:42:16 +0000 Subject: [PATCH 3/3] ci(example): update to test pyneuroml/netpyne imports to ensure that matplotlib is not also imported --- example/example.zip | Bin 713 -> 894 bytes example/example_dir/example.py | 16 +++++++++++----- example/testParam.properties | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/example/example.zip b/example/example.zip index cebaa23109b2ad21a49bcbd8d56fd37206708d4c..86de20e018134b770a0c99e772c5aadf315bc3d5 100644 GIT binary patch literal 894 zcmWIWW@h1H00C>?v~Vy3O7JkqFr-!_<`(3n#;0T!>4%1JGB7{d;*t6oh)XND85mh! zFf%ZKi2$G}B0zl{U{hqaZRb&8Vql16VPFtLGX-j*UO^??Jdl}a=H&)?_g^*;*!Mh~ z=b3}HZsOKETB4lO+IKMAvQ-koYe{9`20&6O# zHJfw%bC|nXAoRk#2AP(NOyYGmb=4YO>u)_^D>yXmUx3K>bMj4j)=j%_@BaSb^G9Kg zbj=rcJ@k$^eR#Jhqe=RJ($8ks3(e(?3RNK=tK9j+Ux$8eQOrtT&6U#fC%sAS&I$Q6 zw&FwsSHtx-M}A)Zo-1mw%TS|-C!=EhROU~Y-io<|@&}memZ1=Nf^$oXAYYQxwljmD1oKdl0p1xM=qF{~X4EpR}PcIPO;s4;v zj|Z2fZYj-{waODnh;7+GF0GcbS&kU9~dDh`mk@H4#? zR{4w!4Bbo<;}q+0Xvv*;Fz>bjPuu${F2Cu=4ycLT)otKj6C3?y6YtwX36`tNWEIU+ z144q6U+nhxoU=rGRkuplpPwJ6UyHiCXNMslN8zMU1rOfe8VZaS!cz|PAK%TsH1BVN z_kr4Vos)yEEBd|pJ@vrRpGU*%fBdXq^;JmxKSi}5Xjg{z)k2BJfJZJIbv=!&K}Xb9 z9!|BAd%SCVk7i1qf#y@|4b$#)Tyu(T-d0vJZ_QP2)>PMTD%^i3blQAn-(vo!*`I0u zw_w-nYhwFPN-Wmiy83=aq+^E%x9p}PI&N_;^=x}Ditb>!yYKAE(B{n!RS2Ri0sXug$mON&$gH2p&TSaN? zk6i~YG%f#cYdrhF>!dbcjrzW#+cEpk-hDZ5nbpIe!p&9I@6F!{TO6zOIsW(a>U+i0 z&Re$l2p4(U|8`n<{@0-`4;D diff --git a/example/example_dir/example.py b/example/example_dir/example.py index 9791994..3ccb572 100644 --- a/example/example_dir/example.py +++ b/example/example_dir/example.py @@ -10,6 +10,7 @@ from netpyne import specs from netpyne import sim from netpyne import __version__ as version +from pyneuroml import pynml import sys import pkg_resources @@ -21,14 +22,19 @@ print(f"Python version is: {sys.version}", file=f) print("Installed packages on NSG:", file=f) dists = [str(d).replace(" ", "==") for d in pkg_resources.working_set] - for i in dists: - print(i, file=f) + # also check if netpyne/pyneuroml etc. cause importing matplotlib: we can't + # use matplotlib on NSG because the different mpi processes cause the same + # cache file to be read, which causes crashes + print("Checking if matplotlib loaded...") + print(f"Args are: {sys.argv}") + if sys.argv.count("-nogui") > 0: + print("nogui option found") + + for i in dists: + print(i, file=f) for k in sys.modules.keys(): if "matplotlib" in k: print(f"matplotlib still loaded: {k}") - print(f"Args are: {sys.argv}") - if sys.argv.count("-nogui") > 0: - print("nogui found") print("Done!") diff --git a/example/testParam.properties b/example/testParam.properties index 5397125..edaff50 100644 --- a/example/testParam.properties +++ b/example/testParam.properties @@ -1,6 +1,6 @@ toolId=OSBv2_EXPANSE_0_7_3 number_cores_=2 -number_nodes_=1 +number_nodes_=2 tasks_per_node_=2 runtime_=0.5 nrnivmodl_o_=0