Pastes:104560  Views:2155787 

Languages:

   ASP
   C#
   C++
   HTML
   Java
   PHP
   VB.NET
   Visual Basic 6

more languages available...


Looking to freelance?


Warning: file_get_contents(http://www.getafreelancer.com/affiliates/itsdan/6f.txt) [function.file-get-contents]: failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? in /home/nmp/public_html/support/googlereferrals.php on line 21
( bids)

Source: GetAFreelancer.com


C++ 3D Engine

 

 

 

 

 

 

Here's the requested code from the pastebin:

Wrap Lines   Use Line Numbers
#include <stdio.h>
#include <cstdlib>
#include "mpi.h"
 
int main(int argc,char *argv[])
{
  int myid;
  int tag,source,destination,count;
  int buffer;
  int buf2[3];
 
  MPI_Status status;
  MPI_Init(&argc,&argv);
  MPI_Comm_rank(MPI_COMM_WORLD,&myid);
  int tasks = MPI::COMM_WORLD.Get_size();//extra
  tag =1234;
  source =0;
  destination = 1;
  count =1;
  printf(" Tasks : %d ", tasks);
  int *rbuf;//extra
  rbuf = (int*)malloc(2*1*sizeof(int));
  if(myid == 0) 
  {
  MPI_Gather(&buffer,1,MPI_INT,rbuf,2,MPI_INT,0,MPI_COMM_WORLD);
    printf("processor %d receive  %d \n %d ", myid,rbuf,++rbuf);
  }
  if(myid == 1) {
  buffer = 456;
MPI_Send(&buffer,2,MPI_INT,2,tag,MPI_COMM_WORLD);
    printf("processor %d sent %d \n ", myid,buffer);
  }
  if(myid == 2 )
  {
   buffer =1234;
    MPI_Send(&buffer,count,MPI_INT,0,tag,MPI_COMM_WORLD);
printf("processor %d sent %d \n",myid,buffer);
 
  }
  MPI_Finalize();
}
 
 
Syntax Highlighting:  



Copyright 2007 - NoMorePasting.com