Hi Jonathan,

Thank you for your answer.

When input is specified as data.csv it runs fine, but it's not doing what's
expected (i.e sampling over the three input files in the data repo).

So I modified the CARETask as explained before, and also the R script to
read the second argument
n <- as.character(args[2])
use it as the data file name
data <- read.csv(n, header=T, sep=",")
and repackaged with care.

But I get an error (see attached file) when I try to run it on openmole.

Hélène

2017-06-29 16:57 GMT+02:00 Jonathan Passerat-Palmbach <
[email protected]>:

> Hi Helene,
>
> In this case it seems the csv file is hardcoded in the R script:
>
> https://github.com/openmole/openmole-market/blob/7-dev/R-hello/test.R
>
> it's always reading from "data.csv" regardless of the second command line
> argument
>
> you can either update the R script and repackage or make sure `input` get
> written as "data.csv" in the CARETask
>
> ...
>
>     inputFiles += (input, "data.csv"),
>
> ...
>
>
> Cheers
>
> J
>
> On 29/06/17 14:51, Hélène Arduin wrote:
>
> Hi,
>
> I've been trying to run the Hello World in R
> <http://www.openmole.org/Documentation_Market%20Place_R.html> example,
> since I think it's supposed to do what I want my own code to do, but it's
> not working well.
>
> First I had to repackage the R code to produce a .tgz.bin archive, the
> .bin doesn't work even when I try to repackage it (seg fault).
>
> With the .tgz.bin archive, the RFiles.oms is executed and I get result
> files.
> From what I understand, the R code should be run with each of the
> three data files of the "data" repo as input, however it is always run with
> the data.csv input. Only the names of the three data files are used to name
> the result files (data1_1.csv ; data1_2.csv ; data2_1.csv etc), but not the
> actual data inside.
> Is this the expected behavior?
>
> I've tried to modify the RFiles.oms (see below) in order to vary the input
> files and read each of the three files from the "data" repo but it's not a
> success...
>
> // R task
> val rTask =
>   CARETask(workDirectory / "care.tgz.bin", "R --slave -f test.R --args
> ${i} *${n}*") set (
>     i := 42,
>     (inputs, outputs) += (i, n),
>     inputFiles += (input, "*${n}*"),
>     outputFiles += ("results.csv", output)
>   )
>
> (I've also modified accordingly the test.R file and repackaged
> care.tgz.bin.)
>
> Does anyone have an idea of how to read different input files on each
> iteration of the model?
>
> Thanks!
>
> Hélène
>
>
> _______________________________________________
> OpenMOLE-users mailing 
> [email protected]http://fedex.iscpif.fr/mailman/listinfo/openmole-users
>
>
> --
> Jonathan Passerat-Palmbach, PhD
> Research Associate
> Department of Computing
> Imperial College London
>
> South Kensington Campus
> Huxley Building - room 344
> 180 Queen's Gate
> London SW7 2AZ
> https://jopasser.at
>
>
> _______________________________________________
> OpenMOLE-users mailing list
> [email protected]
> http://fedex.iscpif.fr/mailman/listinfo/openmole-users
>
>
org.openmole.core.exception.InternalProcessingError: Error for context values 
in org.openmole.core.workflow.tools.InputOutputCheck$@ad86e01 {i=10, 
input=/home/helene_arduin/.openmole/bfitou/webui/projects/HelloWorldInR/data/data2.csv,
 n=data2.csv, openmole$seed=-947193959791230134}
        at 
org.openmole.core.workflow.tools.InputOutputCheck$$anonfun$perform$2.apply(InputOutputCheck.scala:90)
        at 
org.openmole.core.workflow.tools.InputOutputCheck$$anonfun$perform$2.apply(InputOutputCheck.scala:80)
        at 
org.openmole.core.expansion.FromContext$$anon$8.from(FromContext.scala:133)
        at org.openmole.core.workflow.task.Task$class.perform(Task.scala:60)
        at org.openmole.plugin.task.care.CARETask.perform(CARETask.scala:71)
        at org.openmole.core.workflow.job.MoleJob.perform(MoleJob.scala:101)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor$$anonfun$1$$anonfun$apply$1.apply(LocalExecutor.scala:89)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor$$anonfun$1$$anonfun$apply$1.apply(LocalExecutor.scala:73)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor$$anonfun$1.apply(LocalExecutor.scala:73)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor$$anonfun$1.apply(LocalExecutor.scala:70)
        at 
org.openmole.core.output.OutputManager$.withStreamOutputs(OutputManager.scala:115)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor.withRedirectedOutput(LocalExecutor.scala:140)
        at 
org.openmole.core.workflow.execution.local.LocalExecutor.run(LocalExecutor.scala:70)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.openmole.core.exception.InternalProcessingError: Error executing 
command:
./re-execute.sh R --slave -f test.R --args 10 data2.csv, return code was not 0 
but 1
        at org.openmole.plugin.task.systemexec.package$.error(package.scala:258)
        at 
org.openmole.plugin.task.systemexec.package$.execute(package.scala:239)
        at 
org.openmole.plugin.task.care.CARETask$$anonfun$process$1$$anonfun$apply$2.apply(CARETask.scala:177)
        at 
org.openmole.plugin.task.care.CARETask$$anonfun$process$1$$anonfun$apply$2.apply(CARETask.scala:98)
        at 
org.openmole.plugin.task.external.External$.withWorkDir(External.scala:68)
        at 
org.openmole.plugin.task.care.CARETask$$anonfun$process$1.apply(CARETask.scala:98)
        at 
org.openmole.plugin.task.care.CARETask$$anonfun$process$1.apply(CARETask.scala:96)
        at 
org.openmole.core.expansion.FromContext$$anon$7.from(FromContext.scala:127)
        at 
org.openmole.core.workflow.tools.InputOutputCheck$$anonfun$perform$2.apply(InputOutputCheck.scala:87)
        ... 14 more

_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users

Reply via email to