ECP-copa / CoMD

Classical molecular dynamics proxy application.
Other
31 stars 55 forks source link

src-mpi/yamlOutput.c no error checking or read-only functionality #7

Closed j-ogas closed 5 years ago

j-ogas commented 7 years ago

When attempting to run mpirun -np 1 bin/CoMD-mpi in a read-only (container) environment, the program segfaults.

After debugging in GDB I was able to trace the segfault to yamlOutput.c where I read your comment and learned that this behavior is intended.

It is rather disappointing to learn that I will not be able to run CoMD in its current state. If I get the time during the school year this fall, I will fork it and get creative. In the meantime, I'd like to suggest adding some form of error checking to the file I/O in yamlOutput.c, specifically at line 60:

yamlFile = fopen(filename, "w");

This will save others (with read-only container environments) some time when debugging a seemingly random segfault from mpirun.

rspavel commented 7 years ago

The purpose of the code in yamlOutput.c is to write information about the system on which the code was built and how it was built and run for provenance purposes as CoMD is a proxy app and is expected to have regular changes to compilation configuration and even the code.

I definitely agree we probably should have wrapped that, but CoMD is more of a workhorse proxy app intended for experimentation and less a demonstration of proper software engineering. And this is data that we want saved and easily referenced anyway, so the wrapper will still exit with an error if the file open failed (but a more intuitive error).

I am not sure what you expect to get out of running CoMD in a readonly container, but a quick google yields this resource which may be of use to you http://www.projectatomic.io/blog/2015/12/making-docker-images-write-only-in-production/ I would recommend getting into the habit of doing that anyway as readonly containers are good from a security perspective, but not so much for scientific computing (or approximations thereof) that actually write outputs.

But yes, the point of CoMD is for people to fork it and "get creative" whether that creativity is in studying new approaches on a manageable code or finding ways to improve performance of MD applications. So we strongly encourage that and you definitely have the right idea. Here is hoping you can find time in your schedule to do some research.

j-ogas commented 5 years ago

Closing for personal active issue tab tidiness.