p4est  1.0
src/p4est_communication.h
00001 /*
00002   This file is part of p4est.
00003   p4est is a C library to manage a collection (a forest) of multiple
00004   connected adaptive quadtrees or octrees in parallel.
00005 
00006   Copyright (C) 2010 The University of Texas System
00007   Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
00008 
00009   p4est is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free Software Foundation; either version 2 of the License, or
00012   (at your option) any later version.
00013 
00014   p4est is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with p4est; if not, write to the Free Software Foundation, Inc.,
00021   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #ifndef P4EST_COMMUNICATION_H
00025 #define P4EST_COMMUNICATION_H
00026 
00027 #include <p4est.h>
00028 
00029 SC_EXTERN_C_BEGIN;
00030 
00031 typedef enum
00032 {
00033   P4EST_COMM_COUNT_PERTREE = 1,
00034   P4EST_COMM_BALANCE_FIRST_COUNT,
00035   P4EST_COMM_BALANCE_FIRST_LOAD,
00036   P4EST_COMM_BALANCE_SECOND_COUNT,
00037   P4EST_COMM_BALANCE_SECOND_LOAD,
00038   P4EST_COMM_PARTITION_GIVEN,
00039   P4EST_COMM_PARTITION_WEIGHTED_LOW,
00040   P4EST_COMM_PARTITION_WEIGHTED_HIGH,
00041   P4EST_COMM_PARTITION_CORRECTION,
00042   P4EST_COMM_GHOST_COUNT,
00043   P4EST_COMM_GHOST_LOAD,
00044   P4EST_COMM_GHOST_EXCHANGE,
00045   P4EST_COMM_GHOST_EXPAND_COUNT,
00046   P4EST_COMM_GHOST_EXPAND_LOAD,
00047   P4EST_COMM_NODES_QUERY,
00048   P4EST_COMM_NODES_REPLY,
00049   P4EST_COMM_SAVE,
00050   P4EST_COMM_LNODES_TEST,
00051   P4EST_COMM_LNODES_PASS,
00052   P4EST_COMM_LNODES_OWNED,
00053   P4EST_COMM_LNODES_ALL
00054 }
00055 p4est_comm_tag_t;
00056 
00061 void                p4est_comm_count_quadrants (p4est_t * p4est);
00062 
00071 void                p4est_comm_global_partition (p4est_t * p4est,
00072                                                  p4est_quadrant_t *
00073                                                  first_quad);
00074 
00081 void                p4est_comm_count_pertree (p4est_t * p4est,
00082                                               p4est_gloidx_t * pertree);
00083 
00089 int                 p4est_comm_is_owner (p4est_t * p4est,
00090                                          p4est_locidx_t which_tree,
00091                                          const p4est_quadrant_t * q,
00092                                          int rank);
00093 
00099 int                 p4est_comm_find_owner (p4est_t * p4est,
00100                                            p4est_locidx_t which_tree,
00101                                            const p4est_quadrant_t * q,
00102                                            int guess);
00103 
00114 void                p4est_comm_tree_info (p4est_t * p4est,
00115                                           p4est_locidx_t which_tree,
00116                                           int full_tree[],
00117                                           int tree_contact[],
00118                                           const p4est_quadrant_t ** firstq,
00119                                           const p4est_quadrant_t ** nextq);
00120 
00129 int                 p4est_comm_neighborhood_owned (p4est_t * p4est,
00130                                                    p4est_locidx_t which_tree,
00131                                                    int full_tree[],
00132                                                    int tree_contact[],
00133                                                    p4est_quadrant_t * q);
00134 
00141 int                 p4est_comm_sync_flag (p4est_t * p4est,
00142                                           int flag, sc_MPI_Op operation);
00143 
00150 unsigned            p4est_comm_checksum (p4est_t * p4est,
00151                                          unsigned local_crc,
00152                                          size_t local_bytes);
00153 
00154 SC_EXTERN_C_END;
00155 
00156 #endif /* !P4EST_COMMUNICATION_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines