Skip to content

Commit db9c300

Browse files
committed
testcase assignment error
1 parent 17050be commit db9c300

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

jsrc/ct.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,13 @@ ASSERT(0,EVNONCE)
740740
break;}
741741
case 14: { // threadpool keepwarm (in sec): set to y, return previous value
742742
#if PYXES
743+
#define MAXLINGER 0.1 // maximum time we will allow for lingering
743744
ASSERT(AR(w)==1,EVRANK) ASSERT(AN(w)==2,EVLENGTH) // arg is threadpool# keepwarm
744745
if(AT(w)!=FL)RZ(w=cvt(FL,w)); // make arg float type
745746
D dpoolno=DAV(w)[0]; I poolno=(I)dpoolno; ASSERT((D)poolno==dpoolno,EVDOMAIN) ASSERT(BETWEENO(poolno,0,MAXTHREADPOOLS),EVLIMIT) // extract threadpool# and audit it
746747
JOBQ *jobq=&(*JT(jt,jobqueue))[poolno];
747748
D oldval=jobq->keepwarmns*1e-9;
748-
D kwtime=DAV(w)[1]; ASSERT(kwtime>=0,EVDOMAIN); if(kwtime>0.003)kwtime=0.003; I kwtimens=(I)(kwtime*1000000000); // limit time to 3ms and convert to ns
749+
D kwtime=DAV(w)[1]; ASSERT(kwtime>=0,EVDOMAIN); if(unlikely(kwtime>MAXLINGER))kwtime=MAXLINGER; I kwtimens=(I)(kwtime*1000000000); // limit time and convert to ns
749750
jobq->keepwarmns=kwtimens; // store new value
750751
z=scf(oldval); // return old value
751752
#else

jsrc/vfrom.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ static unsigned char jtmvmsparsex(J jt,void* const ctx,UI4 ti){
781781
COLLPE
782782
}else{
783783
// here for sparse dot-product.
784-
colx-=n; // the offset into A starts after the identity prefix
784+
// obsolete colx-=n; // the offset into A starts after the identity prefix
785785
// look up column info, get A values and row numbers
786786
I an=axv[colx][1]; // number of sparse atoms in each row
787787
D *vv=avv0+axv[colx][0]; // pointer to values for this section of A
@@ -873,7 +873,7 @@ static unsigned char jtmvmsparsex(J jt,void* const ctx,UI4 ti){
873873
if(bv==0){ // one product, or Dpiv
874874
if(zv)break; // if just one product, skip the setup for next column
875875
// here for Dpiv. bestrow+1 is the # pivots found; we add/sub/store that in the Dpiv block based on 'prirow'
876-
exlist[colx]=exlist[colx]*!!prirow+bestrow*(prirow|1); // add/sub/init Dpiv value. Only one thread ever touches a column
876+
exlist[*ndx]=exlist[*ndx]*!!prirow+bestrow*(prirow|1); // add/sub/init Dpiv value. Only one thread ever touches a column
877877
}else if(exlist==0){ // looking for nonimproving pivots?
878878
// not looking for nonimproving pivots. Do a normal pivot-pick
879879
// column ran to completion. Detect unbounded
@@ -1052,15 +1052,15 @@ F1(jtmvmsparse){PROLOG(832);
10521052
bv=zv=0;
10531053
exlist=IAV(C(AAV(w)[9])); // remember address of exclusions
10541054
ASSERT(AR(C(AAV(w)[9]))==1,EVRANK); ASSERT(ISDENSETYPE(AT(C(AAV(w)[9])),INT),EVDOMAIN); // must be integer list
1055-
ASSERT(AN(C(AAV(w)[9]))==AS(C(AAV(w)[2]))[0]+AS(C(AAV(w)[4]))[0],EVLENGTH); // length of Dpiv is #cols of A + #rows of A (=M)
1055+
ASSERT(AN(C(AAV(w)[9]))==AS(C(AAV(w)[1]))[0]+AS(C(AAV(w)[4]))[0],EVLENGTH); // length of Dpiv is #cols of A + #rows of A (=M)
10561056
z=mtv; // no error is possible; use harmless return value
10571057
}
10581058
}
10591059

10601060

10611061
#define YC(n) .n=n,
10621062
struct mvmctx opctx={.ctxlock=0,.abortcolandrow=-1,.bestcolandrow={-1,-1},YC(ndxa)YC(n)YC(minimp)YC(bv)YC(thresh)YC(bestcol)YC(bestcolrow)YC(zv)YC(Frow)YC(nfreecolsd)
1063-
YC(ncolsd)YC(impfac)YC(prirow)YC(bvgrd0)YC(bvgrde)YC(exlist)YC(nexlist)YC(yk)YC(bkmin).axv=(I(*)[2])IAV(C(AAV(w)[1])),.amv0=IAV(C(AAV(w)[2])),.avv0=DAV(C(AAV(w)[3])),.mv0=DAV(C(AAV(w)[4])),
1063+
YC(ncolsd)YC(impfac)YC(prirow)YC(bvgrd0)YC(bvgrde)YC(exlist)YC(nexlist)YC(yk)YC(bkmin).axv=((I(*)[2])IAV(C(AAV(w)[1])))-n,.amv0=IAV(C(AAV(w)[2])),.avv0=DAV(C(AAV(w)[3])),.mv0=DAV(C(AAV(w)[4])),
10641064
.ndotprods=0,.ncolsproc=0,.taskmask=0};
10651065
#undef YC
10661066

test/g520.ijs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ assert. 3 0 0 4 11 0 -: (128!:9) 1 2 3 0;(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;bk
130130

131131
NB. Dpiv
132132
M=. |: _4 ]\ _1. 0 2 3 0 2 3 4 2 3 4 5 3 4 5 6 NB.
133-
Dpiv=. (#M) $ _1
133+
Dpiv=. (1+#M) $ _1
134134
assert. '' -: 128!:9 (0 1 2);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 1 2;1.0 0 0 0 0 0 0;'';'';Dpiv NB. init
135-
assert Dpiv -: 1 2 3 _1
135+
assert Dpiv -: 1 2 3 _1 _1
136136
assert. '' -: 128!:9 (1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;1 2 3;2.5 0 0 0 0 0 1;'';'';Dpiv NB. add
137-
assert Dpiv -: 1 4 6 2
138-
assert. '' -: 128!:9 (0 1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 3;2.5 0 0 0 0 0 _1;'';'';Dpiv NB. add
139-
assert Dpiv -: 0 3 5 0
137+
assert Dpiv -: 1 4 6 2 _1
138+
assert. '' -: 128!:9 (0 1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 3;2.5 0 0 0 0 0 _1;'';'';Dpiv NB. sub
140139

141140
NB. Repeat multithreaded
142141
bxr =. </.~ 0 1 $~ $ NB. 2 threads
@@ -223,13 +222,13 @@ assert. 3 0 0 4 11 0 mt3 128!:9 (bxr 1 2 3 0);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0)
223222

224223
NB. Dpiv
225224
M=. |: _4 ]\ _1. 0 2 3 0 2 3 4 2 3 4 5 3 4 5 6 NB.
226-
Dpiv=. (#M) $ _1
225+
Dpiv=. (1+#M) $ _1
227226
assert. '' -: 128!:9 (bxr 0 1 2);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 1 2;1.0 0 0 0 0 0 0;'';'';Dpiv NB. init
228-
assert Dpiv -: 1 2 3 _1
227+
assert Dpiv -: 1 2 3 _1 _1
229228
assert. '' -: 128!:9 (bxr 1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;1 2 3;2.5 0 0 0 0 0 1;'';'';Dpiv NB. add
230-
assert Dpiv -: 1 4 6 2
231-
assert. '' -: 128!:9 (bxr 0 1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 3;2.5 0 0 0 0 0 _1;'';'';Dpiv NB. add
232-
assert Dpiv -: 0 3 5 0
229+
assert Dpiv -: 1 4 6 2 _1
230+
assert. '' -: 128!:9 (bxr 0 1 2 3);(,."1 (_2) ]\ 00 0);(0$00);(0$0.0);M;0 3;2.5 0 0 0 0 0 _1;'';'';Dpiv NB. sub
231+
assert Dpiv -: 0 3 5 0 _1
233232

234233

235234
delth'' NB. make sure we end with an empty system

test/gspi.ijs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ d=: df s=: 0(2)}$. i.5
167167
(s i. 0) -: d i. 0
168168
(s i: 0) -: d i: 0
169169

170-
s =. $.,1
171-
s =. 0 (0}) s
170+
s =: $.,1
171+
s =: 0 (0}) s
172172
1 = s i. 1
173173
1 = (8 $. s) i. 1
174174

0 commit comments

Comments
 (0)