GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
map.h
Go to the documentation of this file.
1 
6 #ifndef GHOST_MAP_H
7 #define GHOST_MAP_H
8 
9 #include "config.h"
10 #include "types.h"
11 #include "sparsemat_src.h"
12 
16 typedef enum
17 {
30 }
32 
36 typedef enum {
54 
58 typedef enum {
68 
72 typedef enum {
79 
83 typedef struct
84 {
157 }
158 ghost_map;
159 
160 #ifdef __cplusplus
161 extern "C" {
162 #endif
163 
208  void ghost_map_destroy(ghost_map *map);
217  int ghost_rank_of_row(ghost_map *map, ghost_gidx row);
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 #endif
ghost_lidx dim
The local dimension for this rank.
Definition: map.h:104
ghost_map_flags flags
The map's flags.
Definition: map.h:148
Does not make a distinction between local and remote entries if set; this might lead to higher commun...
Definition: map.h:77
The matrix is generated by a function.
Definition: map.h:48
Header file for type definitions.
ghost_maptype
Possible types of maps.
Definition: map.h:16
ghost_map_dist_type
Possible distribution criteria of maps.
Definition: map.h:58
int32_t ghost_gidx
Type for global indices.
Definition: types.h:443
ghost_maptype type
The map's type.
Definition: map.h:140
ghost_lidx * ldim
The local dimension of each rank.
Definition: map.h:100
A row map.
Definition: map.h:25
int32_t ghost_lidx
Definition: types.h:503
ghost_error ghost_map_create_distribution(ghost_map *map, ghost_sparsemat_src_rowfunc *matsrc, double weight, ghost_map_dist_type distType, ghost_lidx *el_per_rank)
Initialize a map's distribution.
Definition: map.c:50
Empty source.
Definition: map.h:52
The matrix comes from a Matrix Market file.
Definition: map.h:44
int ghost_mpi_comm
Definition: types.h:19
No type associated yet.
Definition: map.h:21
ghost_map_flags
Possible flags to maps.
Definition: map.h:72
Defines a rowfunc-based sparsemat source.
Definition: sparsemat_src.h:36
ghost_lidx * loc_perm
The local permutation.
Definition: map.h:120
ghost_error
Error return type.
Definition: error.h:23
A column map.
Definition: map.h:29
Distribute by number of non zero entries.
Definition: map.h:62
ghost_gidx gdim
The global dimension.
Definition: map.h:88
GHOST sparsemat sources.
ghost_lidx * cu_loc_perm
The local permutation in CUDA memory.
Definition: map.h:136
int ref_count
Definition: map.h:156
ghost_gidx * goffs
The offset into ::gdim of each rank.
Definition: map.h:92
ghost_lidx * loc_perm_inv
The local inverse permutation.
Definition: map.h:124
A GHOST map.
Definition: map.h:83
Distribute by number of rows.
Definition: map.h:66
ghost_gidx offs
The offset into ::gdim for this rank.
Definition: map.h:96
ghost_sparsemat_src
Possible sources of a sparse matrix.
Definition: map.h:36
void ghost_map_destroy(ghost_map *map)
Destroy a map and free all its resources if no more references to it exist.
Definition: map.c:187
ghost_map * ghost_map_create_light(ghost_lidx dim, ghost_mpi_comm mpicomm)
Create a light map with only a dimension and an MPI communicator.
Definition: map.c:218
ghost_lidx dimhalo
The local dimension including halo elements for this rank.
Definition: map.h:108
ghost_mpi_comm mpicomm
The associated MPI communicator.
Definition: map.h:144
ghost_gidx * glb_perm
The global permutation.
Definition: map.h:128
The matrix comes from a binary CRS file.
Definition: map.h:40
ghost_lidx dimpad
The local dimension including halo elements and padding for this rank.
Definition: map.h:112
Definition: map.h:73
int ghost_rank_of_row(ghost_map *map, ghost_gidx row)
Get the rank of a given global row in a given map.
Definition: map.c:204
ghost_error ghost_map_create(ghost_map **map, ghost_gidx gdim, ghost_mpi_comm comm, ghost_maptype type, ghost_map_flags flags)
Create a map.
Definition: map.c:6
ghost_lidx nhalo
The number of halo elements.
Definition: map.h:116
ghost_gidx * glb_perm_inv
The global inverse permutation.
Definition: map.h:132