Skip to content

Commit 324534b

Browse files
committed
Merge pull request #1161 from tkordenbrock/topic/add.triggered.scatter
coll-portals4: add scatter and iscatter implementations that use Portals4 triggered operations
2 parents e93755c + 4721b70 commit 324534b

File tree

5 files changed

+837
-8
lines changed

5 files changed

+837
-8
lines changed

ompi/mca/coll/portals4/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ local_sources = \
1616
coll_portals4_bcast.c \
1717
coll_portals4_reduce.c \
1818
coll_portals4_gather.c \
19+
coll_portals4_scatter.c \
1920
coll_portals4_request.h \
2021
coll_portals4_request.c
2122

ompi/mca/coll/portals4/coll_portals4.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ struct mca_coll_portals4_module_t {
105105
/* binomial tree */
106106
ompi_coll_portals4_tree_t *cached_in_order_bmtree;
107107
int cached_in_order_bmtree_root;
108-
109-
size_t barrier_count;
110-
size_t gather_count;
111108
};
112109
typedef struct mca_coll_portals4_module_t mca_coll_portals4_module_t;
113110
OBJ_CLASS_DECLARATION(mca_coll_portals4_module_t);
@@ -235,6 +232,19 @@ int ompi_coll_portals4_igather_intra(const void *sbuf, int scount, struct ompi_d
235232
mca_coll_base_module_t *module);
236233
int ompi_coll_portals4_igather_intra_fini(struct ompi_coll_portals4_request_t *request);
237234

235+
int ompi_coll_portals4_scatter_intra(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
236+
void *rbuf, int rcount, struct ompi_datatype_t *rdtype,
237+
int root,
238+
struct ompi_communicator_t *comm,
239+
mca_coll_base_module_t *module);
240+
int ompi_coll_portals4_iscatter_intra(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
241+
void *rbuf, int rcount, struct ompi_datatype_t *rdtype,
242+
int root,
243+
struct ompi_communicator_t *comm,
244+
ompi_request_t **request,
245+
mca_coll_base_module_t *module);
246+
int ompi_coll_portals4_iscatter_intra_fini(struct ompi_coll_portals4_request_t *request);
247+
238248

239249
static inline ptl_process_t
240250
ompi_coll_portals4_get_peer(struct ompi_communicator_t *comm, int rank)

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ portals4_comm_query(struct ompi_communicator_t *comm,
573573
return NULL;
574574
}
575575

576+
opal_output_verbose(50, ompi_coll_base_framework.framework_output,
577+
"%s:%d: My nid,pid = (%x,%x)\n",
578+
__FILE__, __LINE__, proc->phys.nid, proc->phys.pid);
579+
576580
/* check for logical addressing mode in the MTL */
577581
if (0 == proc->phys.pid) {
578582
opal_output_verbose(1, ompi_coll_base_framework.framework_output,
@@ -595,6 +599,9 @@ portals4_comm_query(struct ompi_communicator_t *comm,
595599
portals4_module->super.coll_gather = ompi_coll_portals4_gather_intra;
596600
portals4_module->super.coll_igather = ompi_coll_portals4_igather_intra;
597601

602+
portals4_module->super.coll_scatter = ompi_coll_portals4_scatter_intra;
603+
portals4_module->super.coll_iscatter = ompi_coll_portals4_iscatter_intra;
604+
598605
portals4_module->cached_in_order_bmtree=NULL;
599606
portals4_module->cached_in_order_bmtree_root=-1;
600607

@@ -607,9 +614,6 @@ portals4_comm_query(struct ompi_communicator_t *comm,
607614
portals4_module->super.coll_reduce = ompi_coll_portals4_reduce_intra;
608615
portals4_module->super.coll_ireduce = ompi_coll_portals4_ireduce_intra;
609616

610-
portals4_module->barrier_count = 0;
611-
portals4_module->gather_count = 0;
612-
613617
return &(portals4_module->super);
614618
}
615619

@@ -706,8 +710,7 @@ portals4_progress(void)
706710
ompi_coll_portals4_iallreduce_intra_fini(ptl_request);
707711
break;
708712
case OMPI_COLL_PORTALS4_TYPE_SCATTER:
709-
opal_output(ompi_coll_base_framework.framework_output,
710-
"scatter is not supported yet\n");
713+
ompi_coll_portals4_iscatter_intra_fini(ptl_request);
711714
break;
712715
case OMPI_COLL_PORTALS4_TYPE_GATHER:
713716
ompi_coll_portals4_igather_intra_fini(ptl_request);

ompi/mca/coll/portals4/coll_portals4_request.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,47 @@ struct ompi_coll_portals4_request_t {
122122
MPI_Aint unpack_dst_lb;
123123
MPI_Aint unpack_dst_true_lb;
124124
} gather;
125+
126+
struct {
127+
opal_convertor_t send_converter;
128+
opal_convertor_t recv_converter;
129+
size_t packed_size;
130+
int8_t is_sync;
131+
int8_t free_after;
132+
size_t coll_count;
133+
char *scatter_buf;
134+
uint64_t scatter_bytes;
135+
ptl_match_bits_t scatter_match_bits;
136+
ptl_handle_md_t scatter_mdh;
137+
ptl_handle_ct_t scatter_cth;
138+
ptl_handle_md_t scatter_meh;
139+
ptl_match_bits_t sync_match_bits;
140+
ptl_handle_md_t sync_mdh;
141+
ptl_handle_ct_t sync_cth;
142+
ptl_handle_me_t sync_meh;
143+
int my_rank;
144+
int root_rank;
145+
int size;
146+
const void *sbuf;
147+
void *rbuf;
148+
uint64_t pack_bytes;
149+
const char *pack_src_buf;
150+
int pack_src_count;
151+
struct ompi_datatype_t *pack_src_dtype;
152+
MPI_Aint pack_src_extent;
153+
MPI_Aint pack_src_true_extent;
154+
MPI_Aint pack_src_lb;
155+
MPI_Aint pack_src_true_lb;
156+
uint64_t unpack_bytes;
157+
char *unpack_dst_buf;
158+
int unpack_dst_count;
159+
struct ompi_datatype_t *unpack_dst_dtype;
160+
MPI_Aint unpack_dst_extent;
161+
MPI_Aint unpack_dst_true_extent;
162+
MPI_Aint unpack_dst_lb;
163+
MPI_Aint unpack_dst_true_lb;
164+
MPI_Aint unpack_dst_offset;
165+
} scatter;
125166
} u;
126167
};
127168
typedef struct ompi_coll_portals4_request_t ompi_coll_portals4_request_t;

0 commit comments

Comments
 (0)