Skip to content

Commit 2a5d190

Browse files
sb17vartpol84
andcommitted
oshmem: Remove dead codes during oshmem communicator creation
oshmem uses oshmem_group_t structure during communicator creation. However, it consists a peer_list of type opal_list_t. However, the peer_list field is not used anywhere inside oshmem. Removing the peer_list field from the oshmem_group_t structure to save additional memory consumption. Co-authored-by: Artem Y. Polyakov <artemp@nvidia.com> Signed-off-by: Subhadeep Bhattacharya <subhadeepb@nvidia.com> Signed-off-by: Artem Polyakov <artemp@nvidia.com>
1 parent b0b831f commit 2a5d190

File tree

4 files changed

+2
-44
lines changed

4 files changed

+2
-44
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* $HEADER$
1212
*/
13-
13+
1414
#define _GNU_SOURCE
1515
#include <stdio.h>
1616

oshmem/mca/spml/ucx/spml_ucx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ mca_spml_ucx_ctx_mkey_by_va(shmem_ctx_t ctx, int pe, void *va, void **rva, mca_s
261261
{
262262
spml_ucx_cached_mkey_t **mkey;
263263
mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx;
264-
int i;
264+
size_t i;
265265

266266
mkey = ucx_ctx->ucp_peers[pe].mkeys;
267267
for (i = 0; i < ucx_ctx->ucp_peers[pe].mkeys_cnt; i++) {

oshmem/proc/proc.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ int oshmem_proc_init(void)
7878
return ret;
7979
}
8080

81-
/* check oshmem_proc_data_t can fit within ompi_proc_t padding */
82-
assert(sizeof(oshmem_proc_data_t) <= OMPI_PROC_PADDING_SIZE);
8381
/* check ompi_proc_t padding is aligned on a pointer */
8482
assert(0 == (offsetof(ompi_proc_t, padding) & (sizeof(char *)-1)));
8583

@@ -192,7 +190,6 @@ oshmem_group_t* oshmem_proc_group_create(int pe_start, int pe_stride, int pe_siz
192190
int cur_pe, count_pe;
193191
int i;
194192
oshmem_group_t* group = NULL;
195-
ompi_proc_t* proc = NULL;
196193

197194
assert(oshmem_proc_local());
198195

@@ -234,19 +231,6 @@ oshmem_group_t* oshmem_proc_group_create(int pe_start, int pe_stride, int pe_siz
234231
}
235232
group->proc_count = (int) count_pe;
236233
group->ompi_comm = NULL;
237-
238-
/* Prepare peers list */
239-
OBJ_CONSTRUCT(&(group->peer_list), opal_list_t);
240-
{
241-
opal_namelist_t *peer = NULL;
242-
243-
for (i = 0; i < group->proc_count; i++) {
244-
peer = OBJ_NEW(opal_namelist_t);
245-
peer->name.jobid = group->proc_vpids[i];
246-
peer->name.vpid = OMPI_PROC_MY_NAME->jobid;
247-
opal_list_append(&(group->peer_list), &peer->super);
248-
}
249-
}
250234
group->id = opal_pointer_array_add(&oshmem_group_array, group);
251235

252236
memset(&group->g_scoll, 0, sizeof(mca_scoll_base_group_scoll_t));
@@ -287,17 +271,6 @@ oshmem_proc_group_destroy_internal(oshmem_group_t* group, int scoll_unselect)
287271
free(group->proc_vpids);
288272
}
289273

290-
/* Destroy peer list */
291-
{
292-
opal_list_item_t *item;
293-
294-
while (NULL != (item = opal_list_remove_first(&(group->peer_list)))) {
295-
/* destruct the item (we constructed it), then free the memory chunk */
296-
OBJ_RELEASE(item);
297-
}
298-
OBJ_DESTRUCT(&(group->peer_list));
299-
}
300-
301274
/* reset the oshmem_group_array entry - make sure that the
302275
* entry is in the table */
303276
if (NULL

oshmem/proc/proc.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@ struct oshmem_group_t;
3939

4040
#define OSHMEM_PE_INVALID (-1)
4141

42-
/* This struct will be copied into the padding field of an ompi_proc_t
43-
* so the size of oshmem_proc_data_t must be less or equal than
44-
* OMPI_PROC_PADDING_SIZE */
45-
struct oshmem_proc_data_t {
46-
char * transport_ids;
47-
int num_transports;
48-
};
49-
50-
typedef struct oshmem_proc_data_t oshmem_proc_data_t;
51-
52-
#define OSHMEM_PROC_DATA(proc) \
53-
((oshmem_proc_data_t *)(proc)->padding)
54-
5542
/**
5643
* Group of Open SHMEM processes structure
5744
*
@@ -64,7 +51,6 @@ struct oshmem_group_t {
6451
int proc_count; /**< number of processes in group */
6552
int is_member; /* true if my_pe is part of the group, participate in collectives */
6653
opal_vpid_t *proc_vpids; /* vpids of each process in group */
67-
opal_list_t peer_list;
6854

6955
/* Collectives module interface and data */
7056
mca_scoll_base_group_scoll_t g_scoll;
@@ -164,7 +150,6 @@ static inline int oshmem_proc_pe(ompi_proc_t *proc)
164150
return (proc ? (int) ((ompi_process_name_t*)&proc->super.proc_name)->vpid : -1);
165151
}
166152

167-
int oshmem_proc_init_set_local_vpids();
168153
bool oshmem_proc_on_local_node(int pe);
169154
/**
170155
* Initialize the OSHMEM process predefined groups

0 commit comments

Comments
 (0)