Changeset: d413166f0ea0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d413166f0ea0 Added Files: monetdb5/extras/rapi/Tests/rapi03.stable.err monetdb5/extras/rapi/Tests/rapi03.stable.out Modified Files: monetdb5/extras/rapi/rapi.c Branch: RIntegration Log Message:
Avoid double use of iterator diffs (140 lines): diff --git a/monetdb5/extras/rapi/Tests/rapi03.stable.err b/monetdb5/extras/rapi/Tests/rapi03.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/extras/rapi/Tests/rapi03.stable.err @@ -0,0 +1,29 @@ +stderr of test 'rapi03` in directory 'monetdb5/extras/rapi` itself: + + +# 20:25:27 > +# 20:25:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=39906" "--set" "mapi_usock=/var/tmp/mtest-27475/.s.monetdb.39906" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi" "rapi03.mal" +# 20:25:27 > + +# builtin opt gdk_dbpath = /export/scratch1/mk/rapi//Linux/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = yes +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 39906 +# cmdline opt mapi_usock = /var/tmp/mtest-27475/.s.monetdb.39906 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi + +# 20:25:27 > +# 20:25:27 > "Done." +# 20:25:27 > + diff --git a/monetdb5/extras/rapi/Tests/rapi03.stable.out b/monetdb5/extras/rapi/Tests/rapi03.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/extras/rapi/Tests/rapi03.stable.out @@ -0,0 +1,75 @@ +stdout of test 'rapi03` in directory 'monetdb5/extras/rapi` itself: + + +# 20:25:27 > +# 20:25:27 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=39906" "--set" "mapi_usock=/var/tmp/mtest-27475/.s.monetdb.39906" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/export/scratch1/mk/rapi//Linux/var/MonetDB/mTests_monetdb5_extras_rapi" "rapi03.mal" +# 20:25:27 > + +# MonetDB 5 server v11.16.0 +# This is an unreleased version +# Serving database 'mTests_monetdb5_extras_rapi', using 8 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 15.591 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://vienna.ins.cwi.nl:39906/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-27475/.s.monetdb.39906 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded +function user.main():void; +# Hannes Muehleisen example + b := bat.new(:oid,:int); + bat.append(b,1804289383); + bat.append(b,846930886); + bat.append(b,1681692777); + bat.append(b,1714636915); + bat.append(b,1957747793); + bat.append(b,424238335); + bat.append(b,719885386); + bat.append(b,1649760492); + bat.append(b,596516649); + bat.append(b,1189641421); + io.print(b); + (t:bat[:oid,:dbl] ,s:bat[:oid,:dbl] ) := rapi.eval("someval2 <- Re(fft(arg2)); print(someval2); return(data.frame(someval2,someval2));",b); + io.print(t,s); +end main; +#--------------------------# +# h t # name +# void int # type +#--------------------------# +[ 0@0, 1804289383 ] +[ 1@0, 846930886 ] +[ 2@0, 1681692777 ] +[ 3@0, 1714636915 ] +[ 4@0, 1957747793 ] +[ 5@0, 424238335 ] +[ 6@0, 719885386 ] +[ 7@0, 1649760492 ] +[ 8@0, 596516649 ] +[ 9@0, 1189641421 ] +# User R expression: someval2 <- Re(fft(arg2)); print(someval2); return(data.frame(someval2,someval2)); +# Executed R expression ret <- as.data.frame((function(arg2){someval2 <- Re(fft(arg2)); print(someval2); return(data.frame(someval2,someval2));})(arg2),nm=NA,stringsAsFactors=F) + +# [1]# 12585340037# 525771363# -879667492# 2456894288# 158316769# 934923939# +# [7]# 158316769# 2456894288# -879667492# 525771363# +#--------------------------# +# h t t # name +# void dbl dbl # type +#--------------------------# +[ 0@0, 12585340037, 12585340037 ] +[ 1@0, 525771362.90836447, 525771362.90836447 ] +[ 2@0, -879667492.32359219, -879667492.32359219 ] +[ 3@0, 2456894287.5916357, 2456894287.5916357 ] +[ 4@0, 158316768.82359338, 158316768.82359338 ] +[ 5@0, 934923939, 934923939 ] +[ 6@0, 158316768.82359338, 158316768.82359338 ] +[ 7@0, 2456894287.5916352, 2456894287.5916352 ] +[ 8@0, -879667492.32359219, -879667492.32359219 ] +[ 9@0, 525771362.90836453, 525771362.90836453 ] + +# 20:25:27 > +# 20:25:27 > "Done." +# 20:25:27 > + diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c --- a/monetdb5/extras/rapi/rapi.c +++ b/monetdb5/extras/rapi/rapi.c @@ -55,10 +55,10 @@ BATseqbase(b, 0); b->T->nil = 0; b->T->nonil = 1; b->tkey = 0;\ b->tsorted = 1; b->trevsorted = 1; b->tdense = 1;\ p = (tpe*) Tloc(b, BUNfirst(b));\ - for( i =0; i< (int) cnt; i++, p++){\ - *p = (tpe) access_fun(ret_col)[i];\ + for( j =0; j< (int) cnt; j++, p++){\ + *p = (tpe) access_fun(ret_col)[j];\ if (na_check){ b->T->nil = 1; b->T->nonil = 0; *p= tpe##_nil;} \ - if (i > 0){ \ + if (j > 0){ \ if ( *p > prev && b->trevsorted){ \ b->trevsorted = 0; \ if (*p != prev +1) b->tdense = 0; \ @@ -106,7 +106,7 @@ str RAPIeval(Client cntxt, MalBlkPtr mb, str exprStr = *(str*) getArgReference(stk, pci, pci->retc); SEXP x, env,retval; ParseStatus status; - int i; + int i,j; char buf[64] = "rapi"; char argnames[1000] = ""; char* rcall; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list