/usr/include/sc_ranges.h is in libp4est-dev 1.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | /*
This file is part of the SC Library.
The SC Library provides support for parallel scientific applications.
Copyright (C) 2010 The University of Texas System
The SC Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The SC Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the SC Library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef SC_RANGES_H
#define SC_RANGES_H
#include <sc.h>
SC_EXTERN_C_BEGIN;
/** Compute the optimal ranges of processors to talk to.
*
* \param [in] package_id Registered package id or -1.
* \param [in] num_procs Number of processors processed.
* \param [in] procs Array [num_procs] interpreted as booleans.
* Nonzero entries need to be talked to.
* \param [in] rank The id of the calling process.
* Will be excluded from the ranges.
* \param [in] first_peer First processor to be considered.
* \param [in] last_peer Last processor to be considered (inclusive).
* \param [in] num_ranges The maximum number of ranges to fill.
* \param [in,out] ranges Array [2 * num_ranges] that will be filled
* with beginning and ending procs (inclusive)
* that represent each range. Values of -1
* indicate that the range is not needed.
* \return Returns the number of filled ranges.
*/
int sc_ranges_compute (int package_id, int num_procs,
const int *procs, int rank,
int first_peer, int last_peer,
int num_ranges, int *ranges);
/** Compute the globally optimal ranges of processors.
*
* \param [in] package_id Registered package id or -1.
* \param [in] mpicomm MPI Communicator for Allreduce and Allgather.
* \param [in] procs Same as in sc_ranges_compute ().
* \param [in,out] inout1
* On input, first_peer as in sc_ranges_compute ().
* On output, global maximum of peer counts.
* \param [in,out] inout2
* On input, last_peer as in sc_ranges_compute ().
* On output, global maximum number of ranges.
* \param [in] num_ranges The maximum number of ranges to fill.
* \param [in,out] ranges Array [2 * num_ranges] that will be filled
* with beginning and ending procs (inclusive)
* that represent each local range. Values of -1
* indicate that the range is not needed.
* \param [out] global_ranges
* If not NULL, will be allocated and filled with everybody's ranges.
* Size will be 2 * inout2 * num_procs. Must be freed with SC_FREE ().
* \return Returns the number of locally filled ranges.
*/
int sc_ranges_adaptive (int package_id, sc_MPI_Comm mpicomm,
const int *procs,
int *inout1, int *inout2,
int num_ranges, int *ranges,
int **global_ranges);
/** Determine an array of receivers and an array of senders from ranges.
* This function is intended for compatibility and debugging only.
* In particular, sc_ranges_adaptive may include non-receiving processors.
* It is generally more efficient to use sc_notify instead of sc_ranges.
*
* \param [in] num_procs The number of parallel processors (aka mpisize).
* \param [in] rank Number of this processors (aka mpirank).
* Rank is excluded from receiver and sender output.
* \param [in] max_ranges Global maximum of filled range windows as
* returned in inout2 by sc_ranges_adaptive.
* \param [in] global_ranges All processor ranges from sc_ranges_adaptive.
* \param [out] num_receivers Number of receiver ranks. Greater/equal to
* number of nonzero procs in sc_ranges_compute.
* \param [in,out] receiver_ranks Array of at least mpisize for output.
* \param [out] num_senders Number of senders to this processor.
* \paarm [in,out] sender_ranks Array of at least mpisize for output.
*/
void sc_ranges_decode (int num_procs, int rank,
int max_ranges,
const int *global_ranges,
int *num_receivers, int *receiver_ranks,
int *num_senders, int *sender_ranks);
/** Compute global statistical information on the ranges.
*
* \param [in] package_id Registered package id or -1.
* \param [in] log_priority Priority to use for logging.
*/
void sc_ranges_statistics (int package_id, int log_priority,
sc_MPI_Comm mpicomm, int num_procs,
const int *procs, int rank,
int num_ranges, int *ranges);
SC_EXTERN_C_END;
#endif /* !SC_RANGES_H */
|