Hi Helene,
I had a similar problem and I hope my solution will help (but if you
have a better one, I'm all ears).
Try to add the name of the directory from which you built your care
archive to the name of the inputFiles:
// the directory from which the care archive was built
val myWorkDirectory = "/path/to/a/directory"
...
inputFiles += (input, s"${myWorkDirectory}/${n}"),
...
In my case, if I don't do that, the CARE task will not find the data.
I don't know where it is supposed to copy them if you give him a
relative path...
Cheers,
Julien
2017-07-04 18:26 GMT+02:00 Jonathan Passerat-Palmbach
<[email protected]>:
> Hi Helene,
>
>
> On 30/06/17 13:57, Hélène Arduin wrote:
>
> 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.
>
>
> OpenMOLE injects them in the archive when you use the inputFiles directive
>
> 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.
>
> hostFiles should work too but will be dependent on what's available on the
> execution nodes. So not possible if you plan running your experiment on EGI
> for instance.
>
> 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/")?
>
>
> first argument is the path to your file / folder on the local machine
> second argument is the path you want your file to appear within the CARE
> archive
> by default, second argument is the same as the first one [hostFiles +=
> ("/etc/hosts") will take /etc/hosts from the machine running the task and
> make it available as /etc/hosts in the CARE archive
>
> Cheers
> J
>
>
>
> 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 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 list
>>> [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
>
> --
> 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
>
--
Julien Perret
Researcher / Chargé de recherche du Ministère de l’Écologie, du
Développement durable et de l’Énergie (MEDDE)
LaSTIG (Laboratoire des Sciences et Technologies de l'Information Géographique)
COGIT Team
IGN (Institut National de l'Information Géographique et Forestière)
Tel (work): +33 1 43 98 84 09
Fax (work): +33 1 43 98 85 81
Professional Homepage:
http://recherche.ign.fr/labos/cogit/cv.php?prenom=Julien&nom=Perret
_______________________________________________
OpenMOLE-users mailing list
[email protected]
http://fedex.iscpif.fr/mailman/listinfo/openmole-users