c-h-david / rapid

Routing Application for Parallel computatIon of Discharge (RAPID)
http://rapid-hub.org/
Other
86 stars 35 forks source link

Running rapid in docker #20

Closed KMarkert closed 3 years ago

KMarkert commented 3 years ago

Hi there :wave:

I am trying to run rapid using the docker image that you have provided. I have the required files for the model but I am not able to execute the model within the container. Here is the what I am doing:

$ docker run -v path/to/data/:/mnt/ --name rapid -it chdavid/rapid
root@xxxxxxx:/home/rapid# cd src
root@xxxxxxx:/home/rapid/src# ln -s /mnt/rapid_namelist rapid_namelist
root@xxxxxxx:/home/rapid/src# ./rapid 

Then I get the following error:

At line 26 of file rapid_read_namelist.F90 (unit = 88, file = './rapid_namelist')
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f30e9b64d1d in ???
#1  0x7f30e9b65825 in ???
#2  0x7f30e9b65f79 in ???
#3  0x7f30e9c28dc3 in ???
#4  0x7f30e9c29ccb in ???
#5  0x7f30e9c2c117 in ???
#6  0x7f30e9c2c278 in ???
#7  0x559dfb4a6d8d in rapid_read_namelist_
        at /home/rapid/src/rapid_read_namelist.F90:26
#8  0x559dfb4a0580 in rapid_init_
        at /home/rapid/src/rapid_init.F90:118
#9  0x559dfb49ec3e in rapid_main
        at /home/rapid/src/rapid_main.F90:50
#10  0x559dfb4a0212 in main
        at /home/rapid/src/rapid_main.F90:17

I understand that this error is happening because rapid cannot find the namespace file. I have tried other approaches as well, like copying the rapid_namespace file in the same directory as rapid, but have had no luck... So, I am wondering if you have any insight on how to run the model using the Docker image or what I might be doing wrong or not doing right to run the model.

Thanks in advance!

KMarkert commented 3 years ago

Just as an update, I installed RAPID locally as I read that Docker containers sometimes have issues with creating symbolic links .

Everything was installed correctly and I created a symbolic link of the rapid_namespace and I received the same error. Seems like I am having an issue of pointing rapid to the file....any guidance would be greatly appreciated.

c-h-david commented 3 years ago

Hi Kel, it looks like you're trying to create a symbolic link pointing rapid_namelist, the default file name for RAPID instruction files, towards a file that is on your machine but outside of the container. I've actually never done that so I'm not sure what to recommend. However, the error that shows up suggests End of file rather than File not found. So perhaps the issue is not so much that it can't find it, but instead that your namelist file is faulty. You might want to try downloading example files using https://github.com/c-h-david/rapid/blob/master/tst/tst_pub_dwnl_Emery_etal_2020_JHM2.sh and executing using https://github.com/c-h-david/rapid/blob/master/tst/rapid_namelist_San_Guad_JHM2. Perhaps that'll help! You could also try to run https://github.com/c-h-david/rapid/blob/master/tst/tst_pub_repr_Emery_etal_2020_JHM2.sh from your container. Just to make sure that the issue is indeed volume mapping, and not faulty inputs. Let me know how it goes! Cedric

KMarkert commented 3 years ago

Hi Cedric,

Thanks for the quick response and information! Looks like this was user error 😅 I was not aware of the examples namelist files in the test folder so I was creating mine from scratch, leading to the error. Confirming here I was able to successfully run the model after updating the parameters.

I tested running the model on the docker image, users can run cp /mnt/path/to/namelist src/rapid_namelist which will place the local file in the docker rapid dir and the model can run successfully that way.

c-h-david commented 3 years ago

Glad it worked out!