Accessing files through micnativeloadex

Accessing files through micnativeloadex

I try to load an application with micnativeloadex with accesses some files. These files are stored in a shared filesystem between the host and the device: the /home in the host is mounted in /mic on the device. So say, file /home/my_user/file in the host corresponds to /mic/my_user/file in the device. The problem is that every time I try to access one of these files, I get a permission denied. If I move them to /tmp, for example, I can access them properly. But I cannot move all the data to /tmp or some other filesystem mounted in the MIC memory, because they weigh some GB of disk space.

Anybody faced that problem before?

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I suspect the problem you are having is because micnativeloadex, like programs written using offload directives, runs code on the coprocessor as a special user, "micuser", not as you. You can, of course, log directly into the coprocessor and run the code as yourself. Another alternative is to create a micuser on the host, with the same user and group id numbers as it has on the coprocessor (400 for both user and group id), then make sure micuser has permission to access the files on the host. Perhaps, put the files into /home/micuser on the host so that they pop up in /mic/micuser on the coprocessor.

I'll have to create taht micuser user, because I need to debug the program and launch it via micloadex

Thank you!

Well, unless you have some special hoops you need to jump through that specifically require using micnativeloadex, you should be able to replace that with some number of scp commands followed by an ssh to the card, to download your code and libraries and then launch your application on the coprocessor.  And using scp and ssh directly would let you use any user account enabled on the coprocessor rather than sticking with "micuser," which is baggage that comes along with using micnativeloadex. (See the MPSS_Boot_Config_Guide.pdf included with the latest MPSS release for details on setting up coprocessor user accounts.)

The problem is that my application has got a huge I/O from disk and has to manage big files (not that big, but some GB each one), and I suppose that the fs in the mic is a virtual fs mounted in memory, so I'd better not move that files there.

So you NFS-mount your disk partition on the coprocessor and read data over that pipe.  That doesn't change the decision whether to use micnativeloadex versus ssh and scp (the scps intended only for copying your a.out and support SOs to the coprocessor VFS).  Micnativeloadex does exactly this sort of copying of execution files (not data files) before doing the native launch on the coprocessor side.

Robert's comment made me think of something. If you nfs mount your data, and your home directories and the directories with your libraries, you should (with judicious use of path and library path variables) be able to very simply say:

ssh mic0 the_program_I_am_trying_to_run

Leave a Comment

Please sign in to add a comment. Not a member? Join today