[mpich-discuss] Modifying ssh calls for MPICH2
Reuti
reuti at staff.uni-marburg.de
Tue Jan 17 16:19:10 CST 2012
Am 17.01.2012 um 23:09 schrieb Jed Brown:
> On Tue, Jan 17, 2012 at 16:02, Reuti <reuti at staff.uni-marburg.de> wrote:
> main(int argc, char **argv)
> {
> int node;
>
> int i,j;
> float f;
>
> MPI_Init(NULL,NULL);
> MPI_Comm_rank(MPI_COMM_WORLD, &node);
>
> 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. Of course, you can include the rank to modify it, but a clever compiler should then also detect that f is never used again.
Observing it in a cluster is easier if there is a real load on the machines IMO instead of a sleep(). A `qstat -f` in SGE can already show the load to confirm a correct distribution according to the granted slots. Well, it was more necessary with MPICH1 or LAM/MPI, nowadays the integration into a queuing system works most often out-of-the-box.
-- Reuti
More information about the mpich-discuss
mailing list