libsc  2.8.7
The SC library provides support for parallel scientific applications.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sc_notify.h
Go to the documentation of this file.
1 /*
2  This file is part of the SC Library.
3  The SC Library provides support for parallel scientific applications.
4 
5  Copyright (C) 2010 The University of Texas System
6  Additional copyright (C) 2011 individual authors
7 
8  The SC Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  The SC Library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with the SC Library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 */
23 
58 #ifndef SC_NOTIFY_H
59 #define SC_NOTIFY_H
60 
61 #include <sc_statistics.h>
62 
63 SC_EXTERN_C_BEGIN;
64 
67 
70 
73 
87 int sc_notify_allgather (int *receivers, int num_receivers,
88  int *senders, int *num_senders,
89  sc_MPI_Comm mpicomm);
90 
106 int sc_notify (int *receivers, int num_receivers,
107  int *senders, int *num_senders,
108  sc_MPI_Comm mpicomm);
109 
127 void sc_notify_nary (sc_array_t * receivers,
128  sc_array_t * senders,
129  sc_array_t * in_payload,
130  sc_array_t * out_payload,
131  sc_MPI_Comm mpicomm);
132 
148 void sc_notify_ext (sc_array_t * receivers,
149  sc_array_t * senders,
150  sc_array_t * in_payload,
151  sc_array_t * out_payload,
152  sc_MPI_Comm mpicomm);
153 
159 typedef struct sc_notify_s sc_notify_t;
160 
163  sc_array_t *, sc_notify_t *,
164  void *);
165 
167 typedef enum
168 {
173  SC_NOTIFY_PEX,
182 }
184 
185 #define SC_NOTIFY_STR_ALLGATHER "allgather"
186 #define SC_NOTIFY_STR_BINARY "binary"
187 #define SC_NOTIFY_STR_NARY "nary"
188 #define SC_NOTIFY_STR_PEX "pex"
189 #define SC_NOTIFY_STR_PCX "pcx"
190 #define SC_NOTIFY_STR_RSX "rsx"
191 #define SC_NOTIFY_STR_NBX "nbx"
192 #define SC_NOTIFY_STR_RANGES "ranges"
193 #define SC_NOTIFY_STR_SUPERSET "superset"
196 extern const char *sc_notify_type_strings[SC_NOTIFY_NUM_TYPES];
197 
201 
205 
216 
223 
231 
240  size_t thresh);
241 
249 
260  sc_statistics_t * stats);
261 
269 
275 
282 
293  sc_notify_type_t type);
294 
304  int *ntop, int *nint,
305  int *nbot);
306 
315 void sc_notify_nary_set_widths (sc_notify_t * notify, int ntop,
316  int nint, int nbot);
317 
323 
329  int num_ranges);
330 
336 int sc_notify_ranges_get_package_id (sc_notify_t * notify);
337 
342 void sc_notify_ranges_set_package_id (sc_notify_t * notify,
343  int package_id);
344 const int *sc_notify_ranges_get_procs (sc_notify_t * notify,
345  int *num_procs);
346 void sc_notify_ranges_set_procs (sc_notify_t * notify,
347  int num_procs,
348  const int *procs);
349 void sc_notify_ranges_get_peer_range (sc_notify_t * notify,
350  int *first_peer,
351  int *last_peer);
352 void sc_notify_ranges_set_peer_range (sc_notify_t * notify,
353  int first_peer,
354  int last_peer);
355 
364  (sc_notify_t * notify, sc_compute_superset_t * compute_superset, void *ctx);
365 
372  (sc_notify_t * notify, sc_compute_superset_t compute_superset, void *ctx);
373 
402 void sc_notify_payload (sc_array_t * receivers,
403  sc_array_t * senders,
404  sc_array_t * in_payload,
405  sc_array_t * out_payload,
406  int sorted, sc_notify_t * notify);
407 
453 void sc_notify_payloadv (sc_array_t * receivers,
454  sc_array_t * senders,
455  sc_array_t * out_payload,
456  sc_array_t * in_payload,
457  sc_array_t * out_offsets,
458  sc_array_t * in_offsets,
459  int sorted, sc_notify_t * notify);
460 
465 
466 SC_EXTERN_C_END;
467 
468 #endif /* !SC_NOTIFY_H */
sc3_MPI_Comm_t sc_MPI_Comm
Emulate an MPI communicator.
Definition: sc_mpi.h:450
void sc_notify_destroy(sc_notify_t *notify)
Destroy a notify controller constructed with sc_notify_new.
sc_notify_type_t sc_notify_get_type(sc_notify_t *notify)
Get the type of a notify controller.
void sc_notify_payload(sc_array_t *receivers, sc_array_t *senders, sc_array_t *in_payload, sc_array_t *out_payload, int sorted, sc_notify_t *notify)
Collective call to notify a set of receiver ranks of current rank.
void sc_notify_nary_set_widths(sc_notify_t *notify, int ntop, int nint, int nbot)
For a notify of type SC_NOTIFY_NARY, set the branching widths of the recursive algorithm.
void sc_notify_payloadv(sc_array_t *receivers, sc_array_t *senders, sc_array_t *out_payload, sc_array_t *in_payload, sc_array_t *out_offsets, sc_array_t *in_offsets, int sorted, sc_notify_t *notify)
Collective call to notify a set of receiver ranks of current rank and send a variable size message to...
int sc_notify(int *receivers, int num_receivers, int *senders, int *num_senders, sc_MPI_Comm mpicomm)
Collective call to notify a set of receiver ranks of current rank.
size_t sc_notify_get_eager_threshold(sc_notify_t *notify)
Get the payload size above which payloads are no longer transferred with notification packets in sc_n...
sc_notify_t * sc_notify_new(sc_MPI_Comm mpicomm)
Create a notify controller that can be used in sc_notify_payload and sc_notify_payloadv.
void sc_notify_ranges_set_num_ranges(sc_notify_t *notify, int num_ranges)
Set the number of ranges for the SC_NOTIFY_RANGES method.
sc_notify_type_t
Various equivalent implementations of the functionality.
Definition: sc_notify.h:168
@ SC_NOTIFY_ALLGATHER
Choose allgather algorithm.
Definition: sc_notify.h:170
@ SC_NOTIFY_SUPERSET
Use a computable superset of communicators, computed by a callback function.
Definition: sc_notify.h:179
@ SC_NOTIFY_RSX
Choose remote summation algorithm.
Definition: sc_notify.h:176
@ SC_NOTIFY_NUM_TYPES
End of list marker for notify algorithms.
Definition: sc_notify.h:181
@ SC_NOTIFY_DEFAULT
Choose whatever type is stored in sc_notify_type_default.
Definition: sc_notify.h:169
@ SC_NOTIFY_RANGES
Use the sc_ranges functionality.
Definition: sc_notify.h:178
@ SC_NOTIFY_PCX
Choose reduce_scatter algorithm (AKA personalized census).
Definition: sc_notify.h:175
@ SC_NOTIFY_NARY
Choose nary (k-way) recursion.
Definition: sc_notify.h:172
@ SC_NOTIFY_PEX
Choose alltoall algorithm (AKA personalized exchange).
Definition: sc_notify.h:173
@ SC_NOTIFY_NBX
Choose non-blocking consensus algorithm.
Definition: sc_notify.h:177
@ SC_NOTIFY_BINARY
Choose simple binary recursion.
Definition: sc_notify.h:171
int sc_notify_nary_ntop_default
Default number of children at root node of nary tree; initialized to 2.
const char * sc_notify_type_strings[SC_NOTIFY_NUM_TYPES]
Names for each notify method.
sc_MPI_Comm sc_notify_get_comm(sc_notify_t *notify)
Get the MPI communicator of a notify controller.
size_t sc_notify_eager_threshold_default
The default threshold for payload sizes (in bytes) that are communicated with the notification packet...
void(* sc_compute_superset_t)(sc_array_t *, sc_array_t *, sc_array_t *, sc_notify_t *, void *)
Type of callback function for the SC_NOTIFY_SUPERSET variant.
Definition: sc_notify.h:162
void sc_notify_ext(sc_array_t *receivers, sc_array_t *senders, sc_array_t *in_payload, sc_array_t *out_payload, sc_MPI_Comm mpicomm)
The default implementation of the notify functionality, currently PEX.
int sc_notify_ranges_num_ranges_default
For the SC_NOTIFY_RANGES method, the default is 25.
int sc_notify_allgather(int *receivers, int num_receivers, int *senders, int *num_senders, sc_MPI_Comm mpicomm)
Collective call to notify a set of receiver ranks of current rank.
int sc_notify_nary_nint_default
Default number of children at intermediate tree nodes; initialized to 2.
void sc_notify_set_eager_threshold(sc_notify_t *notify, size_t thresh)
Get the payload size above which payloads are no longer transferred with notification packets in sc_n...
sc_statistics_t * sc_notify_get_stats(sc_notify_t *notify)
Get the sc_statistics_t object for logging runtimes (added by function name).
void sc_notify_nary_get_widths(sc_notify_t *notify, int *ntop, int *nint, int *nbot)
For a notify of type SC_NOTIFY_NARY, get the branching widths of the recursive algorithm.
void sc_notify_nary(sc_array_t *receivers, sc_array_t *senders, sc_array_t *in_payload, sc_array_t *out_payload, sc_MPI_Comm mpicomm)
The n-ary tree implementation of the notify functionality.
void sc_notify_superset_get_callback(sc_notify_t *notify, sc_compute_superset_t *compute_superset, void *ctx)
Query the callback for the SC_NOTIFY_SUPERSET method.
int sc_notify_ranges_get_num_ranges(sc_notify_t *notify)
Query the number of ranges for the SC_NOTIFY_RANGES method.
int sc_notify_nary_nbot_default
Default number of children at deepest level of tree; initialized to 2.
int sc_notify_set_type(sc_notify_t *notify, sc_notify_type_t type)
Set the type of a notify controller.
void sc_notify_set_stats(sc_notify_t *notify, sc_statistics_t *stats)
Set a sc_statistics_t object for logging runtimes (added by function name).
int sc_notify_supports_type(sc_notify_type_t type)
Query whether sc_notify_set_type supports a given type.
void sc_notify_superset_set_callback(sc_notify_t *notify, sc_compute_superset_t compute_superset, void *ctx)
Set the callback for the SC_NOTIFY_SUPERSET method.
sc_notify_type_t sc_notify_type_default
The default type used when constructing a notify controller; initialized to SC_NOTIFY_PEX.
struct sc_notify_s sc_notify_t
Opaque object used for controlling notification (AKA dynamic sparse data exchange) operations.
Definition: sc_notify.h:159
Computation of average and mean values etc.
The sc_array object provides a dynamic array of equal-size elements.
Definition: sc_containers.h:117
The statistics container allows dynamically adding random variables.
Definition: sc_statistics.h:63