void Trace::unpack(void *buf, int bufsize, int *position, MPI_Comm comm){
  int len;
  PMPI_Unpack(buf, bufsize, position, &len, 1, MPI_INT, comm);
  for(int i=0; i<len; i++){
    Event *e = new Event();
    e->unpack(buf, bufsize, position, comm);
    appendEvent(e, false);
  }
}
void Histogram::unpack(void *buf, int bufsize, int *position, MPI_Comm comm){
  PMPI_Unpack(buf, bufsize, position, &num_elems, 1, MPI_INT, comm);
  PMPI_Unpack(buf, bufsize, position, &num_bins, 1, MPI_INT, comm);
  PMPI_Unpack(buf, bufsize, position, &max_rank, 1, MPI_INT, comm);
  PMPI_Unpack(buf, bufsize, position, &min_rank, 1, MPI_INT, comm);
  PMPI_Unpack(buf, bufsize, position, &max_value, 1, MPI_DOUBLE, comm);
  PMPI_Unpack(buf, bufsize, position, &min_value, 1, MPI_DOUBLE, comm);
  PMPI_Unpack(buf, bufsize, position, &avg_value, 1, MPI_DOUBLE, comm);
  for(int i=0; i<num_bins; i++){
    HistoBin *bin = new HistoBin();
    bin->unpack(buf, bufsize, position, comm);
    bins.push_back(bin);
  }
}
Exemple #3
0
  void receive_keys(effort_data& effort_log, int src, MPI_Comm comm) {
    MPI_Status status;
  
    int bufsize;
    PMPI_Recv(&bufsize, 1, MPI_INT, src, 0, comm, &status);
  
    char buf[bufsize];
    PMPI_Recv(buf, bufsize, MPI_PACKED, src, 0, comm, &status);
    
    int position = 0;
    ModuleId::id_map modules;
    ModuleId::unpack_id_map(buf, bufsize, &position, modules, comm);

    int num_keys;
    PMPI_Unpack(buf, bufsize, &position, &num_keys, 1, MPI_INT, comm);
    for (int i=0; i < num_keys; i++) {
      effort_key key = effort_key::unpack(modules, buf, bufsize, &position, comm);
      if (!effort_log.contains(key)) {
        effort_log[key] = effort_record(effort_log.progress_count);
      }
    }
  }
Exemple #4
0
void ompi_unpack_f(char *inbuf, MPI_Fint *insize, MPI_Fint *position,
		  char *outbuf, MPI_Fint *outcount, MPI_Fint *datatype,
		  MPI_Fint *comm, MPI_Fint *ierr)
{
   int c_ierr;
   MPI_Comm c_comm;
   MPI_Datatype c_type;
   OMPI_SINGLE_NAME_DECL(position);

   c_comm = PMPI_Comm_f2c(*comm);
   c_type = PMPI_Type_f2c(*datatype);
   OMPI_SINGLE_FINT_2_INT(position);

   c_ierr = PMPI_Unpack(inbuf, OMPI_FINT_2_INT(*insize),
                       OMPI_SINGLE_NAME_CONVERT(position),
                       OMPI_F2C_BOTTOM(outbuf), OMPI_FINT_2_INT(*outcount),
                       c_type, c_comm);
   if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

   if (MPI_SUCCESS == c_ierr) {
        OMPI_SINGLE_INT_2_FINT(position);
    }
}
Exemple #5
0
int MPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
  return PMPI_Unpack(inbuf, insize, position, outbuf, outcount, type, comm);
}