Actual source code: map.c
1: /*$Id: map.c,v 1.14 2001/03/23 23:21:22 balay Exp $*/
2: /*
3: Provides the interface functions for all map operations.
4: These are the map functions the user calls.
5: */
6: #include src/vec/vecimpl.h
8: /*@C
9: MapGetLocalSize - Gets the number of elements associated with this processor.
11: Not Collective
13: Input Parameter:
14: . m - the map object
16: Output Parameter:
17: . n - the local size
19: Level: developer
21: .seealso: MapGetSize(), MapGetLocalRange(), MapGetGlobalRange()
23: Concepts: Map^local size
25: @*/
26: int MapGetLocalSize(Map m,int *n)
27: {
32: (*m->ops->getlocalsize)(m,n);
33: return(0);
34: }
36: /*@C
37: MapGetSize - Gets the total number of elements associated with this map.
39: Not Collective
41: Input Parameter:
42: . m - the map object
44: Output Parameter:
45: . N - the global size
47: Level: developer
49: .seealso: MapGetLocalSize(), MapGetLocalRange(), MapGetGlobalRange()
51: Concepts: Map^size
52: @*/
53: int MapGetSize(Map m,int *N)
54: {
59: (*m->ops->getglobalsize)(m,N);
60: return(0);
61: }
63: /*@C
64: MapGetLocalRange - Gets the local ownership range for this procesor.
66: Not Collective
68: Input Parameter:
69: . m - the map object
71: Output Parameter:
72: + rstart - the first local index
73: - rend - the last local index + 1
75: Level: developer
77: .seealso: MapGetLocalSize(), MapGetGlobalRange()
79: @*/
80: int MapGetLocalRange(Map m,int *rstart,int *rend)
81: {
86: (*m->ops->getlocalrange)(m,rstart,rend);
87: return(0);
88: }
90: /*@C
91: MapGetGlobalRange - Gets the ownership ranges for all processors.
93: Not Collective
95: Input Parameter:
96: . m - the map object
98: Output Parameter:
99: . range - array of size + 1 where size is the size of the communicator
100: associated with the map. range[rank], range[rank+1] is the
101: range for processor
103: Level: developer
105: .seealso: MapGetSize(), MapGetLocalRange()
107: @*/
108: int MapGetGlobalRange(Map m,int *range[])
109: {
114: (*m->ops->getglobalrange)(m,range);
115: return(0);
116: }
118: /*@C
119: MapDestroy - Destroys a map object.
121: Not Collective
123: Input Parameter:
124: . m - the map object
126: Level: developer
128: .seealso: MapCreateMPI()
130: @*/
131: int MapDestroy(Map m)
132: {
137: (*m->ops->destroy)(m);
138: return(0);
139: }