-
Notifications
You must be signed in to change notification settings - Fork 33
/
notes
17212 lines (13199 loc) · 497 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Working Notes (Part C)
----------------------
This file contains a diary of random working notes, which I use to keep
track of what the heck it is that I'm doing. It is almost surely totally
useless to you, except maybe for some weird voyeuristic reasons.
======================================================================
Feb 2021
--------
Commisioning run for calibration (fake language)
Crash.
ulimit -c unlimited
ulimit -a
(cog-rocks-stats)
Connected to rocks:///home/ubuntu/data/fake_pairs.rdb
Database contents:
Next aid: 633
Atoms/Links/Nodes a@: 633 l@: 586 n@: 46
Keys/Incoming/Hash k@: 338 i@: 336 h@: 0
Thread 172410 "guile" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff57fff700 (LWP 14341)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff7cbe859 in __GI_abort () at abort.c:79
#2 0x00007ffff7cbe729 in __assert_fail_base (
fmt=0x7ffff7e54588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=0x7ffff787262d "mutex->__data.__owner == 0",
file=0x7ffff78725fa "../nptl/pthread_mutex_lock.c", line=117,
function=<optimized out>) at assert.c:92
#3 0x00007ffff7ccff36 in __GI___assert_fail (
assertion=assertion@entry=0x7ffff787262d "mutex->__data.__owner == 0",
file=file@entry=0x7ffff78725fa "../nptl/pthread_mutex_lock.c",
line=line@entry=117,
function=function@entry=0x7ffff7872790 <__PRETTY_FUNCTION__.10174> "__pthread_mutex_lock") at assert.c:101
#4 0x00007ffff78661a9 in __GI___pthread_mutex_lock (mutex=<optimized out>)
at ../nptl/pthread_mutex_lock.c:117
#5 0x00007fffececc047 in __gthread_mutex_lock (__mutex=0x5555559b1560)
at /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749
#6 __gthread_recursive_mutex_lock (__mutex=0x5555559b1560)
at /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:811
#7 std::recursive_mutex::lock (this=0x5555559b1560)
at /usr/include/c++/9/mutex:106
#8 std::unique_lock<std::recursive_mutex>::lock (this=<synthetic pointer>,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:141
#9 std::unique_lock<std::recursive_mutex>::unique_lock (__m=...,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:71
#10 opencog::AtomTable::add (this=this@entry=0x5555559b1560, orig=...,
force=force@entry=false)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:216
#11 0x00007fffecec1b85 in opencog::AtomSpace::add_node (
this=this@entry=0x5555559b1560, t=<optimized out>, t@entry=240, name=...)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomSpace.cc:287
#12 0x00007fffeceff99b in opencog::SchemeSmob::ss_new_node (
stype=<optimized out>, sname=<optimized out>, kv_pairs=0x304)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobNew.cc:390
(gdb) print in
$4 = "(observe-text \" n j d s b o u g\")\n"
scheme@(guile-user)>
==7309== Thread 57:
==7309== Syscall param futex(futex) points to unaddressable byte(s)
==7309== at 0x4FA2839: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:58)
==7309== by 0x4FA2839: pthread_mutex_unlock (pthread_mutex_unlock.c:357)
==7309== by 0x10FAC951: rocksdb::WriteThread::ExitAsBatchGroupFollower(rocksdb::WriteThread::Writer*) (in /usr/lib/librocksdb.so.5.17.2)
==7309== by 0x10EFCCAC: rocksdb::DBImpl::WriteImpl(rocksdb::WriteOptions const&, rocksdb::WriteBatch*, rocksdb::WriteCallback*, unsigned long*, unsigned long, bool, unsigned long*, unsigned long, rocksdb::PreReleaseCallback*) (in /usr/lib/librocksdb.so.5.17.2)
==7309== by 0x10EFE9AF: rocksdb::DBImpl::Write(rocksdb::WriteOptions const&, rocksdb::WriteBatch*) (in /usr/lib/librocksdb.so.5.17.2)
==7309== by 0x10EFEC1B: rocksdb::DB::Delete(rocksdb::WriteOptions const&, rocksdb::ColumnFamilyHandle*, rocksdb::Slice const&) (in /usr/lib/librocksdb.so.5.1
7.2)
==7309== by 0x10EFEC7F: rocksdb::DBImpl::Delete(rocksdb::WriteOptions const&, rocksdb::ColumnFamilyHandle*, rocksdb::Slice const&) (in /usr/lib/librocksdb.so.5.17.2)
==7309== by 0x10E65771: rocksdb::DB::Delete(rocksdb::WriteOptions const&, rocksdb::Slice const&) (in /usr/lib/librocksdb.so.5.17.2)
==7309== by 0x10BC6D97: opencog::RocksStorage::storeAtom(opencog::Handle const&, bool) (RocksIO.cc:254)
==7309== by 0x10B5F908: opencog::PersistSCM::dflt_store_atom(opencog::Handle) (PersistSCM.cc:289)
==7309== by 0x10B63459: conv_call_method<0> (SchemePrimitive.h:253)
==7309== by 0x10B63459: cpp_invoke (SchemePrimitive.h:261)
==7309== by 0x10B63459: opencog::SchemePrimitive<opencog::Handle, opencog::PersistSCM, opencog::Handle>::invoke(scm_unused_struct*) (SchemePrimitive.h:399)
==7309== by 0x1011B8CD: opencog::PrimitiveEnviron::do_call(scm_unused_struct*, scm_unused_struct*) (SchemePrimitive.cc:172)
==7309== by 0x2464E105: ???
==7309== Address 0x29042bc0 is on thread 62's stack
==7309== 1384 bytes below stack pointer
==7309==
and again .. just like above ...
==7309== Warning: unimplemented fcntl command: 1036
==7309== Thread 59:
==7309== Syscall param futex(futex) points to unaddressable byte(s)
==7309== at 0x4FA2839: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:58)
...
==7309== Address 0x45bd3bc0 is on thread 48's stack
==7309== 1384 bytes below stack pointer
==7309==
==7309== Warning: unimplemented fcntl command: 1036
==7309== Warning: unimplemented fcntl command: 1036
identical stack trace, different thread.
maybe put a lock into storeAtom circa line 254???
gdb: almost identical stack trace, except add_link:
#8 std::unique_lock<std::recursive_mutex>::lock (this=<synthetic pointer>,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:141
#9 std::unique_lock<std::recursive_mutex>::unique_lock (__m=...,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:71
#10 opencog::AtomTable::add (this=this@entry=0x55d164c980c0, orig=...,
force=force@entry=false)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:216
#11 0x00007f053765ac75 in opencog::AtomSpace::add_link (
this=this@entry=0x55d164c980c0, t=<optimized out>, t@entry=137,
outgoing=...)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomSpace.cc:304
#12 0x00007f0537697cf3 in opencog::SchemeSmob::ss_new_link (
stype=<optimized out>, satom_list=0x55d1682d6f70)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobNew.cc:508
* 1 Thread 0x7f051a7fc700 (LWP 26727) __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:50
2 Thread 0x7f05412c5740 (LWP 8955) __GI___libc_read (nbytes=1,
buf=0x55d1647fcad0, fd=0) at ../sysdeps/unix/sysv/linux/read.c:26
scm_readline
3 Thread 0x7f05406f7700 (LWP 8956) futex_wait_cancelable (
private=<optimized out>, expected=0, futex_word=0x7f0541099dec)
at ../sysdeps/nptl/futex-internal.h:183
GC_wait_marker ... also 4 5 7 13 14 15 23 24
6 is ConsoleSocket
8 is rocksdb::ThreadPoolImpl::Impl::BGThread 16 17 19 20 22 25 26
9 is opencog::Logger::LogWriter::writing_loop
10 Thread 0x7f04a4ff9700 (LWP 26729) __pthread_clockjoin_ex (
threadid=139657933203200, thread_return=0x0, clockid=<optimized out>,
abstime=<optimized out>, block=<optimized out>)
10 is opencog::GenericShell::~GenericShell also 11 also 39
12 is ~ConsoleSocket
18 Thread 0x7f04a67fc700 (LWP 9013) __GI___libc_read (nbytes=1,
buf=0x7f04a67fb5c0, fd=22) at ../sysdeps/unix/sysv/linux/read.c:26
GC_do_blocking_inner also 43
21 is immortal_thread
27 is opencog::SchemeEval::do_eval
31 Thread 0x7f04a6ffd700 (LWP 10064) __libc_recvmsg (flags=0,
msg=0x7f04a6ffcbe0, fd=16) at ../sysdeps/unix/sysv/linux/recvmsg.c:28
31 is boost::asio::detail::socket_ops::recv ServerSocket.cc:143
35 Thread 0x7f0532fae700 (LWP 8976) __lll_lock_wait (
futex=futex@entry=0x55d16514e698, private=0) at lowlevellock.c:52
35 is opencog::CogServer::runLoopStep
45 is shutdown .. asio opencog::ServerConsole::Exit
52 is
add_link
#0 __lll_lock_wait (futex=futex@entry=0x55d164c980c0, private=0)
at lowlevellock.c:52
#1 0x00007f0540c7c131 in __GI___pthread_mutex_lock (mutex=0x55d164c980c0)
at ../nptl/pthread_mutex_lock.c:115
#2 0x00007f0537665047 in __gthread_mutex_lock (__mutex=0x55d164c980c0)
at /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749
#3 __gthread_recursive_mutex_lock (__mutex=0x55d164c980c0)
at /usr/include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:811
#4 std::recursive_mutex::lock (this=0x55d164c980c0)
at /usr/include/c++/9/mutex:106
#5 std::unique_lock<std::recursive_mutex>::lock (this=<synthetic pointer>,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:141
#6 std::unique_lock<std::recursive_mutex>::unique_lock (__m=...,
this=<synthetic pointer>) at /usr/include/c++/9/bits/unique_lock.h:71
#7 opencog::AtomTable::add (this=this@entry=0x55d164c980c0, orig=...,
force=force@entry=false)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:216
#8 0x00007f053765ac75 in opencog::AtomSpace::add_link (
this=this@entry=0x55d164c980c0, t=<optimized out>, t@entry=137,
outgoing=...)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomSpace.cc:304
#9 0x00007f0537697cf3 in opencog::SchemeSmob::ss_new_link (
stype=<optimized out>, satom_list=0x55d1682ac410)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobNew.cc:508
stack #6 lock is
print __m
$1 = (std::unique_lock<std::recursive_mutex>::mutex_type &) @0x55d164c980c0: {<std::__recursive_mutex_base> = {_M_mutex = {__data = {__lock = 2, __count = 0,
__owner = -955664080, __nusers = 32514, __kind = 1, __spins = 0,
__elision = 0, __list = {__prev = 0x0, __next = 0x0}},
__size = "\002\000\000\000\000\000\000\000\060\271\t\307\002\177\000\000\001", '\000' <repeats 22 times>, __align = 2}}, <No data fields>}
stack 7
print _mtx
$2 = {<std::__recursive_mutex_base> = {_M_mutex = {__data = {__lock = 2,
__count = 0, __owner = -955664080, __nusers = 32514, __kind = 1,
__spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}},
__size = "\002\000\000\000\000\000\000\000\060\271\t\307\002\177\000\000\001", '\000' <repeats 22 times>, __align = 2}}, <No data fields>}
(gdb) print lck
$3 = {_M_device = 0x55d164c980c0, _M_owns = <optimized out>}
thr 1 stack #10
Its the same lock w/ same lock corruption.`
Happened again...
Above is with stock rocks on ubuntu 20.04 LTS focal
sudo apt purge librocksdb-dev librocksdb5.17 (october 2018)
git clone https://github.com/facebook/rocksdb
make shared_lib
guile: symbol lookup error: /usr/local/lib/opencog/libpersist-rocks.so: undefined symbol: ZSTD_versionNumber
or .. libasan
(cog-get-all-roots)
(fetch-all-words)
(load-atoms-of-type 'WordNode)
after pair-mi:
$ du -s ~/data/expt-1
4820 /home/ubuntu/data/expt-1
(cog-rocks-stats)
cog-rocks-stats: Atomspace holds 731 atoms
Next aid: 734
Atoms/Links/Nodes a@: 733 l@: 674 n@: 55
Keys/Incoming/Hash k@: 1122 i@: 379 h@: 0
MST counting: crash:
terminate called after throwing an instance of 'opencog::RuntimeException'
what(): AtomTable - deleteing atomtable 1 which has subtables! (/home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:97)
Aborted
Core was generated by `guile -l mst-count-fake.scm'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f6ce97ea700 (LWP 31842))]
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f6d0d415859 in __GI_abort () at abort.c:79
#2 0x00007f6d0282e951 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007f6d0283a47c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007f6d02839459 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007f6d02839e11 in __gxx_personality_v0 ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007f6d02738bdf in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7 0x00007f6d02739271 in _Unwind_RaiseException ()
from /lib/x86_64-linux-gnu/libgcc_s.so.1
#8 0x00007f6d0283a78c in __cxa_throw ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x00007f6d02d09fef in opencog::AtomTable::~AtomTable (this=0x563608e307a0,
__in_chrg=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:97
#10 0x00007f6d02d443dc in opencog::SchemeSmob::release_as (as=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobAS.cc:127
#11 0x00007f6d02d44f03 in opencog::SchemeSmob::free_misc (node=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobGC.cc:61
#12 0x00007f6d0d38bdff in GC_invoke_finalizers ()
from /lib/x86_64-linux-gnu/libgc.so.1
#13 0x00007f6d0d69e968 in ?? () from /lib/x86_64-linux-gnu/libguile-3.0.so.1
__in_chrg=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/atomspace/AtomTable.cc:97
#10 0x00007f6d02d443dc in opencog::SchemeSmob::release_as (as=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobAS.cc:127
#11 0x00007f6d02d44f03 in opencog::SchemeSmob::free_misc (node=<optimized out>)
at /home/ubuntu/src/atomspace/opencog/guile/SchemeSmobGC.cc:61
Bad!!!
#12 0x00007f6d0d38bdff in GC_invoke_finalizers ()
from /lib/x86_64-linux-gnu/libgc.so.1
fixed in issue https://github.com/opencog/atomspace/pull/2796
after pair-mi:
$ du -s ~/data/expt-1
4820 /home/ubuntu/data/expt-1
(cog-rocks-stats)
cog-rocks-stats: Atomspace holds 731 atoms
Next aid: 734
Atoms/Links/Nodes a@: 733 l@: 674 n@: 55
Keys/Incoming/Hash k@: 1122 i@: 379 h@: 0
after mst:
$ du -s ~/data/expt-1
178256 /home/ubuntu/data/expt-1
20420 /home/ubuntu/data/expt-1 after auto-compaction
Next aid: 39919
Atoms/Links/Nodes a@: 39918 l@: 39845 n@: 57
Keys/Incoming/Hash k@: 22173 i@: 18589 h@: 0
Error: support-api: There isn't any cached data on cset
Run `((add-support-compute LLOBJ) 'cache-all)` to compute that data
Error: support-api: There isn't any cached data on cset
Run `((add-support-compute LLOBJ) 'cache-all)` to compute that data
RocksIO.cc:563
remFromSidList
removeSatom (is locked...)
remIncoming (is locked...
remIncoming
(use-modules (opencog) (opencog persist) (opencog persist-rocks))
(cog-rocks-open "rocks:///tmp/foo")
(define a (Concept "a"))
(define b (Concept "b"))
(define l (List a b a b))
(store-atomspace)
(cog-delete! l)
RocksIO.cc:306
Speed is about 16 sentences/second for pair-counting.
135 sentences/sec for MPG parsing
repl:
guile -l pair-count-fake.scm -- a b c
c-start-cogserver
(print-matrix-summary-report star-obj)
((add-support-compute star-obj) 'cache-all)
((make-central-compute star-obj) 'cache-all)
Spinning disks:
iostat -d 5
sudo iotop -d 5
shows about 15MB/sec to 40MB/sec of disk-writes to
spinning disk (dm-0 aka md15 aka sdb/sde)
speed:
Stored 200000 of 394854 left-wilds in 287 secs (139 pairs/sec)
Stored 240000 of 394854 left-wilds in 353 secs (113 pairs/sec)
Stored 280000 of 394854 left-wilds in 413 secs (97 pairs/sec)
Stored 320000 of 394854 left-wilds in 379 secs (106 pairs/sec)
Nasty, old postgres was 10x faster in SSD.
Done storing 394854 left-wilds in 2912 secs
// Never mind, above is due to a stupid debug print...
as_ref_count: oas
Uh no, after removing print its still slow.
Stored 200000 of 394854 left-wilds in 213 secs (188 pairs/sec)
Stored 240000 of 394854 left-wilds in 239 secs (167 pairs/sec)
Stored 280000 of 394854 left-wilds in 286 secs (140 pairs/sec)
Stored 320000 of 394854 left-wilds in 347 secs (115 pairs/sec)
cog-rocks-stats: Atomspace holds 1265536 atoms
Connected to rocks:///home/ubuntu/data/expt-3/mpg_parse.rdb
Database contents:
Next aid: 1265559
Atoms/Links/Nodes a@: 1265558 l@: 1265494 n@: 37
Keys/Incoming/Hash k@: 870932 i@: 790044 h@: 0
du -s /home/ubuntu/data/expt-3/*
1140496 /home/ubuntu/data/expt-3/mpg_parse.rdb
re-open and close:
566020 /home/ubuntu/data/expt-3/mpg_parse.rdb
gram-1.rdb is (gram-classify-greedy-discrim 0.5 4)
gram-2.rdb is (gram-classify-greedy-fuzz 0.65 0.3 4)
a b: <wcl-a>;
c: <wcl-b>;
d e: <wcl-c>;
f g: <wcl-d>;
h i j: <wcl-e>;
k l m n: <wcl-f>;
o: <wcl-g>;
p: <wcl-h>;
q r s: <wcl-i>;
t u: <wcl-j>;
Throw to key `C++-EXCEPTION' with args `("dflt-delete" "Internal Error! (/home/ubuntu/src/atomspace-rocks/opencog/persist/rocks/RocksIO.cc:563)\nFunction args:\n((Section (ctv 1 0 0)\n (WordNode \"s\" (ctv 1 0 1.19871e+07))\n (ConnectorSeq\n (Connector\n (WordNode \"###LEFT-WALL###\" (ctv 1 0 1.24572e+07))\n (ConnectorDir \"-\"))\n (Connector\n (WordNode \"o\" (ctv 1 0 2.3094e+06))\n (ConnectorDir \"-\"))\n (Connector\n (WordNode \"p\" (ctv 1 0 1.32314e+07))\n (ConnectorDir \"-\"))\n (Connector\n (WordNode \"u\" (ctv 1 0 1.05214e+07))\n (ConnectorDir \"-\"))))\n)")'.
Can't find the sid in the sid-list...
RocksStorage::remIncoming
RocksStorage::removeSatom(
RocksStorage::removeAtom
Can't find sid=KI4< in sidlist=JqF BTG irD1 nFX2 NoU5 <
klist is=i@XI4:Section<
rei osatom= (this should be XI4 and since its in KI4, KI4 should be in
it's oset.
(ConnectorSeq
(Connector (WordNode "###LEFT-WALL###")(ConnectorDir "-"))
(Connector (WordNode "o")(ConnectorDir "-"))
(Connector (WordNode "p")(ConnectorDir "-"))
(Connector (WordNode "u")(ConnectorDir "-")))
rein satom= (this is sid KI4) we're trying to delete this
(Section (WordNode "s")
(ConnectorSeq
(Connector (WordNode "###LEFT-WALL###")(ConnectorDir "-"))
(Connector (WordNode "o")(ConnectorDir "-"))
(Connector (WordNode "p")(ConnectorDir "-"))
(Connector (WordNode "u")(ConnectorDir "-"))))
sid should be the section... KI4
ConSeq should be XI4
klist is the osid of the osatom
std::string sidlist;
rocksdb::Status s = _rfile->Get(rocksdb::ReadOptions(), klist, &sidlist);
export ROCKS_DB_URL=rocks:///home/ubuntu/data/expt-3/gram-2.rdb
Its not there in gram-1.db either
Its not there in mpg_parse.rdb ...
print_all
BlockBasedTableOptions table_options;
table_options.filter_policy.reset(NewBloomFilterPolicy(10, false));
table_options.optimize_filters_for_memory = true;
auto table_factory = new BlockBasedTableFactory(table_options);
rocksdb::Options options;
options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(table_options));
rocksdb::DB* db;
rocksdb::DB::Open(options, name, &db);
table.h
1/11 Test #1: BasicSaveUTest ................... Passed 7.03 sec
2/11 Test #2: ValueSaveUTest ................... Passed 2.62 sec
3/11 Test #3: PersistUTest ..................... Passed 0.78 sec
4/11 Test #4: FetchUTest ....................... Passed 3.21 sec
5/11 Test #5: BasicDeleteUTest ................. Passed 3.39 sec
6/11 Test #6: DeleteUTest ...................... Passed 0.60 sec
7/11 Test #7: AlphaEquivUTest .................. Passed 2.93 sec
8/11 Test #8: MultiPersistUTest ................ Passed 1.53 sec
9/11 Test #9: QueryPersistUTest ................ Passed 2.09 sec
10/11 Test #10: LargeFlatUTest ................... Passed 76.56 sec
11/11 Test #11: LargeZipfUTest ................... Passed 167.55 sec
Total Test time (real) = 268.36 sec
Total Test time (real) = 254.93 sec
1/11 Test #1: BasicSaveUTest ................... Passed 6.60 sec
2/11 Test #2: ValueSaveUTest ................... Passed 2.13 sec
3/11 Test #3: PersistUTest ..................... Passed 0.84 sec
4/11 Test #4: FetchUTest ....................... Passed 2.61 sec
5/11 Test #5: BasicDeleteUTest ................. Passed 2.55 sec
6/11 Test #6: DeleteUTest ...................... Passed 0.57 sec
7/11 Test #7: AlphaEquivUTest .................. Passed 2.81 sec
8/11 Test #8: MultiPersistUTest ................ Passed 0.72 sec
9/11 Test #9: QueryPersistUTest ................ Passed 2.53 sec
10/11 Test #10: LargeFlatUTest ................... Passed 75.35 sec
11/11 Test #11: LargeZipfUTest ................... Passed 172.17 sec
Total Test time (real) = 268.90 sec
Total Test time (real) = 271.28 sec
(use-modules (opencog))
(use-modules (opencog persist))
(use-modules (opencog persist-rocks))
(define a (Concept "a"))
(define b (Concept "b"))
(define l1 (List a b))
(define l2 (List l1 a))
(cog-rocks-open "rocks:///tmp/foo")
(store-atom l2)
(cog-delete-recursive! a)
Boom.
$ du -s *rdb
7016 fake_pairs.rdb
21710584 gram-2.rdb <<<<<<<<<<< wtf
417488 mpg_parse-no-margs.rdb
954720 mpg_parse.rdb
closing and reopening does this:
538360 gram-2.rdb
---------Bingo! Dist=0.7606 for class "j n" -- "t"
Can't find sid=sQ23< in sidlist=xQ23 pNu5 <
inset key=i@0R23:Section<
remin osatom=
(ConnectorSeq
(Connector (WordNode "###LEFT-WALL###")(ConnectorDir "-"))
(Connector (WordNode "j")(ConnectorDir "-"))
(Connector (WordNode "g")(ConnectorDir "-"))
(Connector (WordNode "t")(ConnectorDir "-"))
(Connector (WordNode "s")(ConnectorDir "-"))
(Connector (WordNode "s")(ConnectorDir "-")))
reminc satom=sQ23
(Section (WordNode "t")
(ConnectorSeq
(Connector (WordNode "###LEFT-WALL###")(ConnectorDir "-"))
(Connector (WordNode "j")(ConnectorDir "-"))
(Connector (WordNode "g")(ConnectorDir "-"))
(Connector (WordNode "t")(ConnectorDir "-"))
(Connector (WordNode "s")(ConnectorDir "-"))
(Connector (WordNode "s")(ConnectorDir "-"))))
well foo, delete was n=0 r=0 satom=sQ23
(Section (WordNode "t")(ConnectorSeq (Connector (WordNode "###LEFT-WALL###")(ConnectorDir "-"))(Connector (WordNode "j")(ConnectorDir "-"))(Connector (WordNode "g")(ConnectorDir "-"))(Connector (WordNode "t")(ConnectorDir "-"))(Connector (WordNode "s")(ConnectorDir "-"))(Connector (WordNode "s")(ConnectorDir "-"))))
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `C++-EXCEPTION' with args `("dflt-delete" "Internal Error! (/home/ubuntu/src/atomspace-rocks/opencog/persist/rocks/RocksIO.cc:582)
Function args:
((Section (ctv 1 0 0)
(WordNode "t" (ctv 1 0 1.0531e+07))
(ConnectorSeq
(Connector
(WordNode "###LEFT-WALL###" (ctv 1 0 1.24572e+07))
(ConnectorDir "-"))
(Connector
(WordNode "j" (ctv 1 0 1.56322e+07))
(ConnectorDir "-"))
(Connector
(WordNode "g" (ctv 1 0 4.84869e+06))
(ConnectorDir "-"))
(Connector
(WordNode "t" (ctv 1 0 1.0531e+07))
(ConnectorDir "-"))
(Connector
(WordNode "s" (ctv 1 0 1.19871e+07))
(ConnectorDir "-"))
(Connector
(WordNode "s" (ctv 1 0 1.19871e+07))
(ConnectorDir "-"))))
)")'.
(cog-rocks-get "i@0R23:Section") yes its missing
(cog-rocks-get "a@sQ23") this is the section.
(cog-rocks-get "l@(ConnectorSeq (Connector (WordNode \"###LEFT-WALL###\")(ConnectorDir \"-\"))(Connector (WordNode \"j\")(ConnectorDir \"-\"))(Connector (WordNode \"g\")(ConnectorDir \"-\"))(Connector (WordNode \"t\")(ConnectorDir \"-\"))(Connector (WordNode \"s\")(ConnectorDir \"-\"))(Connector (WordNode \"s\")(ConnectorDir \"-\")))")
yes, this is 0R23 so wtf...
Huh. mpg_parse:
(cog-rocks-get "i@0R23:Section") ... also missing...
(cog-rocks-get "a@sQ23") is the expected secion.
(cog-rocks-get "l@ returns 0R23 as expcected... so wtf.
How about no-margs... also missing there...
(cog-rocks-get "l@(Section (WordNode \"t\")(ConnectorSeq (Connector (WordNode \"###LEFT-WALL###\")(ConnectorDir \"-\"))(Connector (WordNode \"j\")(ConnectorDir \"-\"))(Connector (WordNode \"g\")(ConnectorDir \"-\"))(Connector (WordNode \"t\")(ConnectorDir \"-\"))(Connector (WordNode \"s\")(ConnectorDir \"-\"))(Connector (WordNode \"s\")(ConnectorDir \"-\"))))")
gives sQ23 exactly as expected. ...
Conclude: dj parsing fails to write the sections correctly ... why?
How? WTF???
/data/expt-3/bad-again/mpg_parse-no-margs.rdb
Next aid: 870677
Atoms/Links/Nodes a@: 870676 l@: 870624 n@: 34
Keys/Incoming/Hash k@: 476041 i@: 395182 h@: 0
Mising sid dR92 (ConnectorSeq (Connector (WordNode "c")(ConnectorDir "-"))(Connector (WordNode "p")(ConnectorDir "+"))(Connector (WordNode "c")(ConnectorDir "+"))(Connector (WordNode "j")(ConnectorDir "+"))(Connector (WordNode "t")(ConnectorDir "+")))
Not in incoming for DB (Connector (WordNode "c")(ConnectorDir "-"))
(cog-rocks-get "l@(ConnectorSeq (Connector (WordNode \"c\")(ConnectorDir \"-\"))(Connector (WordNode \"p\")(ConnectorDir \"+\"))(Connector (WordNode \"c\")(ConnectorDir \"+\"))(Connector (WordNode \"j\")(ConnectorDir \"+\"))(Connector (WordNode \"t\")(ConnectorDir \"+\")))")
dR92
OK -- fake_pairs has one bad link ... out of 480
Ahhh!
Mising sid M1 (EvaluationLink (LinkGrammarRelationshipNode "ANY")(ListLink (WordNode "p")(WordNode "d")))
Not in incoming for K1 (ListLink (WordNode "p")(WordNode "d"))
cog-rocks-get "i@K1:")
rkey: >>i@K1:EvaluationLink<< rval: >>G1 <<
(cog-rocks-get "a@G1")
rkey: >>a@G1<< rval: >>(EvaluationLink (LinkGrammarRelationshipNode "ANY")(ListLink (WordNode "p")(WordNode "d")))<<
... M1 and G1 are the same... Ooops!
Hypoth:
two threads writing, neither thread finds l@ or n@ so start a new one.
200 looks it up.
235 writes it.
17008
expt-3/bad-again/mpg_parse-no-margs.rdb
has
Next aid: 870677
Atoms/Links/Nodes a@: 870676 l@: 870624 n@: 34
Keys/Incoming/Hash k@: 476041 i@: 395182 h@: 0
Same M1/G1 from above and three more... total of 4
expt-3/bad-again/mpg_parse.rdb (with marginals) has
----------
Try again:
stock rocksdb-5.17 from ubuntu focal
mounted on ssd
djgeneration is now:
OLD speed:
MPG-Processing file >>>corpus-7.txt<<<
Sent out article in 259 seconds
MPG-Processing file >>>corpus-11.txt<<<
Sent out article in 648 seconds
MPG-Processing file >>>corpus-12.txt<<<
Sent out article in 1134 seconds
MPG-Processing file >>>corpus-10.txt<<<
Sent out article in 1185 seconds
MPG-Processing file >>>corpus-8.txt<<<
Sent out article in 916 seconds
MPG-Processing file >>>corpus-9.txt<<<
Sent out article in 1218 seconds
real 90m16.308s
NEW speed:
MPG-Processing file >>>corpus-7.txt<<<
Sent out article in 257 seconds
MPG-Processing file >>>corpus-11.txt<<<
Sent out article in 502 seconds
MPG-Processing file >>>corpus-12.txt<<<
Sent out article in 958 seconds
MPG-Processing file >>>corpus-10.txt<<<
Sent out article in 977 seconds
MPG-Processing file >>>corpus-8.txt<<<
Sent out article in 774 seconds
MPG-Processing file >>>corpus-9.txt<<<
Sent out article in 1020 seconds
real 75m45.906s
real 80m52.774s
-----------
Restarted pair counting from scratch in expt-4
Why is this so slow!???
Splitting and word-pair counting file >>>corpus-7.txt<<<
Sent out article in 1764 seconds
Splitting and word-pair counting file >>>corpus-11.txt<<<
Sent out article in 3788 seconds
Splitting and word-pair counting file >>>corpus-12.txt<<<
Sent out article in 4706 seconds
24GB or RAM at this point running at 680% cpu
$ du -s *
292816 fake_pairs.rdb
guile looks OK.
Something is leaking RAM.
Splitting and word-pair counting file >>>corpus-10.txt<<<
Sent out article in 4025 seconds
Splitting and word-pair counting file >>>corpus-8.txt<<<
Sent out article in 3333 seconds
Splitting and word-pair counting file >>>corpus-9.txt<<<
Sent out article in 3654 seconds
real 359m9.453s
(gc-time-taken . 10549268042307) Yow!!!
(heap-size . 42799104) 43MB
(heap-free-size . 16207872)
(heap-total-allocated . 449802881088) ; Yow! 450GB!!! what the!?
(heap-allocated-since-gc . 2444768)
(protected-objects . 51) (gc-times . 35781))
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12795 ubuntu 20 0 40.5g 37.6g 38708 S 0.3 14.9 2370:57 guile
Total of 445 atoms in atomspace ...
djparsing: Same as "NEW speed", above.
real 78m48.721s
$ du -s *
728 fake_pairs.rdb
532628 mpg_parse.rdb
disjunct marginals:
(define pca (make-pseudo-cset-api))
(define psa (add-pair-stars pca))
(define btr (batch-transpose psa))
(psa 'fetch-pairs)
Elapsed time to load csets: 54 secs
((add-support-compute psa) 'cache-all)
Finished left norm marginals in 176 secs
Finished left totals in 17 secs
Finished right norm marginals in 25 secs
Finished right totals in 0 secs
piss-ant slow as before:
(btr 'mmt-marginals)
Stored 240000 of 370186 left-wilds in 321 secs (125 pairs/sec)
Stored 280000 of 370186 left-wilds in 366 secs (109 pairs/sec)
Stored 320000 of 370186 left-wilds in 423 secs (95 pairs/sec)
Done storing 370186 left-wilds in 2511 secs
--------------
expt-5 is the postgres version
apt install postgresql-client postgresql pgtop libpq-dev
Do NOT do these opts in /etc/postgresql/12/main
effective_cache_size = 60GB
seq_page_cost = 0.1
random_page_cost = 0.1
checkpoint_completion_target = 0.9
effective_io_concurrency = 100
max_worker_processes = 24
Throw to key `C++-EXCEPTION' with args `("sql-create" "Failed to execute SQL command!\nPQresult message: ERROR: database \"foo\" already exists\n\nPQ query was: CREATE DATABASE foo; (/home/ubuntu/src/atomspace/opencog/persist/sql/multi-driver/ll-pg-cxx.cc:130)\nFunction args:\n(postgres:///foo)")'.
Throw to key `C++-EXCEPTION' with args `("sql-create" "Cannot connect to database: FATAL: database \"foo\" does not exist\n (/home/ubuntu/src/atomspace/opencog/persist/sql/multi-driver/ll-pg-cxx.cc:54)\nFunction args:\n(postgres:///foo)")'
postgres:///fake_pairs
(use-modules (opencog) (opencog persist) (opencog persist-sql))
(sql-create "postgres:///fake_pairs")
Splitting and word-pair counting file >>>corpus-7.txt<<<
Sent out article in 1707 seconds
Splitting and word-pair counting file >>>corpus-11.txt<<<
Sent out article in 3007 seconds
Splitting and word-pair counting file >>>corpus-12.txt<<<
Sent out article in 3455 seconds
Splitting and word-pair counting file >>>corpus-10.txt<<<
Sent out article in 3196 seconds
Splitting and word-pair counting file >>>corpus-8.txt<<<
Sent out article in 2479 seconds
Splitting and word-pair counting file >>>corpus-9.txt<<<
Sent out article in 2738 seconds
real 279m53.779s
Much faster than the rocksDB version but still stunningly slow...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23108 ubuntu 20 0 39.1g 37.3g 30760 S 0.0 14.8 1958:42 guile
Total of 445 atoms in atomspace ...
(gc-stats)
((gc-time-taken . 7407763599459) ;; 7407 seconds=2 hours whoa
(heap-size . 33619968) (heap-free-size . 13774848)
(heap-total-allocated . 449690164592) 450 GBytes just like rocks version
(heap-allocated-since-gc . 6156032)
(protected-objects . 51) (gc-times . 29863))
OK, so mem explosion was a link-grammar init-table bug.
https://github.com/opencog/link-grammar/pull/1149
Also tweaked postgress config:
Splitting and word-pair counting file >>>corpus-7.txt<<<
Sent out article in 1466 seconds
Splitting and word-pair counting file >>>corpus-11.txt<<<
Sent out article in 2996 seconds
after parsing 96044 sentences --
((gc-time-taken . 3341717491309) <<< 3341 seconds ouch!
(heap-size . 33153024) (heap-free-size . 18305024)
(gc-times . 19226)) << so one gc every 4.995 sentences ...
is this hard-coded somewhere?
`sometimes-gc` and `maybe-gc
(report-avg-gc-cpu-time)
Elapsed: 5544.8 secs. Rate: 213.7 gc/min %cpu-GC: 63.66% %cpu-use: 696.6%
=============================
currrent status postgres word pair counting:
... real 279m2.812s == 16743 secs wall clock
total of 290676 sentences so: 17.36 sentences/second
cputime= 1896:14 = 113775 secs so 6.8 threads avg.
cpu processing is 2.55 sents per cpu sec.
(gc-time-taken . 8468975661196) = 8468 secs = 7.4% in gc ...
(gc-times . 32526)) = 8.9 sentences per gc
(heap-total-allocated . 449898824256) = 450GB = 1.5MB/sentence
vs same dataset, RocksDB:
... real 313m46.959s = 18827 secs wall clock
total of 290676 sentences so: 15.4 sentences/second
cputime= 2098:46 = 125946 secs so 6.7 threads avg
cpu processing is 2.3 sents per cpu-sec
(gc-time-taken . 9867992214539) = 9868 secs = 7.8% in gc
(gc-times . 64144) = 4.5 sentences per gc
(heap-total-allocated . 449155740720) = 449GB = 1.5MB/sentence
why so much??
-----------
disjunct counting ...
cogserver is nearly idle...
MPG-Processing file >>>corpus-7.txt<<<
Can't connect to port 18108!
Seems to be waiting on postgres, which is waiting on disk,
because rocks in another process is hogging the disk bandwidth!?
This is the non-optimized postgres...
MPG-Processing file >>>corpus-7.txt<<<
Sent out article in 851 seconds
MPG-Processing file >>>corpus-11.txt<<<
Sent out article in 1485 seconds
MPG-Processing file >>>corpus-12.txt<<<
Sent out article in 1513 seconds
MPG-Processing file >>>corpus-10.txt<<<
Sent out article in 1141 seconds
MPG-Processing file >>>corpus-8.txt<<<
Sent out article in 876 seconds
MPG-Processing file >>>corpus-9.txt<<<
Sent out article in 1004 seconds
real 115m55.803s (this is the non-optimized postgres)
DB activity: 587 tps, 0 rollbs/s, 6 buffer r/s, 99 hit%, 941 row r/s, 47
DB activity: 638 tps, 0 rollbs/s, 5 buffer r/s, 99 hit%, 1132 row r/s, 613 row w/s
DB activity: 675 tps, 0 rollbs/s, 4 buffer r/s, 99 hit%, 1275 row r/s, 683 row w/s
DB I/O: 0 reads/s, 0 KB/s, 1169 writes/s, 5101 KB/s
Total DISK READ: 0.00 B/s | Total DISK WRITE: 2.55 M/s
Current DISK READ: 0.00 B/s | Current DISK WRITE: 2.53 M/s
Why is pg_top reporting twice the rate of iotop? Is this an mdraid thing?
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
11723 postgres 20 0 217M 12M sleep 0:04 4.21% 8.74% postgres: 12/mai
11720 postgres 20 0 217M 12M sleep 0:09 5.48% 8.54% postgres: 12/mai
11727 postgres 20 0 217M 12M sleep 0:09 6.37% 8.34% postgres: 12/mai
11728 postgres 20 0 217M 12M run 0:07 4.63% 8.34% postgres: 12/mai
11722 postgres 20 0 217M 12M sleep 0:09 5.07% 6.95% postgres: 12/mai
11729 postgres 20 0 217M 12M sleep 0:03 3.44% 5.36% postgres: 12/mai
11732 postgres 20 0 218M 16M sleep 0:09 4.77% 0.79% postgres: 12/mai
24851 postgres 20 0 215M 6144K sleep 0:30 0.06% 0.00% postgres: 12/mai
11725 postgres 20 0 217M 12M sleep 0:08 4.22% 0.00% postgres: 12/mai
((PredicateNode . 15) (ListLink . 240) (AnyNode . 2) (Connector . 29) (ConnectorDir . 2) (ConnectorSeq . 371468) (Section . 466340) (EvaluationLink . 240)
(TypeNode . 1) (AnchorNode . 1) (SchemaNode . 1) (PostgresStorageNode . 1) (WordNode . 15) (LinkGrammarRelationshipNode . 1))
(psa 'fetch-pairs)
Elapsed time to load csets: 65 secs
((add-support-compute psa) 'cache-all)
(btr 'mmt-marginals)
Done storing 371468 left-wilds in 1567 secs
Done storing 371515 left-wilds in 1722 secs
OK, so that's faster than RocksDB, which took 2511 secs
rocks started out faster, then really slowed down...
Why?
.... why? update: the incoming set. After redesign, rocks is faster.
Also, why is the number different?
(define rpt-obj (add-report-api psa))
(define size (rpt-obj 'num-pairs))
(define size (rpt-obj 'left-dim))
(define dim-key (PredicateNode "*-Dimension Key-*"))
(define wild-atom (psa 'wild-wild))
(define (get-left-dim)
(inexact->exact (round
(cog-value-ref (cog-value wild-atom dim-key) 0))))
support stuff was not stored ...!? Why?
((add-support-compute psa) 'cache-all)
fails to compute the dim key
well, OK, central-compute is needed for that...
(define size (rpt-obj 'num-pairs)) same as (psu 'total-support-left
or total-support-right
(define nrows (rpt-obj 'left-dim))
same as (psa 'left-basis-size)
(define ncols (rpt-obj 'right-dim))
-----
expt-6 valgrind
corpus-3.txt
==29958== definitely lost: 3,151,147 bytes in 67 blocks
==29958== indirectly lost: 310 bytes in 10 blocks
==29958== possibly lost: 139,792 bytes in 26 blocks
==29958== by 0x120C2218: init_table (count.c:216)
==29958== by 0x120C2218: alloc_count_context (count.c:1333)
==29958== by 0x120C4EDB: classic_parse (parse.c:417)
==29958== by 0x1209EBFF: sentence_parse (api.c:698)
==29958== by 0x12065C49: opencog::LGParseLink::execute(opencog::AtomSpace*, bool) (LGParseLink.cc:173)
corpus-4.txt
==25891== definitely lost: 14,753,451 bytes in 242 blocks
==25891== indirectly lost: 3,434,581 bytes in 289 blocks
==25891== possibly lost: 1,188,368 bytes in 34 blocks
140 is ulimit
557
848
1865 -> 1185
OK, so 5481 sents in real 5m43.822s
so 16 sents/second
But only 1017 thread frees...!?
with valgrind ... stopped at 1017 thread frees ...
Ohh duhh bad code.
OK, so 5481 sents in real 3m24.520s = 204 secs
so 27 sents/sec thats better.
and ram looks good but gc-time-taken=115 secs so wow too much.
(gc-times . 1342) maybe its too much
OK fixed the leak, it seems:
Again: with rocks:
Splitting and word-pair counting file >>>corpus-7.txt<<<
Sent out article in 1938 seconds
Splitting and word-pair counting file >>>corpus-11.txt<<<
Sent out article in 4147 seconds
((gc-time-taken . 2683799849797)
(heap-size . 22302720)
(gc-times . 14410))
at 90686 sentences parsed... so one gc every 6.3 sentences
Elapsed: 6474.5 secs. Rate: 134.7 gc/min %cpu-GC: 41.82% %cpu-use: 573.7%
vast amounts of gc because vast amounts of heap... who is using this?
--------------------------------------
expt-8
(define pca (make-pseudo-cset-api))
(define psa (add-pair-stars pca))
(psa 'fetch-pairs)
(psa 'left-basis)
(psa 'right-stars (WordNode "mouse"))
dog cat mouse bird squirrel:
the- or (the- & chased+ & the+) or (the- & saw+ & the+)
the: LEFT-WALL- & (cat+ or squirrel or mouse+ or bird+ or dog+)
saw chased: (bird- or cat- or ...) & the+;
~/src/learn/run/4*/run-gram-cogserver.sh
(gram-classify-greedy-discrim 0.5 4)
(cog-get-atoms 'WordClassNode)
(cog-get-root (WordClassNode "squirrel dog"))
(cog-get-root (WordClassNode "saw chased"))
(star-obj 'right-stars (Word "saw"))
(star-obj 'right-duals (Word "saw"))
saw chased:
(gram-classify-greedy-fuzz 0.65 0.3 4)
/usr/local/share/guile/3.0
[GenericShell] evaluator error:
ice-9/boot-9.scm:
(quit-exception?
(apply throw 'quit args))
_evaluator->eval_error()
_caught_error
_error_string
scm_primitive_exit(0) foo
get_quit_exception
scm_exit_status
_wait_done.notify_all();
restore_output
termios
libguile/posix.c:
~/src/learn/run/4*/run-gram-cogserver.sh
duude if=2502
duude of=5
duude cf=bf
duude lf=8a3b must mst set ISIG ICANON ECHO
duude if=22402 must set ICRNL IXON IUTF8
duude of=5
duude cf=277
duude lf=105073
duude if=42400
------------------