Beispiel #1
0
int       Zoltan_Comm_Do_Reverse_Post(
ZOLTAN_COMM_OBJ *plan,          /* communication data structure */
int       tag,                  /* message tag for communicating */
char     *send_data,            /* array of data I currently own */
int       nbytes,               /* # bytes per data item */
int      *sizes,                /* variable size of objects (if not NULL) */
char     *recv_data)            /* array of data I'll own after reverse comm */
{
  int       comm_flag;                /* status flag */

  /* create plan->plan_reverse
   */
  comm_flag = create_reverse_plan(plan, tag, sizes);

  if (comm_flag == ZOLTAN_OK || comm_flag == ZOLTAN_WARN){

    /* post the receives of plan->plan_reverse
     */
    comm_flag = Zoltan_Comm_Do_Post(plan->plan_reverse, tag, send_data, nbytes,
                recv_data);
  }

  if (comm_flag != ZOLTAN_OK && comm_flag != ZOLTAN_WARN){
    free_reverse_plan(plan);
  }

  return (comm_flag);
}
Beispiel #2
0
int       Zoltan_Comm_Do(
ZOLTAN_COMM_OBJ * plan,		/* communication data structure */
int tag,			/* message tag for communicating */
char *send_data,		/* array of data I currently own */
int nbytes,			/* multiplier for sizes */
char *recv_data)		/* array of data I'll own after comm */
{
   int status;
   
   status = Zoltan_Comm_Do_Post (plan, tag, send_data, nbytes, recv_data);
   if (status == ZOLTAN_OK)
      status = Zoltan_Comm_Do_Wait (plan, tag, send_data, nbytes, recv_data);
   return status;
}
Beispiel #3
0
int Zoltan_Comm_Do_Reverse(
ZOLTAN_COMM_OBJ *plan,		/* communication data structure */
int       tag,			    /* message tag for communicating */
char     *send_data,		/* array of data I currently own */
int       nbytes,		    /* # bytes per data item */
int      *sizes,		    /* variable size of objects (if not NULL) */
char     *recv_data)		/* array of data I'll own after reverse comm */
{
  int status;

  /* create plan->plan_reverse
   */
  status = create_reverse_plan(plan, tag, sizes);

  if (status == ZOLTAN_OK || status == ZOLTAN_WARN){

    if (plan->plan_reverse->maxed_recvs){
  
      /* use MPI_Alltoallv to implement plan->plan_reverse, because comm_do_post
       * would post more receives that allowed on this machine
       */
      
      status = Zoltan_Comm_Do_AlltoAll(plan->plan_reverse, send_data, nbytes, recv_data);
    }
    else{
      /* use post/wait which is faster when each sends to few
       */
      status = Zoltan_Comm_Do_Post(plan->plan_reverse, tag, send_data, nbytes, recv_data);
    
      if (status == ZOLTAN_OK || status == ZOLTAN_WARN){
        status = Zoltan_Comm_Do_Wait (plan->plan_reverse, tag, send_data, nbytes, recv_data);
      }
    }
  }

  free_reverse_plan(plan);

  return status;
}