<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Swift-user] still having problems</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I found a still simpler example and made it go.<BR>
<BR>
Now back to perm.short.R<BR>
<BR>
thanks,<BR>
erin<BR>
<BR>
<BR>
Erin M. Hodgess, PhD<BR>
Associate Professor<BR>
Department of Computer and Mathematical Sciences<BR>
University of Houston - Downtown<BR>
mailto: hodgesse@uhd.edu<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Zhao Zhang [<A HREF="mailto:zhaozhang@uchicago.edu">mailto:zhaozhang@uchicago.edu</A>]<BR>
Sent: Mon 6/15/2009 12:01 PM<BR>
To: Hodgess, Erin<BR>
Cc: swift-user@ci.uchicago.edu<BR>
Subject: Re: [Swift-user] still having problems<BR>
<BR>
Hi, Erin<BR>
<BR>
Could you try to run it without swift? Without swift, what does the<BR>
command look like if you invoke "RInvoke" under shell?<BR>
By your swift script, I am assuming RInvoke requires 2 input parameters,<BR>
one for input file, the other one is a Integer parameter.<BR>
What does the output look like? does RInvoke write output to standard<BR>
output, or write to a output file? How do we define the<BR>
output file name before we invoke the script?<BR>
<BR>
zhao<BR>
<BR>
Hodgess, Erin wrote:<BR>
><BR>
> Hi again!<BR>
><BR>
> I have brought things down to the bones here.  Still no luck.<BR>
><BR>
> The files are /home/erin/R-2.9.0/bin/perm.short.R and<BR>
> /home/erin/R-2.9.0/bin/perm4.swift<BR>
><BR>
><BR>
> [erin@tp-login2 bin]$ swift -tc.file tc.data perm4.swift<BR>
> Swift svn swift-r2950 cog-r2406<BR>
><BR>
> RunID: 20090615-1137-nbfujhb2<BR>
> Progress:<BR>
> Progress:  Checking status:1<BR>
> Progress:  Stage in:1<BR>
> Execution failed:<BR>
>         Exception in RInvoke:<BR>
> Arguments: [perm.short.R, 0]<BR>
> Host: localhost<BR>
> Directory: perm4-20090615-1137-nbfujhb2/jobs/v/RInvoke-vti60bcj<BR>
> stderr.txt:<BR>
> stdout.txt:<BR>
> ----<BR>
><BR>
> Caused by:<BR>
>         Exit code 1<BR>
> [erin@tp-login2 bin]$ cat perm4.swift<BR>
> type file{}<BR>
><BR>
> (file procOut) permScript (file script, int batchSize){<BR>
>                 app{<BR>
>                         RInvoke @filename(script) batchSize ;<BR>
>                 }<BR>
>         }<BR>
><BR>
><BR>
><BR>
><BR>
><BR>
><BR>
><BR>
>                 int batchSize=0;<BR>
>                         file script<"perm.short.R">;<BR>
>                         file procOut<"a.txt">;<BR>
>                         procOut=permScript(script, batchSize);<BR>
><BR>
> [erin@tp-login2 bin]$ cat perm.short.R<BR>
>         # -- read data files that are hardcoded per analysis and get<BR>
>         vox_speech_vec <- as.matrix(read.table("origccf.txt"))<BR>
>         pm <- as.matrix(read.table("corr.perm.matrix.txt"))<BR>
>         allinputs <- Sys.getenv("R_SWIFT_ARGS")<BR>
>         print(allinputs)<BR>
>         permlength <-  as.numeric(noquote(strsplit(allinputs,"<BR>
> ")[[1]][1]))<BR>
> #       startrpermrow <- as.numeric(noquote(strsplit(allinputs,"<BR>
> ")[[1]][1]))<BR>
>         startrpermrow <- 1<BR>
>         endpermrow <- permlength + startrpermrow<BR>
>         debug = 1<BR>
>         if (debug == 1) {<BR>
>                 print(paste("start", startrpermrow, "end", endpermrow,<BR>
> sep=","))<BR>
>         }<BR>
>          # rotate across specified rows in permutation matrix<BR>
>         for (rr in startrpermrow:endpermrow){<BR>
>                 permvec = pm[rr,]<BR>
>                 # initialize a 'ccf' matrix for each permutation<BR>
>                 ccf <- matrix(nrow=200, ncol=1)<BR>
>                 mat_row = 0<BR>
>                 for (vox in 1:200) {<BR>
>                         mat_row = mat_row + 1<BR>
>                         speechperm_ccf <- ccf(vox_speech_vec[vox,],<BR>
> permvec, lag.max = 6, type = c("correlation"), na.action=na.pass, plot<BR>
> = FALSE)<BR>
>                         if (any(speechperm_ccf$acf[1:13] == "NaN")) {<BR>
> #                               speechperm_ccf$acf[1:13] = 0<BR>
>                                 speechperm_ccf$acf[1:13] <- rep(0,13)<BR>
>                                 } else {<BR>
>                                 speechperm_ccf$acf[1:13] =<BR>
> speechperm_ccf$acf[1:13]<BR>
>                         }<BR>
>                 speechperm_ccf <-<BR>
> as.matrix(data.frame(speechperm_ccf$acf, speechperm_ccf$lag))[7:13,]<BR>
>                 speechperm_cor <-<BR>
> speechperm_ccf[which.max(speechperm_ccf[,1]),]<BR>
>                 ccf[mat_row, ] <- c(speechperm_cor[[1]])<BR>
>                 }<BR>
>                 write.table (ccf, file=paste("a.txt",sep=""),<BR>
> row.names=FALSE, col.names=FALSE)<BR>
>                 if (debug == 1) {<BR>
>                         print(paste("permrow finished", rr, sep=","))<BR>
>                         print(date())<BR>
>                 }<BR>
>                 rm(ccf)<BR>
>         }<BR>
> [erin@tp-login2 bin]$<BR>
><BR>
> Any help appreciated.<BR>
><BR>
><BR>
><BR>
><BR>
> Erin M. Hodgess, PhD<BR>
> Associate Professor<BR>
> Department of Computer and Mathematical Sciences<BR>
> University of Houston - Downtown<BR>
> mailto: hodgesse@uhd.edu<BR>
><BR>
> ------------------------------------------------------------------------<BR>
><BR>
> _______________________________________________<BR>
> Swift-user mailing list<BR>
> Swift-user@ci.uchicago.edu<BR>
> <A HREF="http://mail.ci.uchicago.edu/mailman/listinfo/swift-user">http://mail.ci.uchicago.edu/mailman/listinfo/swift-user</A><BR>
>  <BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>