<!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>it works fine from command line.  The echo $? gives a zero, the correct file is produced.<BR>
<BR>
<BR>
It just seems to be the jump from command line to swift that is the snag.<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>
-----Original Message-----<BR>
From: Ben Clifford [<A HREF="mailto:benc@hawaga.org.uk">mailto:benc@hawaga.org.uk</A>]<BR>
Sent: Mon 6/15/2009 11:57 AM<BR>
To: Hodgess, Erin<BR>
Cc: swift-user@ci.uchicago.edu<BR>
Subject: Re: [Swift-user] still having problems<BR>
<BR>
<BR>
based on previous messages, its still unclear to me that you have the<BR>
program working outside of Swift.<BR>
<BR>
Pretty much you need to be able to run rInvoke perm.short.R 0 from the<BR>
commandline successfully before attempting to run that command inside<BR>
Swift.<BR>
<BR>
On Mon, 15 Jun 2009, 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 /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," ")[[1]][1]))<BR>
> #     startrpermrow <- as.numeric(noquote(strsplit(allinputs," ")[[1]][1]))<BR>
>       startrpermrow <- 1<BR>
>       endpermrow <- permlength + startrpermrow<BR>
>       debug = 1<BR>
>       if (debug == 1) {<BR>
>               print(paste("start", startrpermrow, "end", endpermrow, 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,], permvec, lag.max = 6, type = c("correlation"), na.action=na.pass, plot = 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] = speechperm_ccf$acf[1:13]<BR>
>                       }<BR>
>               speechperm_ccf <- as.matrix(data.frame(speechperm_ccf$acf, speechperm_ccf$lag))[7:13,]<BR>
>               speechperm_cor <- 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=""), 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>
</FONT>
</P>

</BODY>
</HTML>