daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest May 16th, 2018 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void send(int odbiorca)
  2.     {
  3.         int vecsize = vec.size();
  4.         int strsize = string2.length();
  5.         MPI::COMM_WORLD.Send(&vecsize, 1, MPI::INT, odbiorca, 0);
  6.         MPI::COMM_WORLD.Send(&(vec[0]), vecsize, MPI::INT, odbiorca, 0);
  7.         MPI::COMM_WORLD.Send(&strsize, 1, MPI::INT, odbiorca, 0);
  8.         MPI::COMM_WORLD.Send(&string2, 1, MPI::CHAR, odbiorca, 0);
  9.        
  10.  
  11.  
  12.  
  13.  
  14.     }
  15.  
  16.     void recv(int nadawca)
  17.     {
  18.         string tempString;
  19.         vector<int>tempVector;
  20.  
  21.  
  22.         int vecsize;
  23.         int strsize;
  24.         char*buff = new char[strsize + 1];
  25.         MPI::COMM_WORLD.Recv(&vecsize, 1, MPI::INT, nadawca, 0);
  26.         MPI::COMM_WORLD.Recv(&(tempvVctor[0]),vecsize, MPI::INT, nadawca, 0);
  27.         MPI::COMM_WORLD.Recv(&strsize, 1, MPI::INT, nadawca, 0);
  28.         MPI::COMM_WORLD.Recv(buff, strsize, MPI::CHAR, nadawca, 0);
  29.         buff[size] = "\0";
  30.         string2.append(buff);
  31.         vec.resize(tempVector);
  32.  
  33.  
  34.  
  35.  
  36.     }
RAW Paste Data
Top