#include <stdio.h>
#include "mpi.h"
int main(int argc, char *argv[])
{
int size, rank, i;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
if(rank ==0)
{
printf("Number of processes =%d\n",size
); }
printf("My number in MPI_COMM_WORLD =%d\n",rank
); MPI_Finalize();
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlICJtcGkuaCIKCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKICAgIGludCBzaXplLCByYW5rLCBpOwogICAgTVBJX0luaXQoJmFyZ2MsICZhcmd2KTsKICAgIE1QSV9Db21tX3NpemUoTVBJX0NPTU1fV09STEQsJnNpemUpOwogICAgTVBJX0NvbW1fcmFuayhNUElfQ09NTV9XT1JMRCwmcmFuayk7CiAgICBpZihyYW5rID09MCkKICAgIHsKICAgICAgICBwcmludGYoIk51bWJlciBvZiBwcm9jZXNzZXMgPSVkXG4iLHNpemUpOwogICAgfQogICAgcHJpbnRmKCJNeSBudW1iZXIgaW4gTVBJX0NPTU1fV09STEQgPSVkXG4iLHJhbmspOwogICAgTVBJX0ZpbmFsaXplKCk7CiAgICByZXR1cm4gMDsKfQ==