Nope, without "Parallel" it still core dump.
Xtian.
______ _ __ __ __ ___ ____ __
/ ____// | / // / / / / | / __ \ / /
/ / __ / |/ // / / / / /| | / /_/ // /
/ /_/ // /| // /_/ / / ___ | / ____// /___
\____//_/ |_/ \____/ /_/ |_|/_/ /_____/
Welcome to GNU APL version 1.4 / 9328
Copyright (C) 2008-2014 Dr. Jürgen Sauermann
Banner by FIGlet: www.figlet.org
This program comes with ABSOLUTELY NO WARRANTY;
for details run: /usr/local/bin/apl --gpl.
This program is free software, and you are welcome to redistribute it
according to the GNU Public License (GPL) version 3 or later.
⎕syl
SI depth limit (0 = no limit) 0
number of values limit (0 = no limit) 0
total ravel bytes limit (0 = no limit) 0
current SI depth 1
current number of values 29
current total ravel bytes 12288
max. rank for APL values 8
min. ⎕PW 30
max. ⎕PW 1000
min. ⎕PP 1
max. ⎕PP 16
log10(max. ⎕CT) ¯9
max. input line length 2000
max. symbol count 65536
max. shared variable name length 64
max. length of filenames (paths) 4096
max. # of shared variables (obsolete) 64
max. number of APs 16
max. operators per statement 16
largest integer 9200000000000000000
smallest (negative) integer ¯9200000000000000000
largest numeric exponent 308
max. shared variable size (bytes) 65000
CORE_COUNT_WANTED (per ./configure) 0
cores available 1
cores used 1
print length limit (0 = no limit) 0
max. prefix length 60
)load Util
SAVED 2015-03-17 -3:23:11 (GMT-4)
T∆Time←⍳1000
Time 'a←⍳1000000'
Time[4] SYLGet
Time[5] SYLSet
Time[9] →⍬
Time[10] 1
Time[12] 0
Time[13] 1
Time[14] 1
Time[15] 1
Time[19] 1
Time[20] 17 12 51 22 301
Segmentation fault (core dumped)
On 2015-03-17 06:42, Juergen Sauermann wrote:
Hi Xtian,
it looks like you are using the multi-core feature of GNU APL.
As *README-8-parallel* says: *Parallel execution is currently experimental*.
I have seen core dumps like those earlier when multi-core was enabled, but have
not found the reason.
I suspect a bug in the thread synchronization, but I am not sure, The code at
the point where the crash below occurs
looks rather clean, thats why I believe that some other thread is involved,
corrupting the memory of the other
threads. If you find a bug in the *Parallel.hh* / *Parallel.**cc* area then
please let me know.
You can also use the *workspaces/ScalarBenchmark.apl* workspace which uses a
more precise timing
measurement based on the CPU cycle counter. It also crashes at times, but not
so often.
/// Jürgen
On 03/17/2015 02:33 AM, Christian Robert wrote:
)load Util
SAVED 2015-03-17 -3:23:11 (GMT-4)
∇Time[⎕]∇
∇
[0] z←ncpu Time what;⎕io;start;stop;old_cpu;max_cpu;SYLGet;SYLSet
[1] ⍝
[2] ⍝ Define 2 utility functions
[3] ⍝
[4] z←⎕FX 'Z←SYLGet what;⎕io;index' '⎕io←1' 'index←((⊂
what)≡¨⎕SYL[;1])/⍳↑⍴⎕SYL' 'Z←⎕SYL[index;2]'
[5] z←⎕FX 'Z←val SYLSet what;⎕io;index' '⎕io←1' 'index←((⊂
what)≡¨⎕SYL[;1])/⍳↑⍴⎕SYL' 'Z←⎕SYL[index;2]←val'
[6] ⍝
[7] ⍝ Monadic or Diadic call ?
[8] ⍝
[9] →(2=⎕NC 'ncpu')/already_set
[10] ncpu←1 ⍝ Set the default
[11] already_set:
[12] ⎕io←0
[13] old_cpu ← SYLGet 'cores used'
[14] max_cpu ← SYLGet 'cores available'
[15] ncpu ← ncpu ⌊ max_cpu ⍝ No more than available ...
[16] ⍝
[17] ⍝ Execute ...
[18] ⍝
[19] z←ncpu SYLSet 'cores used'
[20] start ← ¯5↑⎕ts
[21] ⍎what
[22] stop ← ¯5↑⎕ts
[23] z←old_cpu SYLSet 'cores used'
[24] ⍝
[25] ⍝ Compute execution time
[26] ⍝
[27] →(stop[0]=start[0])/ok ⍝ same day
[28] stop[0]←stop[0]+1 ⍝ day changed
[29] ok:
[30] start ← 32 24 60 60 1000 ⊥ start
[31] stop ← 32 24 60 60 1000 ⊥ stop
[32] z←(⍕(stop-start)÷1000),' seconds at num core = ',(⍕ncpu),' of ', ⍕max_cpu
∇
Fntb 'Time'
z←ncpu Time what;⎕io;start;stop;old_cpu;max_cpu;SYLGet;SYLSet
⍝
⍝ Define 2 utility functions
⍝
z←⎕FX 'Z←SYLGet what;⎕io;index' '⎕io←1' 'index←((⊂ what)≡¨⎕SYL[;1])/⍳↑⍴⎕SYL'
'Z←⎕SYL[index;2]'
z←⎕FX 'Z←val SYLSet what;⎕io;index' '⎕io←1' 'index←((⊂
what)≡¨⎕SYL[;1])/⍳↑⍴⎕SYL' 'Z←⎕SYL[index;2]←val'
⍝
⍝ Monadic or Diadic call ?
⍝
→(2=⎕NC 'ncpu')/already_set
ncpu←1 ⍝ Set the default
already_set:
⎕io←0
old_cpu ← SYLGet 'cores used'
max_cpu ← SYLGet 'cores available'
ncpu ← ncpu ⌊ max_cpu ⍝ No more than available ...
⍝
⍝ Execute ...
⍝
z←ncpu SYLSet 'cores used'
start ← ¯5↑⎕ts
⍎what
stop ← ¯5↑⎕ts
z←old_cpu SYLSet 'cores used'
⍝
⍝ Compute execution time
⍝
→(stop[0]=start[0])/ok ⍝ same day
stop[0]←stop[0]+1 ⍝ day changed
ok:
start ← 32 24 60 60 1000 ⊥ start
stop ← 32 24 60 60 1000 ⊥ stop
z←(⍕(stop-start)÷1000),' seconds at num core = ',(⍕ncpu),' of ', ⍕max_cpu
T∆Time ← ⍳1000
Time 'a←⍳1000000'
Time[4] SYLGet
Time[5] SYLSet
Time[9] →⍬
Time[10] 1
Time[12] 0
Time[13] 1
Time[14] 6
Time[15] 1
Time[19] 1
Time[20] 16 21 28 46 188
Segmentation fault (core dumped)