[mpich-discuss] Running an mpi program that needs to access /dev/mem

Jeff Hammond jhammond at alcf.anl.gov
Thu Jun 13 09:46:48 CDT 2013


Sorry, I misinterpreted/misread your question or otherwise acted
stupidly.  I think http://www.linfo.org/su.html and
http://www.howtogeek.com/111479/htg-explains-whats-the-difference-between-sudo-su/
answer everything in detail, but "sudo" and "su" give you the same
environment.

Jeff

On Thu, Jun 13, 2013 at 9:36 AM, Lee, Eibhlin
<eibhlin.lee10 at imperial.ac.uk> wrote:
> In that case there are definitely misleading guides out there. http://www.cyberciti.biz/faq/ubuntu-linux-root-password-default-password/ This implies that sudo bash does log you in as root user.
> Either my second question confused you; it wasn't the right question to ask; or the guide I linked to is completely wrong.
> Eibhlin
> ________________________________________
> From: discuss-bounces at mpich.org [discuss-bounces at mpich.org] on behalf of Jeff Hammond [jhammond at alcf.anl.gov]
> Sent: 13 June 2013 15:27
> To: discuss at mpich.org
> Subject: Re: [mpich-discuss] Running an mpi program that needs to access        /dev/mem
>
> No, of course the root environment is not the same as your user
> environment.  There are plenty of "intro to Linux" resources online if
> you need this kind of information.
>
> If you want your user environment as root, which I don't think is
> particularly safe or a good idea, you can set it with "source
> ~${yourusername}/.${yourshell}rc" where yourusername is $USERNAME when
> you are not root and yourshell is $SHELL when you are not root.
>
> The better option is to figure out what environment variables you need
> to set in the mpiexec environment that are currently defined in your
> user environment and set those manually.
>
> Jeff
>
> On Thu, Jun 13, 2013 at 9:15 AM, Lee, Eibhlin
> <eibhlin.lee10 at imperial.ac.uk> wrote:
>> Jeff,
>> Does that put you into the same environment as sudo bash? Because I have already tried that with no success.
>> Eibhlin
>> ________________________________________
>> From: discuss-bounces at mpich.org [discuss-bounces at mpich.org] on behalf of Jeff Hammond [jhammond at alcf.anl.gov]
>> Sent: 13 June 2013 13:58
>> To: discuss at mpich.org
>> Subject: Re: [mpich-discuss] Running an mpi program that needs to access        /dev/mem
>>
>> Just su to root instead of using sudo.
>>
>> Jeff
>>
>> On Thu, Jun 13, 2013 at 6:56 AM, Lee, Eibhlin
>> <eibhlin.lee10 at imperial.ac.uk> wrote:
>>> Hello all,
>>>
>>> I am trying to use two raspberry-pi to sample and then process some data.
>>> The first process samples while the second processes and vice versa. To do
>>> this I use gpio and also mpich-3.0.4 with the process manager smpd. I have
>>> successfully run cpi on both machines (from the master machine). I have also
>>> managed to run a similar program but without the MPI, this involved
>>> compiling with gcc and when running putting sudo in front of the binary
>>> file.
>>>
>>> When I combine these two processes I get various error messages.
>>> For input:
>>> mpiexec -phrase cat -machinefile machinefile -n 2 ~/main
>>> the error is:
>>> Can't open /dev/mem
>>> Did you forget to use 'sudo .. ?'
>>>
>>> For input:
>>> sudo mpiexec -phrase cat -machinefile machinefile -n 2 ~/main
>>> the error is:
>>> sudo: mpiexec: Command not found
>>>
>>> I therefore put mpiexec into /usr/bin
>>>
>>> now for input:
>>> sudo mpiexec -phrase cat -machinefile machinefile -n 2 ~/main
>>> the error is:
>>> Can't open /dev/mem
>>> Did you forget to use 'sudo .. ?'
>>>
>>> Does anyone know how I can work around this?
>>> Thanks,
>>> Eibhlin
>>>
>>>
>>> _______________________________________________
>>> discuss mailing list     discuss at mpich.org
>>> To manage subscription options or unsubscribe:
>>> https://lists.mpich.org/mailman/listinfo/discuss
>>
>>
>>
>> --
>> Jeff Hammond
>> Argonne Leadership Computing Facility
>> University of Chicago Computation Institute
>> jhammond at alcf.anl.gov / (630) 252-5381
>> http://www.linkedin.com/in/jeffhammond
>> https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
>> ALCF docs: http://www.alcf.anl.gov/user-guides
>> _______________________________________________
>> discuss mailing list     discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
>> _______________________________________________
>> discuss mailing list     discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
> --
> Jeff Hammond
> Argonne Leadership Computing Facility
> University of Chicago Computation Institute
> jhammond at alcf.anl.gov / (630) 252-5381
> http://www.linkedin.com/in/jeffhammond
> https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
> ALCF docs: http://www.alcf.anl.gov/user-guides
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
ALCF docs: http://www.alcf.anl.gov/user-guides



More information about the discuss mailing list