Hi,

Still trying to make this work.
I think the problem is that the task is packaged with one file
(data/data1.csv for instance), and so the other two datafiles don't exist
in the CARE archive. I've been trying to use the hostFiles option as
explained here
http://www.openmole.org/Documentation_Language_Tasks_Native.html#Usinglocalresources
but
no success.
Is this option still valid in openmole? Is the argument the path of the
file ("data/data1.csv"), or the path to the repo containing the file
("data/")?

Any help much appreciated!
Thanks,

Hélène

2017-06-29 17:35 GMT+02:00 Hélène Arduin <[email protected]>:

> 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
>>
>>
>
_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users

Reply via email to