[mpich-discuss] Modifying ssh calls for MPICH2

Reuti reuti at staff.uni-marburg.de
Tue Jan 17 17:15:36 CST 2012


Am 17.01.2012 um 23:48 schrieb Jed Brown:

> On Tue, Jan 17, 2012 at 16:19, Reuti <reuti at staff.uni-marburg.de> wrote:
> >   printf("Hello World from Node %d.\n", node);
> >       for(j=0; j <= 100000; j++)
> >           for(i=0;i <= 100000; i++)
> >               f=i*2.718281828*i+i+i*3.141592654;
> >
> > Well this is an odd spin loop because the compiler will happily remove it for you (note that MPICH2's mpicc wrapper very frequently has optimization flags in it). I would suggest sleep(3) instead, or, if you must, force the loop to actually be executed (e.g. seed the loop with the rank and use the result).
> 
> Not for my gcc version and mpich2-1.4, I can see a  clear load.
> 
> Add -O1 and it will go away. *Many* people build MPICH2 with some optimization in CFLAGS (hoping to build MPICH2 with optimization) in which case those flags also get written into the wrappers. I see this from users wondering why their debugging session isn't working as expected every few weeks, so it's definitely a common situation.

Oh, I wasn't aware of it - thx. Then you need `mpicc -O0 ...` to get it working again. Okay.

I just checked the Installers Guide, maybe it would be more safe to use the MPICH2LIB_xFLAGS to get an optimized MPICH2 leaving the wrappers untouched.

-- Reuti

> Of course, you can include the rank to modify it, but a clever compiler should then also detect that f is never used again.
> 
> That's why my comment included "and use the result". ;-)
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list