#include int main(int argc, char **argv) { int numprocs, my_id; struct gridftp_params gfp; /* MPICH-G2 structure in mpi.h */ MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &my_id); if (my_id == 0 || my_id == 1) { /* must set these three fields */ gfp.partner_rank = (my_id ? 0 : 1); gfp.nsocket_pairs = 64; gfp.tcp_buffsize = 256*1024; MPI_Attr_put(MPI_COMM_WORLD, MPICHX_PARALLELSOCKETS_PARAMETERS, &gfp); } /* endif */ /* * from this point all messages exchanged between * MPI_COMM_WORLD ranks 0 and 1 will be automatically * partitioned and transported over parallel sockets */ MPI_Finalize(); } /* end main() */