| [2aa6644] | 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 6 | * HYPRE is free software; you can redistribute it and/or modify it under the
|
|---|
| 7 | * terms of the GNU Lesser General Public License (as published by the Free
|
|---|
| 8 | * Software Foundation) version 2.1 dated February 1999.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 | #ifndef hypre_EXCHANGE_DATA_HEADER
|
|---|
| 14 | #define hypre_EXCHANGE_DATA_HEADER
|
|---|
| 15 |
|
|---|
| 16 | #define hypre_BinaryTreeParentId(tree) (tree->parent_id)
|
|---|
| 17 | #define hypre_BinaryTreeNumChild(tree) (tree->num_child)
|
|---|
| 18 | #define hypre_BinaryTreeChildIds(tree) (tree->child_id)
|
|---|
| 19 | #define hypre_BinaryTreeChildId(tree, i) (tree->child_id[i])
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | typedef struct
|
|---|
| 23 | {
|
|---|
| 24 | int parent_id;
|
|---|
| 25 | int num_child;
|
|---|
| 26 | int *child_id;
|
|---|
| 27 | } hypre_BinaryTree;
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | /* In the fill_response() function the user needs to set the recv__buf
|
|---|
| 32 | and the response_message_size. Memory of size send_response_storage has been
|
|---|
| 33 | alllocated for the send_buf (in exchange_data) - if more is needed, then
|
|---|
| 34 | realloc and adjust
|
|---|
| 35 | the send_response_storage. The realloc amount should be storage+overhead.
|
|---|
| 36 | If the response is an empty "confirmation" message, then set
|
|---|
| 37 | response_message_size =0 (and do not modify the send_buf) */
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | typedef struct
|
|---|
| 41 | {
|
|---|
| 42 | int (*fill_response)(void* recv_buf, int contact_size,
|
|---|
| 43 | int contact_proc, void* response_obj,
|
|---|
| 44 | MPI_Comm comm, void** response_buf,
|
|---|
| 45 | int* response_message_size);
|
|---|
| 46 | int send_response_overhead; /*set by exchange data */
|
|---|
| 47 | int send_response_storage; /*storage allocated for send_response_buf*/
|
|---|
| 48 | void *data1; /*data fields user may want to access in fill_response */
|
|---|
| 49 | void *data2;
|
|---|
| 50 |
|
|---|
| 51 | } hypre_DataExchangeResponse;
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 | int hypre_CreateBinaryTree(int, int, hypre_BinaryTree*);
|
|---|
| 55 | int hypre_DestroyBinaryTree(hypre_BinaryTree*);
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | int hypre_DataExchangeList(int num_contacts,
|
|---|
| 59 | int *contact_proc_list, void *contact_send_buf,
|
|---|
| 60 | int *contact_send_buf_starts, int contact_obj_size,
|
|---|
| 61 | int response_obj_size,
|
|---|
| 62 | hypre_DataExchangeResponse *response_obj, int max_response_size,
|
|---|
| 63 | int rnum, MPI_Comm comm, void **p_response_recv_buf,
|
|---|
| 64 | int **p_response_recv_buf_starts);
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 | #endif /* end of header */
|
|---|