[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-160-gbbb5a3c
mysql vizuser
noreply at mpich.org
Tue May 7 13:43:47 CDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".
The branch, master has been updated
via bbb5a3c4b26f9642fc1dec6c96c9c7ca1f695f17 (commit)
via e50a1dd3dd9460f0c7c23b63fb74162068b98593 (commit)
via dd85044ba8d3cf760e4138a1f6012c45e54547af (commit)
via 313640c691ee440e85ab2a04375c804031fe90db (commit)
via f4f0de65736a8abf6c96b727e87b082992616cf5 (commit)
via 5673b82ca24c7481e312dc7573c84811c8244bb9 (commit)
via a28689d4ff7104ba525ddc5ea512e2d45116c1ce (commit)
from 1be61fbcad263cffe6dedfb1597be46ccad2b714 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/bbb5a3c4b26f9642fc1dec6c96c9c7ca1f695f17
commit bbb5a3c4b26f9642fc1dec6c96c9c7ca1f695f17
Author: sssharka <sssharka at us.ibm.com>
Date: Fri Mar 29 10:32:24 2013 -0400
Fixes for parsing command line parameters in CollSel
(ibm) D189463
(ibm) e7be2d5b3ae75a32383c32eb203d864d1bbbc386
Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index f1b508c..5f9f2cf 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -1404,6 +1404,7 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
char *msg_sizes = (char *) MPIU_Malloc(arg_len + 1);
char *msg_sz;
size_t tmp;
+ size_t array_size = 50;
/* if already set via config file, free it */
if(params->message_sizes)
{
@@ -1411,7 +1412,7 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
params->num_message_sizes = 0;
}
/* Allocating some extra space should be fine */
- params->message_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * 50);
+ params->message_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * array_size);
strcpy(msg_sizes, msg_sizes_arg);
msg_sz = strtok(msg_sizes,",");
@@ -1430,6 +1431,12 @@ static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t
break;
}
+ if(params->num_message_sizes >= array_size)
+ {
+ array_size *= 2;
+ params->message_sizes = (size_t *) MPIU_Realloc(params->message_sizes,
+ sizeof(size_t) * array_size);
+ }
params->message_sizes[params->num_message_sizes++] = tmp;
msg_sz = strtok(NULL,",");
}
@@ -1444,6 +1451,7 @@ static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t
char *geo_sizes = (char *) MPIU_Malloc(arg_len + 1);
char *geo_sz;
size_t tmp;
+ size_t array_size = 50;
/* if already set via config file, free it */
if(params->geometry_sizes)
{
@@ -1451,7 +1459,7 @@ static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t
params->num_geometry_sizes = 0;
}
/* Allocating some extra space should be fine */
- params->geometry_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * 50);
+ params->geometry_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * array_size);
strcpy(geo_sizes, geo_sizes_arg);
geo_sz = strtok(geo_sizes,",");
@@ -1470,6 +1478,12 @@ static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t
break;
}
+ if(params->num_geometry_sizes >= array_size)
+ {
+ array_size *= 2;
+ params->geometry_sizes = (size_t *) MPIU_Realloc(params->geometry_sizes,
+ sizeof(size_t) * array_size);
+ }
params->geometry_sizes[params->num_geometry_sizes++] = tmp;
geo_sz = strtok(NULL,",");
}
http://git.mpich.org/mpich.git/commitdiff/e50a1dd3dd9460f0c7c23b63fb74162068b98593
commit e50a1dd3dd9460f0c7c23b63fb74162068b98593
Author: sssharka <sssharka at us.ibm.com>
Date: Wed Mar 20 19:14:25 2013 -0400
shmcc_gather_t2 coredump w/ setMP_COLLECTIVE_SELECTION_FILE
(ibm) D189345
(ibm) 7Z8
(ibm) 9e1fffe10532d58f09acdbbd81ee582b370bf804
Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index 40f1de7..49e6aef 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -596,6 +596,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
MPID_Segment segment;
volatile unsigned allgather_active = 1;
const int rank = comm_ptr->rank;
+ const int size = comm_ptr->local_size;
const pami_metadata_t *my_md;
@@ -634,7 +635,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
if(!rcv_data_contig)
{
- rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rcv_noncontig_buff = MPIU_Malloc(recv_size * size);
rbuf = rcv_noncontig_buff;
if(rcv_noncontig_buff == NULL)
{
@@ -693,7 +694,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
MPID_PROGRESS_WAIT_WHILE(allgather_active);
if(!rcv_data_contig)
{
- MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size * size, MPI_CHAR,
recvbuf, recvcount, recvtype);
MPIU_Free(rcv_noncontig_buff);
}
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index 1226cae..1047a44 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -453,7 +453,7 @@ int MPIDO_Gather_simple(const void *sendbuf,
rbuf = (char *)recvbuf + true_lb;
if (!rcv_contig)
{
- rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rcv_noncontig_buff = MPIU_Malloc(recv_size * size);
rbuf = rcv_noncontig_buff;
if(rcv_noncontig_buff == NULL)
{
@@ -506,8 +506,8 @@ int MPIDO_Gather_simple(const void *sendbuf,
if(!rcv_contig)
{
- MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
- recvbuf, recvcount, recvtype);
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size*size, MPI_CHAR,
+ recvbuf, recvcount*size, recvtype);
MPIU_Free(rcv_noncontig_buff);
}
if(!snd_contig) MPIU_Free(snd_noncontig_buff);
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index ed1034b..34b77bf 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -267,7 +267,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
if(MPIDI_Pamix_collsel_advise != NULL)
{
advisor_algorithm_t advisor_algorithms[1];
- int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, send_size, advisor_algorithms, 1);
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, 64, advisor_algorithms, 1);
if(num_algorithms)
{
if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
@@ -301,7 +301,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
if(MPIDI_Pamix_collsel_advise != NULL)
{
advisor_algorithm_t advisor_algorithms[1];
- int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, rcvlen * recvcounts[0], advisor_algorithms, 1);
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, 64, advisor_algorithms, 1);
if(num_algorithms)
{
if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index a511f96..15d8366 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -335,7 +335,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
int use_pami = 1;
MPID_Segment segment;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
-
+ const int size = comm_ptr->local_size;
if (rank == root && sendtype != MPI_DATATYPE_NULL && sendcount >= 0)
{
@@ -376,7 +376,6 @@ int MPIDO_Scatter_simple(const void *sendbuf,
}
}
}
-
sbuf = (char *)sendbuf + snd_true_lb;
rbuf = (char *)recvbuf + rcv_true_lb;
if (rank == root)
@@ -386,15 +385,15 @@ int MPIDO_Scatter_simple(const void *sendbuf,
sbuf = (char *)sendbuf + snd_true_lb;
if (!snd_contig)
{
- snd_noncontig_buff = MPIU_Malloc(send_size);
+ snd_noncontig_buff = MPIU_Malloc(send_size * size);
sbuf = snd_noncontig_buff;
if(snd_noncontig_buff == NULL)
{
MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
"Fatal: Cannot allocate pack buffer");
}
- DLOOP_Offset last = send_size;
- MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0);
+ DLOOP_Offset last = send_size * size;
+ MPID_Segment_init(sendbuf, sendcount * size, sendtype, &segment, 0);
MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
}
}
@@ -480,7 +479,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
TRACE_ERR("Waiting on active %d\n", scatter_active);
MPID_PROGRESS_WAIT_WHILE(scatter_active);
- if(!rcv_contig)
+ if(!rcv_contig && rcv_noncontig_buff)
{
MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
recvbuf, recvcount, recvtype);
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index f868c00..00946a3 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -468,7 +468,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
if(MPIDI_Pamix_collsel_advise != NULL)
{
advisor_algorithm_t advisor_algorithms[1];
- int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, ssize * sendcounts[0], advisor_algorithms, 1);
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, 64, advisor_algorithms, 1);
if(num_algorithms)
{
if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
@@ -488,7 +488,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
if(MPIDI_Pamix_collsel_advise != NULL)
{
advisor_algorithm_t advisor_algorithms[1];
- int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, recv_size, advisor_algorithms, 1);
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, 64, advisor_algorithms, 1);
if(num_algorithms)
{
if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
http://git.mpich.org/mpich.git/commitdiff/dd85044ba8d3cf760e4138a1f6012c45e54547af
commit dd85044ba8d3cf760e4138a1f6012c45e54547af
Author: Michael Blocksome <blocksom at us.ibm.com>
Date: Mon May 6 13:54:41 2013 -0500
pami_tune core w/ -collective_selection=tune
(ibm) D189342
(ibm) 7Z8
(ibm) c2e13cd5979dbba4019cb95c01688a629b7b0f9e
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
diff --git a/src/mpid/pamid/src/comm/mpid_comm.c b/src/mpid/pamid/src/comm/mpid_comm.c
index 1de14a0..3201595 100644
--- a/src/mpid/pamid/src/comm/mpid_comm.c
+++ b/src/mpid/pamid/src/comm/mpid_comm.c
@@ -392,7 +392,7 @@ void MPIDI_Coll_comm_destroy(MPID_Comm *comm)
}
- if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE)
+ if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE)
{
/* Destroy the fast query object. */
pami_extension_collsel_query_destroy pamix_collsel_query_destroy =
diff --git a/src/mpid/pamid/src/comm/mpid_selectcolls.c b/src/mpid/pamid/src/comm/mpid_selectcolls.c
index 886dbd8..cd30053 100644
--- a/src/mpid/pamid/src/comm/mpid_selectcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_selectcolls.c
@@ -479,7 +479,7 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
/* If automatic collective selection is enabled and user didn't specifically overwrite
it, then use auto coll sel.. Otherwise, go through the manual coll sel code path. */
- if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE)
+ if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE)
{
/* Create a fast query object, cache it on the comm/geometry and use it in each collective */
pami_extension_collsel_query_create pamix_collsel_query_create =
http://git.mpich.org/mpich.git/commitdiff/313640c691ee440e85ab2a04375c804031fe90db
commit 313640c691ee440e85ab2a04375c804031fe90db
Author: sssharka <sssharka at us.ibm.com>
Date: Wed Feb 27 22:36:39 2013 -0500
shmcc_gather_t2 hang w/o MP_COLLECTIVE_SELECTION_FILE set
This commit includes a fix for all rooted collectives where type info is local.
The fix makes sure that non-contig data is converted and packed on all tasks
and then calling PAMI.
Another change in this commit is related to performance. MPICH2 queries the
collsel extension for best algorithm before attempting any conversions. If
algorithm is mpich, then it is called directly instead of going through the
collsel extension path in PAMI.
(ibm) D187892
(ibm) 7Z8
(ibm) dad6ba8f7883508cd7f83433232b8dadb6ccddcb
Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
diff --git a/src/mpid/pamid/include/mpidi_datatypes.h b/src/mpid/pamid/include/mpidi_datatypes.h
index dc87146..42f0da0 100644
--- a/src/mpid/pamid/include/mpidi_datatypes.h
+++ b/src/mpid/pamid/include/mpidi_datatypes.h
@@ -292,7 +292,7 @@ struct MPIDI_Request
#endif
};
-
+typedef void* fast_query_t;
/** \brief This defines the portion of MPID_Comm that is specific to the Device */
struct MPIDI_Comm
{
@@ -351,6 +351,7 @@ struct MPIDI_Comm
long long world_intercomm_cntr;
int *world_ids; /* ids of worlds that composed this communicator (inter communicator created for dynamic tasking */
#endif
+ fast_query_t collsel_fast_query;
};
@@ -557,4 +558,18 @@ typedef pami_result_t (*pami_extension_collsel_table_generate) (advisor_t,
external_geometry_ops_t *,
int);
+typedef pami_result_t (*pami_extension_collsel_query_create) (advisor_table_t advisor_table,
+ pami_geometry_t geometry,
+ fast_query_t *query);
+
+typedef pami_result_t (*pami_extension_collsel_query_destroy) (fast_query_t *query);
+
+typedef int (*pami_extension_collsel_advise) (fast_query_t fast_query,
+ pami_xfer_type_t xfer_type,
+ size_t message_size,
+ advisor_algorithm_t algorithms_optimized[],
+ size_t max_algorithms);
+
+
+
#endif
diff --git a/src/mpid/pamid/include/mpidi_externs.h b/src/mpid/pamid/include/mpidi_externs.h
index f9a9683..774e5c4 100644
--- a/src/mpid/pamid/include/mpidi_externs.h
+++ b/src/mpid/pamid/include/mpidi_externs.h
@@ -38,6 +38,6 @@ extern advisor_table_t MPIDI_Collsel_advisor_table;
extern pami_extension_t MPIDI_Collsel_extension;
extern advisor_params_t MPIDI_Collsel_advisor_params;
extern char *MPIDI_Collsel_output_file;
-
+extern pami_extension_collsel_advise MPIDI_Pamix_collsel_advise;
#endif
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index bb9ecf3..40f1de7 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -590,7 +590,7 @@ MPIDO_Allgather_simple(const void *sendbuf,
void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
MPI_Aint send_true_lb = 0;
MPI_Aint recv_true_lb = 0;
- int snd_data_contig = 1, rcv_data_contig;
+ int snd_data_contig = 1, rcv_data_contig = 1;
size_t send_size = 0;
size_t recv_size = 0;
MPID_Segment segment;
@@ -614,6 +614,22 @@ MPIDO_Allgather_simple(const void *sendbuf,
recv_true_lb);
send_size = recv_size;
+
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLGATHER, send_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Allgather(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ comm_ptr, mpierrno);
+ }
+ }
+ }
+
rbuf = (char *)recvbuf+recv_true_lb;
if(!rcv_data_contig)
diff --git a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
index fbf826f..95874b9 100644
--- a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
+++ b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
@@ -637,6 +637,29 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
int tmp;
const pami_metadata_t *my_md;
+
+ MPIDI_Datatype_get_info(1,
+ recvtype,
+ rcv_data_contig,
+ recv_size,
+ dt_null,
+ recv_true_lb);
+
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLGATHERV_INT, recv_size * recvcounts[0], advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Allgatherv(sendbuf, sendcount, sendtype,
+ recvbuf, recvcounts, displs, recvtype,
+ comm_ptr, mpierrno);
+ }
+ }
+ }
+
if((sendbuf != MPI_IN_PLACE) && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
{
return MPIR_Allgatherv(sendbuf, sendcount, sendtype,
@@ -649,12 +672,7 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
recvbuf, recvcounts, displs, recvtype,
comm_ptr, mpierrno);
}
- MPIDI_Datatype_get_info(1,
- recvtype,
- rcv_data_contig,
- recv_size,
- dt_null,
- recv_true_lb);
+
if(sendbuf == MPI_IN_PLACE)
{
diff --git a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
index ff7ca70..b948b8e 100644
--- a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
+++ b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
@@ -419,6 +419,24 @@ int MPIDO_Allreduce_simple(const void *sendbuf,
MPI_Aint data_true_lb = 0;
int data_size, data_contig;
+ MPIDI_Datatype_get_info(1, dt,
+ data_contig, data_size, data_ptr, data_true_lb);
+
+
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLREDUCE, data_size * count, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Allreduce(sendbuf, recvbuf, count, dt, op, comm_ptr, mpierrno);
+ }
+ }
+ }
+
+
rc = MPIDI_Datatype_to_pami(dt, &pdt, op, &pop, &mu);
/* convert to metadata query */
@@ -428,8 +446,6 @@ int MPIDO_Allreduce_simple(const void *sendbuf,
MPIDI_Update_last_algorithm(comm_ptr, "ALLREDUCE_MPICH");
return MPIR_Allreduce(sendbuf, recvbuf, count, dt, op, comm_ptr, mpierrno);
}
- MPIDI_Datatype_get_info(1, dt,
- data_contig, data_size, data_ptr, data_true_lb);
if(!data_contig)
{
diff --git a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
index ba4f2a0..3464c82 100644
--- a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
+++ b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
@@ -223,42 +223,76 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
{
TRACE_ERR("Entering MPIDO_Alltoall_optimized\n");
volatile unsigned active = 1;
+ void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+ void *sbuf = NULL, *rbuf = NULL;
+ size_t send_size = 0;
+ size_t recv_size = 0;
+ MPID_Segment segment;
MPID_Datatype *sdt, *rdt;
pami_type_t stype = NULL, rtype;
MPI_Aint sdt_true_lb=0, rdt_true_lb;
MPIDI_Post_coll_t alltoall_post;
- int sndlen, rcvlen, snd_contig, rcv_contig, pamidt=1;
+ int sndlen, rcvlen, snd_contig = 1, rcv_contig = 1, pamidt=1;
int tmp;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
+ MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rcvlen, rdt, rdt_true_lb);
+ rbuf = (char *)recvbuf + rdt_true_lb;
+ recv_size = rcvlen * recvcount;
+
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLTOALL, recv_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Alltoall_intra(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ comm_ptr, mpierrno);
+ }
+ }
+ }
+
if(sendbuf != MPI_IN_PLACE)
{
MPIDI_Datatype_get_info(1, sendtype, snd_contig, sndlen, sdt, sdt_true_lb);
- if(!snd_contig) pamidt = 0;
+ sbuf = (char *)sendbuf + sdt_true_lb;
+ send_size = sndlen * sendcount;
+ if(!snd_contig)
+ {
+ snd_noncontig_buff = MPIU_Malloc(send_size);
+ sbuf = snd_noncontig_buff;
+ if(snd_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ DLOOP_Offset last = send_size;
+ MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0);
+ MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
+
+ }
+ }
+
+ if(!rcv_contig)
+ {
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
}
- MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rcvlen, rdt, rdt_true_lb);
- if(!rcv_contig) pamidt = 0;
/* Alltoall is much simpler if bytes are required because we don't need to
* malloc displ/count arrays and copy things
*/
- /* Is it a built in type? If not, send to MPICH */
- if(sendbuf != MPI_IN_PLACE && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
- pamidt = 0;
- if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
- pamidt = 0;
-
- if(pamidt == 0)
- {
- return MPIR_Alltoall_intra(sendbuf, sendcount, sendtype,
- recvbuf, recvcount, recvtype,
- comm_ptr, mpierrno);
-
- }
-
pami_xfer_t alltoall;
const pami_metadata_t *my_alltoall_md;
my_alltoall_md = &mpid->coll_metadata[PAMI_XFER_ALLTOALL][0][0];
@@ -269,17 +303,17 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
alltoall.cb_done = cb_alltoall;
alltoall.cookie = (void *)&active;
alltoall.algorithm = mpid->coll_algorithm[PAMI_XFER_ALLTOALL][0][0];
- alltoall.cmd.xfer_alltoall.stype = stype;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
- alltoall.cmd.xfer_alltoall.stypecount = sendcount;
- alltoall.cmd.xfer_alltoall.sndbuf = (char *)sendbuf + sdt_true_lb;
+ alltoall.cmd.xfer_alltoall.stype = PAMI_TYPE_BYTE;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
+ alltoall.cmd.xfer_alltoall.stypecount = send_size;
+ alltoall.cmd.xfer_alltoall.sndbuf = sbuf;
if(sendbuf == MPI_IN_PLACE)
{
alltoall.cmd.xfer_alltoall.sndbuf = PAMI_IN_PLACE;
}
- alltoall.cmd.xfer_alltoall.rcvbuf = (char *)recvbuf + rdt_true_lb;
- alltoall.cmd.xfer_alltoall.rtypecount = recvcount;
- alltoall.cmd.xfer_alltoall.rtype = rtype;
+ alltoall.cmd.xfer_alltoall.rcvbuf = rbuf;
+ alltoall.cmd.xfer_alltoall.rtypecount = recv_size;
+ alltoall.cmd.xfer_alltoall.rtype = PAMI_TYPE_BYTE;
MPIDI_Context_post(MPIDI_Context[0], &alltoall_post.state,
MPIDI_Pami_post_wrapper, (void *)&alltoall);
@@ -287,6 +321,14 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
TRACE_ERR("Waiting on active\n");
MPID_PROGRESS_WAIT_WHILE(active);
+ if(!rcv_contig)
+ {
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ recvbuf, recvcount, recvtype);
+ MPIU_Free(rcv_noncontig_buff);
+ }
+ if(!snd_contig) MPIU_Free(snd_noncontig_buff);
+
TRACE_ERR("Leaving MPIDO_Alltoall_optimized\n");
return MPI_SUCCESS;
}
diff --git a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
index e48ec66..646b89f 100644
--- a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
+++ b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
@@ -236,6 +236,28 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
const int rank = comm_ptr->rank;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
+ /* We don't pack and unpack in alltoallv as we do in alltoall because alltoallv has
+ more overhead of book keeping for sendcounts/displs and recvcounts/displs. Since,
+ alltoallv is non-rooted and all tasks has type info, decision to punt to mpich
+ will be the same on all tasks */
+
+
+
+ MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rcvtypelen, rdt, rdt_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLTOALLV_INT, rcvtypelen * recvcounts[0], advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Alltoallv(sendbuf, sendcounts, senddispls, sendtype,
+ recvbuf, recvcounts, recvdispls, recvtype,
+ comm_ptr, mpierrno);
+ }
+ }
+ }
if(sendbuf != MPI_IN_PLACE && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
pamidt = 0;
@@ -248,7 +270,6 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
MPIDI_Datatype_get_info(1, sendtype, snd_contig, sndtypelen, sdt, sdt_true_lb);
if(!snd_contig) pamidt = 0;
}
- MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rcvtypelen, rdt, rdt_true_lb);
if(!rcv_contig) pamidt = 0;
diff --git a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
index 45450fb..1c943bd 100644
--- a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
+++ b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
@@ -294,6 +294,18 @@ int MPIDO_Bcast_simple(void *buffer,
int data_size_one;
MPIDI_Datatype_get_info(1, datatype,
data_contig, data_size_one, data_ptr, data_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_BROADCAST, data_size_one * count, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Bcast_intra(buffer, count, datatype, root, comm_ptr, mpierrno);
+ }
+ }
+ }
const int data_size = data_size_one*(size_t)count;
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index b0e1ca2..1226cae 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -379,34 +379,96 @@ int MPIDO_Gather_simple(const void *sendbuf,
MPI_Aint true_lb = 0;
pami_xfer_t gather;
MPIDI_Post_coll_t gather_post;
- int success = 1, contig, send_bytes=-1, recv_bytes = 0;
+ int success = 1, snd_contig = 1, rcv_contig = 1;
+ void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+ void *sbuf = NULL, *rbuf = NULL;
+ int send_size = 0;
+ int recv_size = 0;
+ MPID_Segment segment;
const int rank = comm_ptr->rank;
const int size = comm_ptr->local_size;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
if(sendbuf != MPI_IN_PLACE)
{
- MPIDI_Datatype_get_info(sendcount, sendtype, contig,
- send_bytes, data_ptr, true_lb);
- if (!contig)
- success = 0;
+ MPIDI_Datatype_get_info(sendcount, sendtype, snd_contig,
+ send_size, data_ptr, true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHER, send_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Gather(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+
+ sbuf = (char *)sendbuf + true_lb;
+ if (!snd_contig)
+ {
+ snd_noncontig_buff = MPIU_Malloc(send_size);
+ sbuf = snd_noncontig_buff;
+ if(snd_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ DLOOP_Offset last = send_size;
+ MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0);
+ MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
+ }
+ }
+ else
+ {
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ MPIDI_Datatype_get_info(recvcount, recvtype, rcv_contig,
+ recv_size, data_ptr, true_lb);
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHER, recv_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Gather(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
}
- if (success && rank == root)
+ rbuf = (char *)recvbuf + true_lb;
+ if (rank == root)
{
if (recvtype != MPI_DATATYPE_NULL && recvcount >= 0)
{
- MPIDI_Datatype_get_info(recvcount, recvtype, contig,
- recv_bytes, data_ptr, true_lb);
- if (!contig) success = 0;
+ MPIDI_Datatype_get_info(recvcount, recvtype, rcv_contig,
+ recv_size, data_ptr, true_lb);
+ rbuf = (char *)recvbuf + true_lb;
+ if (!rcv_contig)
+ {
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ }
}
else
success = 0;
}
- MPIDI_Update_last_algorithm(comm_ptr, "GATHER_MPICH");
if(!success)
{
+ MPIDI_Update_last_algorithm(comm_ptr, "GATHER_MPICH");
return MPIR_Gather(sendbuf, sendcount, sendtype,
recvbuf, recvcount, recvtype,
root, comm_ptr, mpierrno);
@@ -419,23 +481,22 @@ int MPIDO_Gather_simple(const void *sendbuf,
gather.cb_done = cb_gather;
gather.cookie = (void *)&active;
gather.cmd.xfer_gather.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
- gather.cmd.xfer_gather.stypecount = send_bytes;/* stypecount is ignored when sndbuf == PAMI_IN_PLACE */
- gather.cmd.xfer_gather.sndbuf = (void *)sendbuf;
+ gather.cmd.xfer_gather.stypecount = send_size;/* stypecount is ignored when sndbuf == PAMI_IN_PLACE */
+ gather.cmd.xfer_gather.sndbuf = (void *)sbuf;
if(sendbuf == MPI_IN_PLACE)
{
gather.cmd.xfer_gather.sndbuf = PAMI_IN_PLACE;
}
gather.cmd.xfer_gather.stype = PAMI_TYPE_BYTE;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
- gather.cmd.xfer_gather.rcvbuf = (void *)recvbuf;
+ gather.cmd.xfer_gather.rcvbuf = (void *)rbuf;
gather.cmd.xfer_gather.rtype = PAMI_TYPE_BYTE;
- gather.cmd.xfer_gather.rtypecount = recv_bytes;
+ gather.cmd.xfer_gather.rtypecount = recv_size;
gather.algorithm = mpid->coll_algorithm[PAMI_XFER_GATHER][0][0];
my_gather_md = &mpid->coll_metadata[PAMI_XFER_GATHER][0][0];
MPIDI_Update_last_algorithm(comm_ptr,
my_gather_md->name);
-
TRACE_ERR("%s gather\n", MPIDI_Process.context_post.active>0?"Posting":"Invoking");
MPIDI_Context_post(MPIDI_Context[0], &gather_post.state,
MPIDI_Pami_post_wrapper, (void *)&gather);
@@ -443,6 +504,14 @@ int MPIDO_Gather_simple(const void *sendbuf,
TRACE_ERR("Waiting on active: %d\n", active);
MPID_PROGRESS_WAIT_WHILE(active);
+ if(!rcv_contig)
+ {
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ recvbuf, recvcount, recvtype);
+ MPIU_Free(rcv_noncontig_buff);
+ }
+ if(!snd_contig) MPIU_Free(snd_noncontig_buff);
+
TRACE_ERR("Leaving MPIDO_Gather_optimized\n");
return MPI_SUCCESS;
}
@@ -473,6 +542,7 @@ MPIDO_CSWrapper_gather(pami_xfer_t *gather,
gather->cmd.xfer_gather.rcvbuf,
gather->cmd.xfer_gather.rtypecount, recvtype,
gather->cmd.xfer_gather.root, comm_ptr, &mpierrno);
+
if(gather->cb_done && rc == 0)
gather->cb_done(NULL, gather->cookie, PAMI_SUCCESS);
return rc;
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index d04b567..ed1034b 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -239,74 +239,141 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
{
TRACE_ERR("Entering MPIDO_Gatherv_optimized\n");
- int rc;
- int contig, rsize=0, ssize=0;
- int pamidt = 1;
- MPID_Datatype *dt_ptr = NULL;
- MPI_Aint send_true_lb, recv_true_lb;
- char *sbuf, *rbuf;
- pami_type_t stype = NULL, rtype;
- int tmp;
+ int snd_contig = 1, rcv_contig = 1;
+ void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+ void *sbuf = NULL, *rbuf = NULL;
+ int *rcounts = NULL;
+ int *rdispls = NULL;
+ int send_size = 0;
+ int recv_size = 0;
+ int rcvlen = 0;
+ int rcvcount = 0;
+ pami_type_t rtype = PAMI_TYPE_NULL;
+ MPID_Segment segment;
+ MPID_Datatype *data_ptr = NULL;
+ int send_true_lb, recv_true_lb = 0;
+ int i, tmp;
volatile unsigned gatherv_active = 1;
const int rank = comm_ptr->rank;
+ const int size = comm_ptr->local_size;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
- /* Check for native PAMI types and MPI_IN_PLACE on sendbuf */
- /* MPI_IN_PLACE is a nonlocal decision. We will need a preallreduce if we ever have
- * multiple "good" gathervs that work on different counts for example */
- if(sendbuf != MPI_IN_PLACE && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
- pamidt = 0;
- if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
- pamidt = 0;
-
- MPIDI_Datatype_get_info(1, recvtype, contig, rsize, dt_ptr, recv_true_lb);
- if(!contig) pamidt = 0;
+ if(sendbuf != MPI_IN_PLACE)
+ {
+ MPIDI_Datatype_get_info(sendcount, sendtype, snd_contig,
+ send_size, data_ptr, send_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, send_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Gatherv(sendbuf, sendcount, sendtype,
+ recvbuf, recvcounts, displs, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+
+ sbuf = (char *)sendbuf + send_true_lb;
+ if (!snd_contig)
+ {
+ snd_noncontig_buff = MPIU_Malloc(send_size);
+ sbuf = snd_noncontig_buff;
+ if(snd_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ DLOOP_Offset last = send_size;
+ MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0);
+ MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
+ }
+ }
+ else
+ {
+ MPIDI_Datatype_get_info(1, recvtype, rcv_contig,
+ rcvlen, data_ptr, recv_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_GATHERV_INT, rcvlen * recvcounts[0], advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Gatherv(sendbuf, sendcount, sendtype,
+ recvbuf, recvcounts, displs, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+ }
- rbuf = (char *)recvbuf + recv_true_lb;
- sbuf = (void *) sendbuf;
pami_xfer_t gatherv;
+ rbuf = (char *)recvbuf + recv_true_lb;
+ rcounts = (int*)recvcounts;
+ rdispls = (int*)displs;
if(rank == root)
{
+ if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
+ {
+ MPIDI_Datatype_get_info(1, recvtype, rcv_contig,
+ rcvlen, data_ptr, recv_true_lb);
+ if (!rcv_contig)
+ {
+ rcounts = (int*)MPIU_Malloc(size);
+ rdispls = (int*)MPIU_Malloc(size);
+ for(i = 0; i < size; i++)
+ {
+ rcounts[i] = rcvlen * recvcounts[i];
+ rdispls[i] = rcvlen * displs[i];
+ recv_size += rcounts[i];
+ rcvcount += recvcounts[i];
+ }
+
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ rtype = PAMI_TYPE_BYTE;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ }
+ }
if(sendbuf == MPI_IN_PLACE)
{
- sbuf = PAMI_IN_PLACE;
+ gatherv.cmd.xfer_gatherv_int.sndbuf = PAMI_IN_PLACE;
}
else
{
- MPIDI_Datatype_get_info(1, sendtype, contig, ssize, dt_ptr, send_true_lb);
- if(!contig) pamidt = 0;
- sbuf = (char *)sbuf + send_true_lb;
+ gatherv.cmd.xfer_gatherv_int.sndbuf = sbuf;
}
- gatherv.cmd.xfer_gatherv_int.stype = stype;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
- gatherv.cmd.xfer_gatherv_int.stypecount = sendcount;
+ gatherv.cmd.xfer_gatherv_int.stype = PAMI_TYPE_BYTE;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
+ gatherv.cmd.xfer_gatherv_int.stypecount = send_size;
}
else
{
- gatherv.cmd.xfer_gatherv_int.stype = stype;
- gatherv.cmd.xfer_gatherv_int.stypecount = sendcount;
+ gatherv.cmd.xfer_gatherv_int.sndbuf = sbuf;
+ gatherv.cmd.xfer_gatherv_int.stype = PAMI_TYPE_BYTE;
+ gatherv.cmd.xfer_gatherv_int.stypecount = send_size;
}
- if(pamidt == 0)
- {
- TRACE_ERR("GATHERV using MPICH\n");
- MPIDI_Update_last_algorithm(comm_ptr, "GATHERV_MPICH");
- return MPIR_Gatherv(sendbuf, sendcount, sendtype,
- recvbuf, recvcounts, displs, recvtype,
- root, comm_ptr, mpierrno);
- }
gatherv.cb_done = cb_gatherv;
gatherv.cookie = (void *)&gatherv_active;
gatherv.cmd.xfer_gatherv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
gatherv.cmd.xfer_gatherv_int.rcvbuf = rbuf;
gatherv.cmd.xfer_gatherv_int.rtype = rtype;
- gatherv.cmd.xfer_gatherv_int.rtypecounts = (int *) recvcounts;
- gatherv.cmd.xfer_gatherv_int.rdispls = (int *) displs;
+ gatherv.cmd.xfer_gatherv_int.rtypecounts = (int *) rcounts;
+ gatherv.cmd.xfer_gatherv_int.rdispls = (int *) rdispls;
- gatherv.cmd.xfer_gatherv_int.sndbuf = sbuf;
const pami_metadata_t *my_gatherv_md;
@@ -324,6 +391,20 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
TRACE_ERR("Waiting on active %d\n", gatherv_active);
MPID_PROGRESS_WAIT_WHILE(gatherv_active);
+ if(!rcv_contig)
+ {
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ recvbuf, rcvcount, recvtype);
+ MPIU_Free(rcv_noncontig_buff);
+ if(rank == root)
+ {
+ MPIU_Free(rcounts);
+ MPIU_Free(rdispls);
+ }
+ }
+ if(!snd_contig) MPIU_Free(snd_noncontig_buff);
+
+
TRACE_ERR("Leaving MPIDO_Gatherv_optimized\n");
return MPI_SUCCESS;
}
@@ -343,7 +424,10 @@ MPIDO_CSWrapper_gatherv(pami_xfer_t *gatherv,
NULL);
if(rc == -1) return rc;
- rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.rtype,
+ if(gatherv->cmd.xfer_gatherv_int.rtype == PAMI_TYPE_NULL)
+ recvtype = MPI_DATATYPE_NULL;
+ else
+ rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.rtype,
&recvtype,
NULL,
NULL);
diff --git a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
index 143ec74..c032354 100644
--- a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
+++ b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
@@ -259,13 +259,26 @@ int MPIDO_Reduce_simple(const void *sendbuf,
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
+ MPIDI_Datatype_get_info(count, datatype, dt_contig, tsize, dt_null, true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_REDUCE, tsize, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, mpierrno);
+ }
+ }
+ }
+
rc = MPIDI_Datatype_to_pami(datatype, &pdt, op, &pop, &mu);
pami_xfer_t reduce;
const pami_metadata_t *my_reduce_md=NULL;
volatile unsigned reduce_active = 1;
- MPIDI_Datatype_get_info(count, datatype, dt_contig, tsize, dt_null, true_lb);
if(rc != MPI_SUCCESS || !dt_contig)
{
return MPIR_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, mpierrno);
diff --git a/src/mpid/pamid/src/coll/scan/mpido_scan.c b/src/mpid/pamid/src/coll/scan/mpido_scan.c
index b9e848e..26d9fc5 100644
--- a/src/mpid/pamid/src/coll/scan/mpido_scan.c
+++ b/src/mpid/pamid/src/coll/scan/mpido_scan.c
@@ -228,12 +228,27 @@ int MPIDO_Doscan_simple(const void *sendbuf, void *recvbuf,
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
- rc = MPIDI_Datatype_to_pami(datatype, &pdt, op, &pop, &mu);
-
pami_xfer_t scan;
volatile unsigned scan_active = 1;
MPIDI_Datatype_get_info(count, datatype, dt_contig, tsize, dt_null, true_lb);
-
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCAN, tsize, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ if(exflag)
+ return MPIR_Exscan(sendbuf, recvbuf, count, datatype, op, comm_ptr, mpierrno);
+ else
+ return MPIR_Scan(sendbuf, recvbuf, count, datatype, op, comm_ptr, mpierrno);
+ }
+ }
+ }
+
+ rc = MPIDI_Datatype_to_pami(datatype, &pdt, op, &pop, &mu);
+
if(rc != MPI_SUCCESS || !dt_contig)
{
if(exflag)
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index e5aad3b..a511f96 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -324,39 +324,98 @@ int MPIDO_Scatter_simple(const void *sendbuf,
int *mpierrno)
{
MPID_Datatype * data_ptr;
- MPI_Aint true_lb = 0;
- int contig, nbytes = 0;
const int rank = comm_ptr->rank;
- int success = 1;
- pami_type_t stype, rtype = NULL;
+ int success = 1, snd_contig = 1, rcv_contig = 1;
+ void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+ void *sbuf = NULL, *rbuf = NULL;
+ size_t send_size = 0;
+ size_t recv_size = 0;
+ MPI_Aint snd_true_lb = 0, rcv_true_lb = 0;
int tmp;
int use_pami = 1;
+ MPID_Segment segment;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
- if(MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS)
- use_pami = 0;
- if(recvbuf != MPI_IN_PLACE && (MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS))
- use_pami = 0;
+ if (rank == root && sendtype != MPI_DATATYPE_NULL && sendcount >= 0)
+ {
+ MPIDI_Datatype_get_info(sendcount, sendtype, snd_contig,
+ send_size, data_ptr, snd_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTER, send_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Scatter(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+ }
+
+ if (recvtype != MPI_DATATYPE_NULL && recvcount >= 0)
+ {
+ MPIDI_Datatype_get_info(recvcount, recvtype, rcv_contig,
+ recv_size, data_ptr, rcv_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTER, recv_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Scatter(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+ }
+ sbuf = (char *)sendbuf + snd_true_lb;
+ rbuf = (char *)recvbuf + rcv_true_lb;
if (rank == root)
{
- if (recvtype != MPI_DATATYPE_NULL && recvcount >= 0)/* Should this be send or recv? */
+ if (send_size)
{
- MPIDI_Datatype_get_info(sendcount, sendtype, contig,
- nbytes, data_ptr, true_lb);
- if (!contig) success = 0;
+ sbuf = (char *)sendbuf + snd_true_lb;
+ if (!snd_contig)
+ {
+ snd_noncontig_buff = MPIU_Malloc(send_size);
+ sbuf = snd_noncontig_buff;
+ if(snd_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ DLOOP_Offset last = send_size;
+ MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0);
+ MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
+ }
}
else
success = 0;
- if (success)
+ if (success && recvbuf != MPI_IN_PLACE)
{
- if (recvtype != MPI_DATATYPE_NULL && recvcount >= 0)
+ if (recv_size)
{
- MPIDI_Datatype_get_info(recvcount, recvtype, contig,
- nbytes, data_ptr, true_lb);
- if (!contig) success = 0;
+ rbuf = (char *)recvbuf + rcv_true_lb;
+ if (!rcv_contig)
+ {
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ }
}
else success = 0;
}
@@ -364,17 +423,25 @@ int MPIDO_Scatter_simple(const void *sendbuf,
else
{
- if (sendtype != MPI_DATATYPE_NULL && sendcount >= 0)/* Should this be send or recv? */
+ if (recv_size)/* Should this be send or recv? */
{
- MPIDI_Datatype_get_info(recvcount, recvtype, contig,
- nbytes, data_ptr, true_lb);
- if (!contig) success = 0;
+ rbuf = (char *)recvbuf + rcv_true_lb;
+ if (!rcv_contig)
+ {
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ }
}
else
success = 0;
}
- if(!use_pami || !success)
+ if(!success)
{
MPIDI_Update_last_algorithm(comm_ptr, "SCATTER_MPICH");
return MPIR_Scatter(sendbuf, sendcount, sendtype,
@@ -394,12 +461,12 @@ int MPIDO_Scatter_simple(const void *sendbuf,
scatter.cb_done = cb_scatter;
scatter.cookie = (void *)&scatter_active;
scatter.cmd.xfer_scatter.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
- scatter.cmd.xfer_scatter.sndbuf = (void *)sendbuf;
- scatter.cmd.xfer_scatter.stype = stype;
- scatter.cmd.xfer_scatter.stypecount = sendcount;
- scatter.cmd.xfer_scatter.rcvbuf = (void *)recvbuf;
- scatter.cmd.xfer_scatter.rtype = rtype;/* rtype is ignored when rcvbuf == PAMI_IN_PLACE */
- scatter.cmd.xfer_scatter.rtypecount = recvcount;
+ scatter.cmd.xfer_scatter.sndbuf = (void *)sbuf;
+ scatter.cmd.xfer_scatter.stype = PAMI_TYPE_BYTE;
+ scatter.cmd.xfer_scatter.stypecount = send_size;
+ scatter.cmd.xfer_scatter.rcvbuf = (void *)rbuf;
+ scatter.cmd.xfer_scatter.rtype = PAMI_TYPE_BYTE;/* rtype is ignored when rcvbuf == PAMI_IN_PLACE */
+ scatter.cmd.xfer_scatter.rtypecount = recv_size;
if(recvbuf == MPI_IN_PLACE)
{
@@ -413,6 +480,14 @@ int MPIDO_Scatter_simple(const void *sendbuf,
TRACE_ERR("Waiting on active %d\n", scatter_active);
MPID_PROGRESS_WAIT_WHILE(scatter_active);
+ if(!rcv_contig)
+ {
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ recvbuf, recvcount, recvtype);
+ MPIU_Free(rcv_noncontig_buff);
+ }
+ if(!snd_contig) MPIU_Free(snd_noncontig_buff);
+
TRACE_ERR("Leaving MPIDO_Scatter_optimized\n");
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index 51b01ec..f868c00 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -446,52 +446,115 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
{
int snd_contig = 1;
int rcv_contig = 1;
- int tmp, pamidt = 1;
- int ssize, rsize;
+ int send_size = 0, recv_size = 0;
+ int ssize = 0;
MPID_Datatype *dt_ptr = NULL;
MPI_Aint send_true_lb=0, recv_true_lb=0;
- char *sbuf, *rbuf;
- pami_type_t stype, rtype = NULL;
+ void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+ void *sbuf = NULL, *rbuf = NULL;
+ int *sdispls = NULL, *scounts = NULL;
+ int sndlen = 0;
+ int sndcount = 0;
+ MPID_Segment segment;
+ int tmp, i;
+ pami_type_t stype = PAMI_TYPE_NULL;
const int rank = comm_ptr->rank;
+ const int size = comm_ptr->local_size;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
+ if (rank == root && sendtype != MPI_DATATYPE_NULL && sendcounts[0] >= 0)
+ {
+ MPIDI_Datatype_get_info(1, sendtype, snd_contig, ssize, dt_ptr, send_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, ssize * sendcounts[0], advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Scatterv(sendbuf, sendcounts, displs, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+ }
+
+ if (recvtype != MPI_DATATYPE_NULL && recvcount >= 0)
+ {
+ MPIDI_Datatype_get_info(recvcount, recvtype, rcv_contig,
+ recv_size, dt_ptr, recv_true_lb);
+ if(MPIDI_Pamix_collsel_advise != NULL)
+ {
+ advisor_algorithm_t advisor_algorithms[1];
+ int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_SCATTERV_INT, recv_size, advisor_algorithms, 1);
+ if(num_algorithms)
+ {
+ if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
+ {
+ return MPIR_Scatterv(sendbuf, sendcounts, displs, sendtype,
+ recvbuf, recvcount, recvtype,
+ root, comm_ptr, mpierrno);
+ }
+ }
+ }
+ }
+
pami_xfer_t scatterv;
const pami_metadata_t *my_scatterv_md;
volatile unsigned scatterv_active = 1;
-
- if((recvbuf != MPI_IN_PLACE) && MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
- pamidt = 0;
-
- if(MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS)
- pamidt = 0;
- MPIDI_Datatype_get_info(1, sendtype, snd_contig, ssize, dt_ptr, send_true_lb);
- if(recvbuf != MPI_IN_PLACE)
- MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rsize, dt_ptr, recv_true_lb);
-
- if(pamidt == 0 || !snd_contig || !rcv_contig)
+ sbuf = (char *)sendbuf + send_true_lb;
+ rbuf = (char *)recvbuf + recv_true_lb;
+ scounts = (int*)sendcounts;
+ sdispls = (int*)displs;
+ if(rank == root)
{
- TRACE_ERR("Scatterv using MPICH\n");
- MPIDI_Update_last_algorithm(comm_ptr, "SCATTERV_MPICH");
- return MPIR_Scatterv(sendbuf, sendcounts, displs, sendtype,
- recvbuf, recvcount, recvtype,
- root, comm_ptr, mpierrno);
+ if(MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS)
+ {
+ if (!snd_contig)
+ {
+ scounts = (int*)MPIU_Malloc(size);
+ sdispls = (int*)MPIU_Malloc(size);
+ for(i = 0; i < size; i++)
+ {
+ scounts[i] = ssize * sendcounts[i];
+ sdispls[i] = ssize * displs[i];
+ send_size += scounts[i];
+ sndcount += sendcounts[i];
+ }
+ snd_noncontig_buff = MPIU_Malloc(send_size);
+ sbuf = snd_noncontig_buff;
+ stype = PAMI_TYPE_BYTE;
+ if(snd_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ DLOOP_Offset last = send_size;
+ MPID_Segment_init(sendbuf, sndcount, sendtype, &segment, 0);
+ MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
+ }
+ }
+ if(recvbuf == MPI_IN_PLACE)
+ {
+ rbuf = PAMI_IN_PLACE;
+ }
}
-
- sbuf = (char *)sendbuf + send_true_lb;
- rbuf = recvbuf;
-
- if(rank == root)
+ if(recvbuf != MPI_IN_PLACE)
{
- if(recvbuf == MPI_IN_PLACE)
- {
- rbuf = PAMI_IN_PLACE;
- }
- else
- {
- rbuf = (char *)recvbuf + recv_true_lb;
- }
+ if (!rcv_contig)
+ {
+ rcv_noncontig_buff = MPIU_Malloc(recv_size);
+ rbuf = rcv_noncontig_buff;
+ if(rcv_noncontig_buff == NULL)
+ {
+ MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+ "Fatal: Cannot allocate pack buffer");
+ }
+ }
}
scatterv.cb_done = cb_scatterv;
@@ -504,10 +567,10 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
scatterv.cmd.xfer_scatterv_int.rcvbuf = rbuf;
scatterv.cmd.xfer_scatterv_int.sndbuf = sbuf;
scatterv.cmd.xfer_scatterv_int.stype = stype;
- scatterv.cmd.xfer_scatterv_int.rtype = rtype;/* rtype is ignored when rcvbuf == PAMI_IN_PLACE */
- scatterv.cmd.xfer_scatterv_int.stypecounts = (int *) sendcounts;
- scatterv.cmd.xfer_scatterv_int.rtypecount = recvcount;
- scatterv.cmd.xfer_scatterv_int.sdispls = (int *) displs;
+ scatterv.cmd.xfer_scatterv_int.rtype = PAMI_TYPE_BYTE;/* rtype is ignored when rcvbuf == PAMI_IN_PLACE */
+ scatterv.cmd.xfer_scatterv_int.stypecounts = (int *) scounts;
+ scatterv.cmd.xfer_scatterv_int.rtypecount = recv_size;
+ scatterv.cmd.xfer_scatterv_int.sdispls = (int *) sdispls;
MPIDI_Update_last_algorithm(comm_ptr, my_scatterv_md->name);
@@ -521,6 +584,19 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
TRACE_ERR("Waiting on active %d\n", scatterv_active);
MPID_PROGRESS_WAIT_WHILE(scatterv_active);
+ if(!rcv_contig)
+ {
+ MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
+ recvbuf, recvcount, recvtype);
+ MPIU_Free(rcv_noncontig_buff);
+ }
+ if(!snd_contig)
+ {
+ MPIU_Free(snd_noncontig_buff);
+ MPIU_Free(scounts);
+ MPIU_Free(sdispls);
+ }
+
TRACE_ERR("Leaving MPIDO_Scatterv_optimized\n");
return MPI_SUCCESS;
}
@@ -530,12 +606,17 @@ int
MPIDO_CSWrapper_scatterv(pami_xfer_t *scatterv,
void *comm)
{
- int mpierrno = 0;
+ int mpierrno = 0, rc = 0;
MPID_Comm *comm_ptr = (MPID_Comm*)comm;
MPI_Datatype sendtype, recvtype;
void *rbuf;
MPIDI_coll_check_in_place(scatterv->cmd.xfer_scatterv_int.rcvbuf, &rbuf);
- int rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.stype,
+ /* Since collective selection in PAMI fixes message size when selecting the
+ algorithm, this wrapper function may be called back from PAMI */
+ if(PAMI_TYPE_NULL == scatterv->cmd.xfer_scatterv_int.stype)
+ sendtype = MPI_DATATYPE_NULL;
+ else
+ rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.stype,
&sendtype,
NULL,
NULL);
diff --git a/src/mpid/pamid/src/comm/mpid_comm.c b/src/mpid/pamid/src/comm/mpid_comm.c
index 844f0cd..1de14a0 100644
--- a/src/mpid/pamid/src/comm/mpid_comm.c
+++ b/src/mpid/pamid/src/comm/mpid_comm.c
@@ -391,6 +391,19 @@ void MPIDI_Coll_comm_destroy(MPID_Comm *comm)
MPIU_TestFree(&comm->mpid.coll_metadata[i][1]);
}
+
+ if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE)
+ {
+ /* Destroy the fast query object. */
+ pami_extension_collsel_query_destroy pamix_collsel_query_destroy =
+ (pami_extension_collsel_query_destroy) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_query_destroy");
+ if(pamix_collsel_query_destroy != NULL)
+ {
+ pamix_collsel_query_destroy(&(comm->mpid.collsel_fast_query));
+ }
+ }
+
TRACE_ERR("Destroying geometry\n");
geom_destroy_post.client = MPIDI_Client;
diff --git a/src/mpid/pamid/src/comm/mpid_selectcolls.c b/src/mpid/pamid/src/comm/mpid_selectcolls.c
index 834542f..886dbd8 100644
--- a/src/mpid/pamid/src/comm/mpid_selectcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_selectcolls.c
@@ -35,7 +35,7 @@ external_algorithm_t ext_algorithm;
ext_algorithms[0].algorithm.external = ext_algorithm; \
ext_algorithms[0].metadata = &ext_metadata; \
ext_algorithms[0].algorithm_type = COLLSEL_EXTERNAL_ALGO; \
- collsel_register_algorithms(MPIDI_Collsel_advisor_table, \
+ pamix_collsel_register_algorithms(MPIDI_Collsel_advisor_table, \
comm->mpid.geometry, \
xfer_type, \
&ext_algorithms[0], \
@@ -481,10 +481,23 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
it, then use auto coll sel.. Otherwise, go through the manual coll sel code path. */
if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE)
{
- pami_extension_collsel_register_algorithms collsel_register_algorithms =
+ /* Create a fast query object, cache it on the comm/geometry and use it in each collective */
+ pami_extension_collsel_query_create pamix_collsel_query_create =
+ (pami_extension_collsel_query_create) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_query_create");
+ if(pamix_collsel_query_create != NULL)
+ {
+ pamix_collsel_query_create(MPIDI_Collsel_advisor_table, comm->mpid.geometry, &(comm->mpid.collsel_fast_query));
+ }
+
+ MPIDI_Pamix_collsel_advise = /* Get the function pointer and cache it */
+ (pami_extension_collsel_advise) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_advise");
+
+ pami_extension_collsel_register_algorithms pamix_collsel_register_algorithms =
(pami_extension_collsel_register_algorithms) PAMI_Extension_symbol(MPIDI_Collsel_extension,
"Collsel_register_algorithms");
- if(collsel_register_algorithms != NULL)
+ if(pamix_collsel_register_algorithms != NULL)
{
/* ************ Barrier ************ */
diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 5fbba71..022a2fd 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -282,6 +282,7 @@ advisor_t MPIDI_Collsel_advisor;
advisor_table_t MPIDI_Collsel_advisor_table;
advisor_params_t MPIDI_Collsel_advisor_params;
char *MPIDI_Collsel_output_file;
+pami_extension_collsel_advise MPIDI_Pamix_collsel_advise;
static void
MPIDI_PAMI_client_init(int* rank, int* size, int* mpidi_dynamic_tasking, char **world_tasks)
{
http://git.mpich.org/mpich.git/commitdiff/f4f0de65736a8abf6c96b727e87b082992616cf5
commit f4f0de65736a8abf6c96b727e87b082992616cf5
Author: sssharka <sssharka at us.ibm.com>
Date: Fri Jan 25 21:07:57 2013 -0500
External algorithm registration for collective selection
(ibm) F183421
(ibm) 6463405fd65ec7a45b137334c7608d30f8c29055
Signed-off-by: Bob Cernohous <bobc at us.ibm.com>
diff --git a/src/mpid/pamid/include/mpidi_constants.h b/src/mpid/pamid/include/mpidi_constants.h
index be0d18c..a16292e 100644
--- a/src/mpid/pamid/include/mpidi_constants.h
+++ b/src/mpid/pamid/include/mpidi_constants.h
@@ -113,6 +113,7 @@ enum
MPID_AUTO_SELECT_COLLS_SCAN = ((int)((MPID_AUTO_SELECT_COLLS_REDUCE << 1) & 0xFFFFFFFF)),
MPID_AUTO_SELECT_COLLS_SCATTER = ((int)((MPID_AUTO_SELECT_COLLS_SCAN << 1) & 0xFFFFFFFF)),
MPID_AUTO_SELECT_COLLS_SCATTERV = ((int)((MPID_AUTO_SELECT_COLLS_SCATTER << 1) & 0xFFFFFFFF)),
+ MPID_AUTO_SELECT_COLLS_TUNE = 0x80000000,
MPID_AUTO_SELECT_COLLS_ALL = 0xFFFFFFFF,
};
diff --git a/src/mpid/pamid/include/mpidi_datatypes.h b/src/mpid/pamid/include/mpidi_datatypes.h
index 3dd8b9a..dc87146 100644
--- a/src/mpid/pamid/include/mpidi_datatypes.h
+++ b/src/mpid/pamid/include/mpidi_datatypes.h
@@ -442,5 +442,119 @@ struct MPIDI_Win
} sync;
};
+/**
+ * \brief Structures and typedefs for collective selection extensions in PAMI
+ */
+
+typedef void* advisor_t;
+typedef void* advisor_table_t;
+typedef void* advisor_attribute_name_t;
+
+typedef union
+{
+ size_t intval;
+ double doubleval;
+ const char * chararray;
+ const size_t * intarray;
+} advisor_attribute_value_t;
+
+typedef struct
+{
+ advisor_attribute_name_t name;
+ advisor_attribute_value_t value;
+} advisor_configuration_t;
+
+typedef struct {
+ pami_xfer_type_t *collectives;
+ size_t num_collectives;
+ size_t *procs_per_node;
+ size_t num_procs_per_node;
+ size_t *geometry_sizes;
+ size_t num_geometry_sizes;
+ size_t *message_sizes;
+ size_t num_message_sizes;
+ int iter;
+ int verify;
+ int verbose;
+ int checkpoint;
+} advisor_params_t;
+
+typedef enum
+{
+ COLLSEL_ALGO = 0, /* 'Always works' PAMI algorithm */
+ COLLSEL_QUERY_ALGO, /* 'Must query' PAMI algorithm */
+ COLLSEL_EXTERNAL_ALGO, /* External algorithm */
+} advisor_algorithm_type_t;
+
+/* External algorithm callback function */
+typedef pami_result_t (*external_algorithm_fn)(pami_xfer_t *, void *);
+
+typedef struct
+{
+ external_algorithm_fn callback;
+ void *cookie;
+} external_algorithm_t;
+
+typedef struct
+{
+ union
+ {
+ pami_algorithm_t internal;/* PAMI Algorithm */
+ external_algorithm_t external;/* External Algorithm */
+ } algorithm;
+ pami_metadata_t *metadata;
+ advisor_algorithm_type_t algorithm_type;
+} advisor_algorithm_t;
+
+
+typedef pami_result_t (*pami_extension_collsel_init) (pami_client_t,
+ advisor_configuration_t [],
+ size_t,
+ pami_context_t [],
+ size_t,
+ advisor_t *);
+
+typedef pami_result_t (*pami_extension_collsel_destroy) (advisor_t *);
+
+typedef int (*pami_extension_collsel_initialized) (pami_client_t, advisor_t *);
+
+typedef pami_result_t (*pami_extension_collsel_table_load) (advisor_t,
+ char *,
+ advisor_table_t *);
+
+typedef pami_result_t (*pami_extension_collsel_get_collectives) (advisor_table_t,
+ pami_xfer_type_t **,
+ unsigned *);
+
+typedef pami_result_t (*pami_extension_collsel_register_algorithms) (advisor_table_t,
+ pami_geometry_t,
+ pami_xfer_type_t,
+ advisor_algorithm_t *,
+ size_t);
+
+typedef pami_result_t (*external_geometry_create_fn)(pami_geometry_range_t* task_slices,
+ size_t slice_count,
+ pami_geometry_t *geometry,
+ void **cookie);
+
+typedef pami_result_t (*external_geometry_destroy_fn)(void *cookie);
+
+typedef pami_result_t (*external_register_algorithms_fn)(void *cookie,
+ pami_xfer_type_t collective,
+ advisor_algorithm_t **algorithms,
+ size_t *num_algorithms);
+
+typedef struct
+{
+ external_geometry_create_fn geometry_create;
+ external_geometry_destroy_fn geometry_destroy;
+ external_register_algorithms_fn register_algorithms;
+} external_geometry_ops_t;
+
+typedef pami_result_t (*pami_extension_collsel_table_generate) (advisor_t,
+ char *,
+ advisor_params_t *,
+ external_geometry_ops_t *,
+ int);
#endif
diff --git a/src/mpid/pamid/include/mpidi_externs.h b/src/mpid/pamid/include/mpidi_externs.h
index cb64f00..f9a9683 100644
--- a/src/mpid/pamid/include/mpidi_externs.h
+++ b/src/mpid/pamid/include/mpidi_externs.h
@@ -34,5 +34,10 @@ extern pami_context_t MPIDI_Context[];
extern MPIDI_Process_t MPIDI_Process;
+extern advisor_table_t MPIDI_Collsel_advisor_table;
+extern pami_extension_t MPIDI_Collsel_extension;
+extern advisor_params_t MPIDI_Collsel_advisor_params;
+extern char *MPIDI_Collsel_output_file;
+
#endif
diff --git a/src/mpid/pamid/include/mpidi_prototypes.h b/src/mpid/pamid/include/mpidi_prototypes.h
index e40baa3..55566f2 100644
--- a/src/mpid/pamid/include/mpidi_prototypes.h
+++ b/src/mpid/pamid/include/mpidi_prototypes.h
@@ -217,6 +217,17 @@ void MPIDI_Coll_comm_destroy (MPID_Comm *comm);
void MPIDI_Env_setup ();
void MPIDI_Comm_world_setup ();
+pami_result_t MPIDI_Comm_create_from_pami_geom(pami_geometry_range_t *task_slices,
+ size_t slice_count,
+ pami_geometry_t *geometry,
+ void **cookie);
+pami_result_t MPIDI_Comm_destroy_external(void *comm_ext);
+pami_result_t MPIDI_Register_algorithms_ext(void *cookie,
+ pami_xfer_type_t collective,
+ advisor_algorithm_t **algorithms,
+ size_t *num_algorithms);
+int MPIDI_collsel_pami_tune_parse_params(int argc, char ** argv);
+void MPIDI_collsel_pami_tune_cleanup();
void MPIDI_Coll_Comm_create (MPID_Comm *comm);
void MPIDI_Coll_Comm_destroy(MPID_Comm *comm);
void MPIDI_Comm_coll_query (MPID_Comm *comm);
@@ -226,23 +237,28 @@ void MPIDI_Coll_register (void);
int MPIDO_Bcast(void *buffer, int count, MPI_Datatype dt, int root, MPID_Comm *comm_ptr, int *mpierrno);
int MPIDO_Bcast_simple(void *buffer, int count, MPI_Datatype dt, int root, MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_bcast(pami_xfer_t *bcast, void *comm);
int MPIDO_Barrier(MPID_Comm *comm_ptr, int *mpierrno);
int MPIDO_Barrier_simple(MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_barrier(pami_xfer_t *barrier, void *comm);
int MPIDO_Allreduce(const void *sbuffer, void *rbuffer, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *mpierrno);
int MPIDO_Allreduce_simple(const void *sbuffer, void *rbuffer, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_allreduce(pami_xfer_t *allreduce, void *comm);
int MPIDO_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, MPID_Comm *comm_ptr, int *mpierrno);
int MPIDO_Reduce_simple(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_reduce(pami_xfer_t *reduce, void *comm);
int MPIDO_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *mpierrno);
int MPIDO_Allgather_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_allgather(pami_xfer_t *allgather, void *comm);
int MPIDO_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
@@ -250,6 +266,7 @@ int MPIDO_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIDO_Allgatherv_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_allgatherv(pami_xfer_t *allgatherv, void *comm);
int MPIDO_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, MPID_Comm * comm_ptr,
@@ -261,6 +278,7 @@ int MPIDO_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIDO_Gather_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_gather(pami_xfer_t *gather, void *comm);
int MPIDO_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
@@ -268,11 +286,13 @@ int MPIDO_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIDO_Gatherv_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
int root, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_gatherv(pami_xfer_t *gatherv, void *comm);
int MPIDO_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm * comm_ptr, int *mpierrno);
int MPIDO_Scan_simple(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_scan(pami_xfer_t *scan, void *comm);
int MPIDO_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm * comm_ptr, int *mpierrno);
@@ -285,6 +305,7 @@ int MPIDO_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIDO_Scatter_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_scatter(pami_xfer_t *scatter, void *comm);
int MPIDO_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
MPI_Datatype sendtype,
@@ -294,6 +315,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf, const int *sendcounts, const int
MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPID_Comm * comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_scatterv(pami_xfer_t *scatterv, void *comm);
int MPIDO_Alltoallv(const void *sendbuf, const int *sendcounts, const int *senddispls,
MPI_Datatype sendtype,
@@ -305,6 +327,7 @@ int MPIDO_Alltoallv_simple(const void *sendbuf, const int *sendcounts, const int
void *recvbuf, const int *recvcounts, const int *recvdispls,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_alltoallv(pami_xfer_t *alltoallv, void *comm);
int MPIDO_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
@@ -312,12 +335,18 @@ int MPIDO_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPIDO_Alltoall_simple(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *mpierrno);
+int MPIDO_CSWrapper_alltoall(pami_xfer_t *alltoall, void *comm);
int MPIDI_Datatype_to_pami(MPI_Datatype dt,
pami_type_t *pdt,
MPI_Op op,
pami_data_function *pop,
int *musupport);
+
+int MPIDI_Dtpami_to_dtmpi(pami_type_t pdt,
+ MPI_Datatype *dt,
+ pami_data_function pop,
+ MPI_Op *op);
void MPIDI_Op_to_string(MPI_Op op, char *string);
pami_result_t MPIDI_Pami_post_wrapper(pami_context_t context, void *cookie);
diff --git a/src/mpid/pamid/include/mpidimpl.h b/src/mpid/pamid/include/mpidimpl.h
index 8e5d24f..aef965a 100644
--- a/src/mpid/pamid/include/mpidimpl.h
+++ b/src/mpid/pamid/include/mpidimpl.h
@@ -29,6 +29,20 @@
#include <mpix.h>
+
+static inline void MPIDI_coll_check_in_place(void* src, void** dst)
+{
+ if(MPI_IN_PLACE == PAMI_IN_PLACE)
+ *dst = src;
+ else
+ {
+ if(src == PAMI_IN_PLACE)
+ *dst = MPI_IN_PLACE;
+ else
+ *dst = src;
+ }
+}
+
#ifdef DYNAMIC_TASKING
#define MPIDI_MAX_KVS_VALUE_LEN 4096
diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index a63c91f..bb9ecf3 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -685,3 +685,37 @@ MPIDO_Allgather_simple(const void *sendbuf,
TRACE_ERR("Allgather done\n");
return MPI_SUCCESS;
}
+
+
+int
+MPIDO_CSWrapper_allgather(pami_xfer_t *allgather,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(allgather->cmd.xfer_allgather.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( allgather->cmd.xfer_allgather.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( allgather->cmd.xfer_allgather.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Allgather(sbuf,
+ allgather->cmd.xfer_allgather.stypecount, sendtype,
+ allgather->cmd.xfer_allgather.rcvbuf,
+ allgather->cmd.xfer_allgather.rtypecount, recvtype,
+ comm_ptr, &mpierrno);
+ if(allgather->cb_done && rc == 0)
+ allgather->cb_done(NULL, allgather->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
index b01f4db..fbf826f 100644
--- a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
+++ b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
@@ -705,3 +705,39 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
return MPI_SUCCESS;
}
+
+
+int
+MPIDO_CSWrapper_allgatherv(pami_xfer_t *allgatherv,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(allgatherv->cmd.xfer_allgatherv_int.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( allgatherv->cmd.xfer_allgatherv_int.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( allgatherv->cmd.xfer_allgatherv_int.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Allgatherv(sbuf,
+ allgatherv->cmd.xfer_allgatherv_int.stypecount, sendtype,
+ allgatherv->cmd.xfer_allgatherv_int.rcvbuf,
+ allgatherv->cmd.xfer_allgatherv_int.rtypecounts,
+ allgatherv->cmd.xfer_allgatherv_int.rdispls, recvtype,
+ comm_ptr, &mpierrno);
+ if(allgatherv->cb_done && rc == 0)
+ allgatherv->cb_done(NULL, allgatherv->cookie, PAMI_SUCCESS);
+ return rc;
+
+
+}
+
diff --git a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
index 9edab4e..ff7ca70 100644
--- a/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
+++ b/src/mpid/pamid/src/coll/allreduce/mpido_allreduce.c
@@ -465,3 +465,30 @@ int MPIDO_Allreduce_simple(const void *sendbuf,
TRACE_ERR("Allreduce done\n");
return MPI_SUCCESS;
}
+
+int
+MPIDO_CSWrapper_allreduce(pami_xfer_t *allreduce,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype type;
+ MPI_Op op;
+ void *sbuf;
+ MPIDI_coll_check_in_place(allreduce->cmd.xfer_allreduce.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( allreduce->cmd.xfer_allreduce.stype,
+ &type,
+ allreduce->cmd.xfer_allreduce.op,
+ &op);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Allreduce(sbuf,
+ allreduce->cmd.xfer_allreduce.rcvbuf,
+ allreduce->cmd.xfer_allreduce.rtypecount,
+ type, op, comm_ptr, &mpierrno);
+ if(allreduce->cb_done && rc == 0)
+ allreduce->cb_done(NULL, allreduce->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
index 5b33afb..ba4f2a0 100644
--- a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
+++ b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
@@ -290,3 +290,37 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
TRACE_ERR("Leaving MPIDO_Alltoall_optimized\n");
return MPI_SUCCESS;
}
+
+
+int
+MPIDO_CSWrapper_alltoall(pami_xfer_t *alltoall,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(alltoall->cmd.xfer_alltoall.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( alltoall->cmd.xfer_alltoall.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( alltoall->cmd.xfer_alltoall.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Alltoall_intra(sbuf,
+ alltoall->cmd.xfer_alltoall.stypecount, sendtype,
+ alltoall->cmd.xfer_alltoall.rcvbuf,
+ alltoall->cmd.xfer_alltoall.rtypecount, recvtype,
+ comm_ptr, &mpierrno);
+ if(alltoall->cb_done && rc == 0)
+ alltoall->cb_done(NULL, alltoall->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
index 87a6df1..e48ec66 100644
--- a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
+++ b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
@@ -297,3 +297,38 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
return MPI_SUCCESS;
}
+
+int
+MPIDO_CSWrapper_alltoallv(pami_xfer_t *alltoallv,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(alltoallv->cmd.xfer_alltoallv_int.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( alltoallv->cmd.xfer_alltoallv_int.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( alltoallv->cmd.xfer_alltoallv_int.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Alltoallv(sbuf,
+ alltoallv->cmd.xfer_alltoallv_int.stypecounts,
+ alltoallv->cmd.xfer_alltoallv_int.sdispls, sendtype,
+ alltoallv->cmd.xfer_alltoallv_int.rcvbuf,
+ alltoallv->cmd.xfer_alltoallv_int.rtypecounts,
+ alltoallv->cmd.xfer_alltoallv_int.rdispls, recvtype,
+ comm_ptr, &mpierrno);
+ if(alltoallv->cb_done && rc == 0)
+ alltoallv->cb_done(NULL, alltoallv->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/barrier/mpido_barrier.c b/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
index 23e5e6d..e4df53d 100644
--- a/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
+++ b/src/mpid/pamid/src/coll/barrier/mpido_barrier.c
@@ -130,3 +130,17 @@ int MPIDO_Barrier_simple(MPID_Comm *comm_ptr, int *mpierrno)
TRACE_ERR("Exiting MPIDO_Barrier_optimized\n");
return 0;
}
+
+int
+MPIDO_CSWrapper_barrier(pami_xfer_t *barrier,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ int rc = MPIR_Barrier(comm_ptr, &mpierrno);
+ if(barrier->cb_done && rc == 0)
+ barrier->cb_done(NULL, barrier->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
index e86696e..45450fb 100644
--- a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
+++ b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
@@ -346,3 +346,26 @@ int MPIDO_Bcast_simple(void *buffer,
TRACE_ERR("Exiting MPIDO_Bcast_optimized\n");
return 0;
}
+
+
+int
+MPIDO_CSWrapper_bcast(pami_xfer_t *bcast,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype type;
+ int rc = MPIDI_Dtpami_to_dtmpi( bcast->cmd.xfer_broadcast.type,
+ &type,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Bcast_intra(bcast->cmd.xfer_broadcast.buf,
+ bcast->cmd.xfer_broadcast.typecount, type,
+ bcast->cmd.xfer_broadcast.root, comm_ptr, &mpierrno);
+ if(bcast->cb_done && rc == 0)
+ bcast->cb_done(NULL, bcast->cookie, PAMI_SUCCESS);
+ return rc;
+}
+
diff --git a/src/mpid/pamid/src/coll/coll_utils.c b/src/mpid/pamid/src/coll/coll_utils.c
index 582c922..fcbbf95 100644
--- a/src/mpid/pamid/src/coll/coll_utils.c
+++ b/src/mpid/pamid/src/coll/coll_utils.c
@@ -72,6 +72,11 @@ pami_result_t MPIDI_Pami_post_wrapper(pami_context_t context, void *cookie)
(x) == MPI_DOUBLE_INT || (x) == MPI_LONG_INT || \
(x) == MPI_2INT || (x) == MPI_SHORT_INT || \
(x) == MPI_LONG_DOUBLE_INT )
+
+#define isPAMI_LOC_TYPE(x) ( (x) == PAMI_TYPE_LOC_2INT || (x) == PAMI_TYPE_LOC_FLOAT_INT || \
+ (x) == PAMI_TYPE_LOC_DOUBLE_INT || (x) == PAMI_TYPE_LOC_SHORT_INT || \
+ (x) == PAMI_TYPE_LOC_LONG_INT || (x) == PAMI_TYPE_LOC_LONGDOUBLE_INT || \
+ (x) == PAMI_TYPE_LOC_2FLOAT || (x) == PAMI_TYPE_LOC_2DOUBLE )
#define isBOOL(x) ( (x) == MPI_C_BOOL )
@@ -263,3 +268,132 @@ int MPIDI_Datatype_to_pami(MPI_Datatype dt,
return MPI_SUCCESS;
}
+
+int MPIDI_Dtpami_to_dtmpi( pami_type_t pdt,
+ MPI_Datatype *dt,
+ pami_data_function pop,
+ MPI_Op *op)
+{
+ *dt = MPI_DATATYPE_NULL;
+ if(pop != NULL)
+ *op = MPI_OP_NULL;
+
+ if(pdt == PAMI_TYPE_SIGNED_INT) *dt = MPI_INT;
+ else if(pdt == PAMI_TYPE_UNSIGNED_INT) *dt = MPI_UNSIGNED;
+ else if(pdt == PAMI_TYPE_FLOAT) *dt = MPI_FLOAT;
+ else if(pdt == PAMI_TYPE_DOUBLE) *dt = MPI_DOUBLE;
+ else if(pdt == PAMI_TYPE_LONG_DOUBLE) *dt = MPI_LONG_DOUBLE;
+ else if(pdt == PAMI_TYPE_SIGNED_CHAR) *dt = MPI_CHAR;
+ else if(pdt == PAMI_TYPE_UNSIGNED_CHAR) *dt = MPI_UNSIGNED_CHAR;
+ else if(pdt == PAMI_TYPE_BYTE) *dt = MPI_BYTE;
+ else if(pdt == PAMI_TYPE_SIGNED_SHORT) *dt = MPI_SHORT;
+ else if(pdt == PAMI_TYPE_UNSIGNED_SHORT) *dt = MPI_UNSIGNED_SHORT;
+ else if(pdt == PAMI_TYPE_SIGNED_LONG_LONG) *dt = MPI_LONG_LONG;
+ else if(pdt == PAMI_TYPE_UNSIGNED_LONG_LONG) *dt = MPI_UNSIGNED_LONG_LONG;
+ else if(pdt == PAMI_TYPE_SINGLE_COMPLEX) *dt = MPI_C_FLOAT_COMPLEX;
+ else if(pdt == PAMI_TYPE_DOUBLE_COMPLEX) *dt = MPI_C_DOUBLE_COMPLEX;
+ else if(isPAMI_LOC_TYPE(pdt))
+ {
+ if(pdt == PAMI_TYPE_LOC_2INT) *dt = MPI_2INT;
+ else if(pdt == PAMI_TYPE_LOC_FLOAT_INT) *dt = MPI_FLOAT_INT;
+ else if(pdt == PAMI_TYPE_LOC_DOUBLE_INT) *dt = MPI_DOUBLE_INT;
+ else if(pdt == PAMI_TYPE_LOC_SHORT_INT) *dt = MPI_SHORT_INT;
+ else if(pdt == PAMI_TYPE_LOC_LONG_INT) *dt = MPI_LONG_INT;
+ else if(pdt == PAMI_TYPE_LOC_LONGDOUBLE_INT)*dt = MPI_LONG_DOUBLE_INT;
+ else if(pdt == PAMI_TYPE_LOC_2FLOAT) *dt = MPI_2REAL;
+ else if(pdt == PAMI_TYPE_LOC_2DOUBLE) *dt = MPI_2DOUBLE_PRECISION;
+
+ if(pop == NULL) return MPI_SUCCESS;
+ if(pop == PAMI_DATA_MINLOC)
+ {
+ *op = MPI_MINLOC;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_MAXLOC)
+ {
+ *op = MPI_MAXLOC;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_COPY)
+ {
+ *op = MPI_REPLACE;
+ return MPI_SUCCESS;
+ }
+ else return -1;
+ }
+ else if(pdt == PAMI_TYPE_LOGICAL4)
+ {
+ *dt = MPI_LOGICAL;
+ if(pop == NULL) return MPI_SUCCESS;
+ if(pop == PAMI_DATA_LOR)
+ {
+ *op = MPI_LOR;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_LAND)
+ {
+ *op = MPI_LAND;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_LXOR)
+ {
+ *op = MPI_LXOR;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_COPY)
+ {
+ *op = MPI_REPLACE;
+ return MPI_SUCCESS;
+ }
+ return -1;
+ }
+ else if(pdt == PAMI_TYPE_LOGICAL1)
+ {
+ *dt = MPI_C_BOOL;
+ if(pop == NULL) return MPI_SUCCESS;
+ if(pop == PAMI_DATA_LOR)
+ {
+ *op = MPI_LOR;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_LAND)
+ {
+ *op = MPI_LAND;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_LXOR)
+ {
+ *op = MPI_LXOR;
+ return MPI_SUCCESS;
+ }
+ if(pop == PAMI_DATA_COPY)
+ {
+ *op = MPI_REPLACE;
+ return MPI_SUCCESS;
+ }
+ return -1;
+ }
+
+
+ if(*dt == MPI_DATATYPE_NULL) return -1;
+
+ if(pop == NULL) return MPI_SUCCESS; /* just doing DT conversion */
+
+ *op = MPI_OP_NULL;
+ if(pop == PAMI_DATA_SUM) *op = MPI_SUM;
+ else if(pop ==PAMI_DATA_PROD) *op = MPI_PROD;
+ else if(pop ==PAMI_DATA_MAX) *op = MPI_MAX;
+ else if(pop ==PAMI_DATA_MIN) *op = MPI_MIN;
+ else if(pop ==PAMI_DATA_BAND) *op = MPI_BAND;
+ else if(pop ==PAMI_DATA_BOR) *op = MPI_BOR;
+ else if(pop ==PAMI_DATA_BXOR) *op = MPI_BXOR;
+ else if(pop ==PAMI_DATA_LAND) *op = MPI_LAND;
+ else if(pop ==PAMI_DATA_LOR) *op = MPI_LOR;
+ else if(pop ==PAMI_DATA_LXOR) *op = MPI_LXOR;
+ else if(pop ==PAMI_DATA_COPY) *op = MPI_REPLACE;
+
+ if(*op == MPI_OP_NULL) return -1;
+
+ return MPI_SUCCESS;
+}
+
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index acdca25..b0e1ca2 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -446,3 +446,36 @@ int MPIDO_Gather_simple(const void *sendbuf,
TRACE_ERR("Leaving MPIDO_Gather_optimized\n");
return MPI_SUCCESS;
}
+
+int
+MPIDO_CSWrapper_gather(pami_xfer_t *gather,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(gather->cmd.xfer_gather.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( gather->cmd.xfer_gather.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( gather->cmd.xfer_gather.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Gather(sbuf,
+ gather->cmd.xfer_gather.stypecount, sendtype,
+ gather->cmd.xfer_gather.rcvbuf,
+ gather->cmd.xfer_gather.rtypecount, recvtype,
+ gather->cmd.xfer_gather.root, comm_ptr, &mpierrno);
+ if(gather->cb_done && rc == 0)
+ gather->cb_done(NULL, gather->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index 1645f44..d04b567 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -298,10 +298,6 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
root, comm_ptr, mpierrno);
}
-
-
-
-
gatherv.cb_done = cb_gatherv;
gatherv.cookie = (void *)&gatherv_active;
gatherv.cmd.xfer_gatherv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
@@ -331,3 +327,37 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
TRACE_ERR("Leaving MPIDO_Gatherv_optimized\n");
return MPI_SUCCESS;
}
+
+int
+MPIDO_CSWrapper_gatherv(pami_xfer_t *gatherv,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *sbuf;
+ MPIDI_coll_check_in_place(gatherv->cmd.xfer_gatherv_int.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( gatherv->cmd.xfer_gatherv_int.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Gatherv(sbuf,
+ gatherv->cmd.xfer_gatherv_int.stypecount, sendtype,
+ gatherv->cmd.xfer_gatherv_int.rcvbuf,
+ gatherv->cmd.xfer_gatherv_int.rtypecounts,
+ gatherv->cmd.xfer_gatherv_int.rdispls, recvtype,
+ gatherv->cmd.xfer_gatherv_int.root, comm_ptr, &mpierrno);
+ if(gatherv->cb_done && rc == 0)
+ gatherv->cb_done(NULL, gatherv->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
index 45fb05c..143ec74 100644
--- a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
+++ b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
@@ -305,3 +305,32 @@ int MPIDO_Reduce_simple(const void *sendbuf,
TRACE_ERR("Reduce done\n");
return MPI_SUCCESS;
}
+
+
+int
+MPIDO_CSWrapper_reduce(pami_xfer_t *reduce,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype type;
+ MPI_Op op;
+ void *sbuf;
+ MPIDI_coll_check_in_place(reduce->cmd.xfer_reduce.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( reduce->cmd.xfer_reduce.stype,
+ &type,
+ reduce->cmd.xfer_reduce.op,
+ &op);
+ if(rc == -1) return rc;
+
+
+ rc = MPIR_Reduce(sbuf,
+ reduce->cmd.xfer_reduce.rcvbuf,
+ reduce->cmd.xfer_reduce.rtypecount, type, op,
+ reduce->cmd.xfer_reduce.root, comm_ptr, &mpierrno);
+ if(reduce->cb_done && rc == 0)
+ reduce->cb_done(NULL, reduce->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/scan/mpido_scan.c b/src/mpid/pamid/src/coll/scan/mpido_scan.c
index f47cb81..b9e848e 100644
--- a/src/mpid/pamid/src/coll/scan/mpido_scan.c
+++ b/src/mpid/pamid/src/coll/scan/mpido_scan.c
@@ -292,3 +292,36 @@ int MPIDO_Scan_simple(const void *sendbuf, void *recvbuf,
return MPIDO_Doscan_simple(sendbuf, recvbuf, count, datatype,
op, comm_ptr, mpierrno, 0);
}
+
+int
+MPIDO_CSWrapper_scan(pami_xfer_t *scan,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype type;
+ MPI_Op op;
+ void *sbuf;
+ MPIDI_coll_check_in_place(scan->cmd.xfer_scan.sndbuf, &sbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( scan->cmd.xfer_scan.stype,
+ &type,
+ scan->cmd.xfer_scan.op,
+ &op);
+ if(rc == -1) return rc;
+
+ if(scan->cmd.xfer_scan.exclusive)
+ rc = MPIR_Exscan(sbuf,
+ scan->cmd.xfer_scan.rcvbuf,
+ scan->cmd.xfer_scan.rtypecount, type, op,
+ comm_ptr, &mpierrno);
+ else
+ rc = MPIR_Scan(sbuf,
+ scan->cmd.xfer_scan.rcvbuf,
+ scan->cmd.xfer_scan.rtypecount, type, op,
+ comm_ptr, &mpierrno);
+ if(scan->cb_done && rc == 0)
+ scan->cb_done(NULL, scan->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index 082c316..e5aad3b 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -420,6 +420,38 @@ int MPIDO_Scatter_simple(const void *sendbuf,
}
+int
+MPIDO_CSWrapper_scatter(pami_xfer_t *scatter,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *rbuf;
+ MPIDI_coll_check_in_place(scatter->cmd.xfer_scatter.rcvbuf, &rbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( scatter->cmd.xfer_scatter.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( scatter->cmd.xfer_scatter.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Scatter(scatter->cmd.xfer_scatter.sndbuf,
+ scatter->cmd.xfer_scatter.stypecount, sendtype,
+ rbuf,
+ scatter->cmd.xfer_scatter.rtypecount, recvtype,
+ scatter->cmd.xfer_scatter.root, comm_ptr, &mpierrno);
+ if(scatter->cb_done && rc == 0)
+ scatter->cb_done(NULL, scatter->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
#if 0 /* old glue-based scatter-via-bcast */
/* Assume glue protocol sucks for now.... Needs work if not or to enable */
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index 508739a..51b01ec 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -499,7 +499,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
scatterv.cmd.xfer_scatterv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
scatterv.algorithm = mpid->coll_algorithm[PAMI_XFER_SCATTERV_INT][0][0];
- my_scatterv_md = &mpid->coll_metadata[PAMI_XFER_SCATTERV][0][0];
+ my_scatterv_md = &mpid->coll_metadata[PAMI_XFER_SCATTERV_INT][0][0];
scatterv.cmd.xfer_scatterv_int.rcvbuf = rbuf;
scatterv.cmd.xfer_scatterv_int.sndbuf = sbuf;
@@ -526,6 +526,40 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
}
+int
+MPIDO_CSWrapper_scatterv(pami_xfer_t *scatterv,
+ void *comm)
+{
+ int mpierrno = 0;
+ MPID_Comm *comm_ptr = (MPID_Comm*)comm;
+ MPI_Datatype sendtype, recvtype;
+ void *rbuf;
+ MPIDI_coll_check_in_place(scatterv->cmd.xfer_scatterv_int.rcvbuf, &rbuf);
+ int rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.stype,
+ &sendtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIDI_Dtpami_to_dtmpi( scatterv->cmd.xfer_scatterv_int.rtype,
+ &recvtype,
+ NULL,
+ NULL);
+ if(rc == -1) return rc;
+
+ rc = MPIR_Scatterv(scatterv->cmd.xfer_scatterv_int.sndbuf,
+ scatterv->cmd.xfer_scatterv_int.stypecounts,
+ scatterv->cmd.xfer_scatterv_int.sdispls, sendtype,
+ rbuf,
+ scatterv->cmd.xfer_scatterv_int.rtypecount, recvtype,
+ scatterv->cmd.xfer_scatterv_int.root, comm_ptr, &mpierrno);
+ if(scatterv->cb_done && rc == 0)
+ scatterv->cb_done(NULL, scatterv->cookie, PAMI_SUCCESS);
+ return rc;
+
+}
+
+
#if 0
/* remove the glue-based optimized scattervs for now. */
diff --git a/src/mpid/pamid/src/comm/mpid_comm.c b/src/mpid/pamid/src/comm/mpid_comm.c
index 989dc19..844f0cd 100644
--- a/src/mpid/pamid/src/comm/mpid_comm.c
+++ b/src/mpid/pamid/src/comm/mpid_comm.c
@@ -50,6 +50,93 @@ int MPIDI_Comm_destroy (MPID_Comm *comm)
return MPI_SUCCESS;
}
+pami_result_t MPIDI_Comm_create_from_pami_geom(pami_geometry_range_t *task_slices,
+ size_t slice_count,
+ pami_geometry_t *geometry,
+ void **cookie)
+{
+ int mpi_errno = MPI_SUCCESS;
+ int num_tasks = 0;
+ int *ranks = NULL;
+ MPID_Comm *comm_ptr = NULL, *new_comm_ptr = NULL;
+ MPID_Group *group_ptr = NULL, *new_group_ptr = NULL;
+ int i = 0, j = 0;
+ MPIR_Context_id_t new_context_id = 0;
+ int *mapping = NULL;
+
+ /* Get comm_ptr for MPI_COMM_WORLD and get the group_ptr for it */
+ MPID_Comm_get_ptr( MPI_COMM_WORLD, comm_ptr );
+ mpi_errno = MPIR_Comm_group_impl(comm_ptr, &group_ptr);
+ if (mpi_errno)
+ {
+ TRACE_ERR("Error while creating group_ptr from MPI_COMM_WORLD in MPIDI_Comm_create_from_pami_geom\n");
+ return PAMI_ERROR;
+ }
+
+ /* Create the ranks list from the pami_geometry_range_t array */
+ for(i = 0; i < slice_count; i++)
+ {
+ num_tasks += (task_slices[i].hi - task_slices[i].lo) + 1;
+ }
+ ranks = MPIU_Calloc0(num_tasks, int);
+ for(i = 0; i < slice_count; i++)
+ {
+ int slice_sz = (task_slices[i].hi - task_slices[i].lo) + 1;
+ int k = 0;
+ for(k = 0; k < slice_sz; k++)
+ {
+ ranks[j] = task_slices[i].lo + k;
+ j++;
+ }
+ }
+
+ /* Now we have all we need to create the new group. Create it */
+ mpi_errno = MPIR_Group_incl_impl(group_ptr, num_tasks, ranks, &new_group_ptr);
+ if (mpi_errno)
+ {
+ TRACE_ERR("Error while creating new_group_ptr from group_ptr in MPIDI_Comm_create_from_pami_geom\n");
+ return PAMI_ERROR;
+ }
+
+ /* Now create the communicator using the new_group_ptr */
+ mpi_errno = MPIR_Comm_create_intra(comm_ptr, new_group_ptr, &new_comm_ptr);
+ if (mpi_errno)
+ {
+ TRACE_ERR("Error while creating new_comm_ptr from group_ptr in MPIDI_Comm_create_from_pami_geom\n");
+ return PAMI_ERROR;
+ }
+
+ if(new_comm_ptr)
+ {
+ /* Get the geometry from the communicator and set the out parameters */
+ *geometry = new_comm_ptr->mpid.geometry;
+ *cookie = new_comm_ptr;
+ }
+ else
+ {
+ *geometry = PAMI_GEOMETRY_NULL;
+ *cookie = NULL;
+ }
+
+ /* Cleanup */
+ MPIU_TestFree(&ranks);
+
+ return PAMI_SUCCESS;
+}
+
+pami_result_t MPIDI_Comm_destroy_external(void *comm_ext)
+{
+ int mpi_errno = 0;
+ MPID_Comm* comm_ptr = (MPID_Comm*)comm_ext;
+ mpi_errno = MPIR_Comm_free_impl(comm_ptr);
+ if (mpi_errno)
+ {
+ TRACE_ERR("Error while destroying comm_ptr in MPIDI_Comm_destroy_external\n");
+ return PAMI_ERROR;
+ }
+ return PAMI_SUCCESS;
+}
+
typedef struct MPIDI_Post_geom_create
{
pami_work_t state;
@@ -289,6 +376,15 @@ void MPIDI_Coll_comm_destroy(MPID_Comm *comm)
for(i=0;i<PAMI_XFER_COUNT;i++)
{
TRACE_ERR("Freeing algo/meta %d\n", i);
+ /* When allocating comm->mpid.coll_algorithm, we skip allocations for
+ AM collectives. Also there is no explicit initialization of
+ comm->mpid.coll_algorithm to NULLs. This may cause MPIU_TestFree to
+ cause problems when freeing. We skip AM collectives here as we skip
+ allocating them in MPIDI_Comm_coll_query */
+ if(i == PAMI_XFER_AMBROADCAST || i == PAMI_XFER_AMSCATTER ||
+ i == PAMI_XFER_AMGATHER || i == PAMI_XFER_AMREDUCE)
+ continue;
+
MPIU_TestFree(&comm->mpid.coll_algorithm[i][0]);
MPIU_TestFree(&comm->mpid.coll_algorithm[i][1]);
MPIU_TestFree(&comm->mpid.coll_metadata[i][0]);
diff --git a/src/mpid/pamid/src/comm/mpid_selectcolls.c b/src/mpid/pamid/src/comm/mpid_selectcolls.c
index d4c50df..834542f 100644
--- a/src/mpid/pamid/src/comm/mpid_selectcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_selectcolls.c
@@ -24,6 +24,68 @@
#include <mpidimpl.h>
+pami_metadata_t ext_metadata;
+advisor_algorithm_t ext_algorithms[1];
+external_algorithm_t ext_algorithm;
+
+#define MPIDI_UPDATE_COLLSEL_EXT_ALGO(cb,nm,xfer_type) { \
+ ext_algorithm.callback = cb; \
+ ext_algorithm.cookie = comm; \
+ ext_metadata.name = nm; \
+ ext_algorithms[0].algorithm.external = ext_algorithm; \
+ ext_algorithms[0].metadata = &ext_metadata; \
+ ext_algorithms[0].algorithm_type = COLLSEL_EXTERNAL_ALGO; \
+ collsel_register_algorithms(MPIDI_Collsel_advisor_table, \
+ comm->mpid.geometry, \
+ xfer_type, \
+ &ext_algorithms[0], \
+ 1); \
+}
+
+
+pami_result_t MPIDI_Register_algorithms_ext(void *cookie,
+ pami_xfer_type_t collective,
+ advisor_algorithm_t **algorithms,
+ size_t *num_algorithms)
+{
+ external_algorithm_fn callback;
+ char *algoname;
+
+ switch(collective)
+ {
+ case PAMI_XFER_BROADCAST: callback = MPIDO_CSWrapper_bcast; algoname = "EXT:Bcast:P2P:P2P"; break;
+ case PAMI_XFER_ALLREDUCE: callback = MPIDO_CSWrapper_allreduce; algoname = "EXT:Allreduce:P2P:P2P"; break;
+ case PAMI_XFER_REDUCE: callback = MPIDO_CSWrapper_reduce; algoname = "EXT:Reduce:P2P:P2P"; break;
+ case PAMI_XFER_ALLGATHER: callback = MPIDO_CSWrapper_allgather; algoname = "EXT:Allgather:P2P:P2P"; break;
+ case PAMI_XFER_ALLGATHERV_INT: callback = MPIDO_CSWrapper_allgatherv; algoname = "EXT:Allgatherv:P2P:P2P"; break;
+ case PAMI_XFER_SCATTER: callback = MPIDO_CSWrapper_scatter; algoname = "EXT:Scatter:P2P:P2P"; break;
+ case PAMI_XFER_SCATTERV_INT: callback = MPIDO_CSWrapper_scatterv; algoname = "EXT:Scatterv:P2P:P2P"; break;
+ case PAMI_XFER_GATHER: callback = MPIDO_CSWrapper_gather; algoname = "EXT:Gather:P2P:P2P"; break;
+ case PAMI_XFER_GATHERV_INT: callback = MPIDO_CSWrapper_gatherv; algoname = "EXT:Gatherv:P2P:P2P"; break;
+ case PAMI_XFER_BARRIER: callback = MPIDO_CSWrapper_barrier; algoname = "EXT:Barrier:P2P:P2P"; break;
+ case PAMI_XFER_ALLTOALL: callback = MPIDO_CSWrapper_alltoall; algoname = "EXT:Alltoall:P2P:P2P"; break;
+ case PAMI_XFER_ALLTOALLV_INT: callback = MPIDO_CSWrapper_alltoallv; algoname = "EXT:Alltoallv:P2P:P2P"; break;
+ case PAMI_XFER_SCAN: callback = MPIDO_CSWrapper_scan; algoname = "EXT:Scan:P2P:P2P"; break;
+ case PAMI_XFER_ALLGATHERV:
+ case PAMI_XFER_SCATTERV:
+ case PAMI_XFER_GATHERV:
+ case PAMI_XFER_ALLTOALLV:
+ case PAMI_XFER_REDUCE_SCATTER:
+ *num_algorithms = 0;
+ return PAMI_SUCCESS;
+ default: return -1;
+ }
+ *num_algorithms = 1;
+ ext_algorithm.callback = callback;
+ ext_algorithm.cookie = cookie;
+ ext_metadata.name = algoname;
+ ext_algorithms[0].algorithm.external = ext_algorithm;
+ ext_algorithms[0].metadata = &ext_metadata;
+ ext_algorithms[0].algorithm_type = COLLSEL_EXTERNAL_ALGO;
+ *algorithms = &ext_algorithms[0];
+ return PAMI_SUCCESS;
+}
+
static char* MPIDI_Coll_type_name(int i)
{
switch(i)
@@ -417,89 +479,106 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
/* If automatic collective selection is enabled and user didn't specifically overwrite
it, then use auto coll sel.. Otherwise, go through the manual coll sel code path. */
- /* ************ Barrier ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_BARRIER) &&
- comm->mpid.user_selected_type[PAMI_XFER_BARRIER] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Barrier = MPIDO_Barrier_simple;
- }
- /* ************ Bcast ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_BCAST) &&
- comm->mpid.user_selected_type[PAMI_XFER_BROADCAST] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Bcast = MPIDO_Bcast_simple;
- }
- /* ************ Allreduce ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLREDUCE) &&
- comm->mpid.user_selected_type[PAMI_XFER_ALLREDUCE] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Allreduce = MPIDO_Allreduce_simple;
- }
- /* ************ Allgather ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLGATHER) &&
- comm->mpid.user_selected_type[PAMI_XFER_ALLGATHER] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Allgather = MPIDO_Allgather_simple;
- }
- /* ************ Allgatherv ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLGATHERV) &&
- comm->mpid.user_selected_type[PAMI_XFER_ALLGATHERV_INT] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Allgatherv = MPIDO_Allgatherv_simple;
- }
- /* ************ Scatterv ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCATTERV) &&
- comm->mpid.user_selected_type[PAMI_XFER_SCATTERV_INT] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Scatterv = MPIDO_Scatterv_simple;
- }
- /* ************ Scatter ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCATTER) &&
- comm->mpid.user_selected_type[PAMI_XFER_SCATTER] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Scatter = MPIDO_Scatter_simple;
- }
- /* ************ Gather ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_GATHER) &&
- comm->mpid.user_selected_type[PAMI_XFER_GATHER] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Gather = MPIDO_Gather_simple;
- }
- /* ************ Alltoallv ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLTOALLV) &&
- comm->mpid.user_selected_type[PAMI_XFER_ALLTOALLV_INT] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Alltoallv = MPIDO_Alltoallv_simple;
- }
- /* ************ Alltoall ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLTOALL) &&
- comm->mpid.user_selected_type[PAMI_XFER_ALLTOALL] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Alltoall = MPIDO_Alltoall_simple;
- }
- /* ************ Gatherv ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_GATHERV) &&
- comm->mpid.user_selected_type[PAMI_XFER_GATHERV_INT] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Gatherv = MPIDO_Gatherv_simple;
- }
- /* ************ Reduce ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_REDUCE) &&
- comm->mpid.user_selected_type[PAMI_XFER_REDUCE] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Reduce = MPIDO_Reduce_simple;
- }
- /* ************ Scan ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCAN) &&
- comm->mpid.user_selected_type[PAMI_XFER_SCAN] == MPID_COLL_NOSELECTION)
+ if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE)
{
- comm->coll_fns->Scan = MPIDO_Scan_simple;
- }
- /* ************ Exscan ************ */
- if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_EXSCAN) &&
- comm->mpid.user_selected_type[PAMI_XFER_SCAN] == MPID_COLL_NOSELECTION)
- {
- comm->coll_fns->Exscan = MPIDO_Exscan_simple;
+ pami_extension_collsel_register_algorithms collsel_register_algorithms =
+ (pami_extension_collsel_register_algorithms) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_register_algorithms");
+ if(collsel_register_algorithms != NULL)
+ {
+
+ /* ************ Barrier ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_BARRIER) &&
+ comm->mpid.user_selected_type[PAMI_XFER_BARRIER] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Barrier = MPIDO_Barrier_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_barrier,"EXT:Barrier:P2P:P2P",PAMI_XFER_BARRIER);
+ }
+ /* ************ Bcast ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_BCAST) &&
+ comm->mpid.user_selected_type[PAMI_XFER_BROADCAST] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Bcast = MPIDO_Bcast_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_bcast,"EXT:Bcast:P2P:P2P",PAMI_XFER_BROADCAST);
+ }
+ /* ************ Allreduce ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLREDUCE) &&
+ comm->mpid.user_selected_type[PAMI_XFER_ALLREDUCE] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Allreduce = MPIDO_Allreduce_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_allreduce,"EXT:Allreduce:P2P:P2P",PAMI_XFER_ALLREDUCE);
+ }
+ /* ************ Allgather ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLGATHER) &&
+ comm->mpid.user_selected_type[PAMI_XFER_ALLGATHER] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Allgather = MPIDO_Allgather_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_allgather,"EXT:Allgather:P2P:P2P",PAMI_XFER_ALLGATHER);
+ }
+ /* ************ Allgatherv ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLGATHERV) &&
+ comm->mpid.user_selected_type[PAMI_XFER_ALLGATHERV_INT] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Allgatherv = MPIDO_Allgatherv_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_allgatherv,"EXT:Allgatherv:P2P:P2P",PAMI_XFER_ALLGATHERV_INT);
+ }
+ /* ************ Scatterv ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCATTERV) &&
+ comm->mpid.user_selected_type[PAMI_XFER_SCATTERV_INT] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Scatterv = MPIDO_Scatterv_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_scatterv,"EXT:Scatterv:P2P:P2P",PAMI_XFER_SCATTERV_INT);
+ }
+ /* ************ Scatter ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCATTER) &&
+ comm->mpid.user_selected_type[PAMI_XFER_SCATTER] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Scatter = MPIDO_Scatter_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_scatter,"EXT:Scatter:P2P:P2P",PAMI_XFER_SCATTER);
+ }
+ /* ************ Gather ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_GATHER) &&
+ comm->mpid.user_selected_type[PAMI_XFER_GATHER] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Gather = MPIDO_Gather_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_gather,"EXT:Gather:P2P:P2P",PAMI_XFER_GATHER);
+ }
+ /* ************ Alltoallv ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLTOALLV) &&
+ comm->mpid.user_selected_type[PAMI_XFER_ALLTOALLV_INT] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Alltoallv = MPIDO_Alltoallv_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_alltoallv,"EXT:Alltoallv:P2P:P2P",PAMI_XFER_ALLTOALLV_INT);
+ }
+ /* ************ Alltoall ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_ALLTOALL) &&
+ comm->mpid.user_selected_type[PAMI_XFER_ALLTOALL] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Alltoall = MPIDO_Alltoall_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_alltoall,"EXT:Alltoall:P2P:P2P",PAMI_XFER_ALLTOALL);
+ }
+ /* ************ Gatherv ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_GATHERV) &&
+ comm->mpid.user_selected_type[PAMI_XFER_GATHERV_INT] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Gatherv = MPIDO_Gatherv_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_gatherv,"EXT:Gatherv:P2P:P2P",PAMI_XFER_GATHERV_INT);
+ }
+ /* ************ Reduce ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_REDUCE) &&
+ comm->mpid.user_selected_type[PAMI_XFER_REDUCE] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Reduce = MPIDO_Reduce_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_reduce,"EXT:Reduce:P2P:P2P",PAMI_XFER_REDUCE);
+ }
+ /* ************ Scan ************ */
+ if((MPIDI_Process.optimized.auto_select_colls & MPID_AUTO_SELECT_COLLS_SCAN) &&
+ comm->mpid.user_selected_type[PAMI_XFER_SCAN] == MPID_COLL_NOSELECTION)
+ {
+ comm->coll_fns->Scan = MPIDO_Scan_simple;
+ MPIDI_UPDATE_COLLSEL_EXT_ALGO(MPIDO_CSWrapper_scan,"EXT:Scan:P2P:P2P",PAMI_XFER_SCAN);
+ }
+ }
}
TRACE_ERR("MPIDI_Comm_coll_envvars exit\n");
}
diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 39d54af..5fbba71 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -45,8 +45,8 @@ int mpidi_dynamic_tasking = 0;
pami_extension_t pe_extension;
#endif
-pami_client_t MPIDI_Client;
-pami_context_t MPIDI_Context[MPIDI_MAX_CONTEXTS];
+pami_client_t MPIDI_Client;
+pami_context_t MPIDI_Context[MPIDI_MAX_CONTEXTS];
MPIDI_Process_t MPIDI_Process = {
.verbose = 0,
@@ -274,6 +274,14 @@ static struct
#endif
};
+/* ------------------------------ */
+/* Collective selection extension */
+/* ------------------------------ */
+pami_extension_t MPIDI_Collsel_extension;
+advisor_t MPIDI_Collsel_advisor;
+advisor_table_t MPIDI_Collsel_advisor_table;
+advisor_params_t MPIDI_Collsel_advisor_params;
+char *MPIDI_Collsel_output_file;
static void
MPIDI_PAMI_client_init(int* rank, int* size, int* mpidi_dynamic_tasking, char **world_tasks)
{
@@ -385,6 +393,145 @@ MPIDI_PAMI_client_init(int* rank, int* size, int* mpidi_dynamic_tasking, char **
}
}
+void MPIDI_Init_collsel_extension()
+{
+ pami_result_t status = PAMI_ERROR;
+ status = PAMI_Extension_open (MPIDI_Client, "EXT_collsel", &MPIDI_Collsel_extension);
+ if(status == PAMI_SUCCESS)
+ {
+ if(MPIDI_Process.optimized.auto_select_colls == MPID_AUTO_SELECT_COLLS_TUNE)
+ {
+ advisor_configuration_t configuration[1];
+ pami_extension_collsel_init pamix_collsel_init =
+ (pami_extension_collsel_init) PAMI_Extension_symbol (MPIDI_Collsel_extension, "Collsel_init");
+ status = pamix_collsel_init (MPIDI_Client, configuration, 1, &MPIDI_Context[0], 1, &MPIDI_Collsel_advisor);
+ if(status != PAMI_SUCCESS)
+ {
+ fprintf (stderr, "Error. The collsel_init failed. result = %d\n", status);
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ }
+
+ }
+ else if(MPIDI_Process.optimized.auto_select_colls == MPID_AUTO_SELECT_COLLS_ALL)
+ {
+ pami_extension_collsel_initialized pamix_collsel_initialized =
+ (pami_extension_collsel_initialized) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_initialized");
+ if(pamix_collsel_initialized(MPIDI_Client, &MPIDI_Collsel_advisor) == 1)
+ {
+ char *collselfile;
+ collselfile = getenv("MP_COLLECTIVE_SELECTION_FILE");
+ pami_extension_collsel_table_load pamix_collsel_table_load =
+ (pami_extension_collsel_table_load) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_table_load");
+ if(collselfile != NULL)
+ status = pamix_collsel_table_load(MPIDI_Collsel_advisor, collselfile, &MPIDI_Collsel_advisor_table);
+ else
+ status = pamix_collsel_table_load(MPIDI_Collsel_advisor, "pami_tune_results.xml", &MPIDI_Collsel_advisor_table);
+ if (status == PAMI_SUCCESS)
+ {
+ pami_xfer_type_t *collsel_collectives = NULL;
+ unsigned num_collectives;
+ pami_extension_collsel_get_collectives pamix_collsel_get_collectives =
+ (pami_extension_collsel_get_collectives) PAMI_Extension_symbol(MPIDI_Collsel_extension,
+ "Collsel_get_collectives");
+ status = pamix_collsel_get_collectives(MPIDI_Collsel_advisor_table, &collsel_collectives, &num_collectives);
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ if(collsel_collectives != NULL)
+ {
+ unsigned i = 0;
+ for(i = 0; i < num_collectives; i++)
+ {
+ switch(collsel_collectives[i])
+ {
+ case PAMI_XFER_BROADCAST:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_BCAST;
+ break;
+ case PAMI_XFER_ALLREDUCE:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_ALLREDUCE;
+ break;
+ case PAMI_XFER_REDUCE:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_REDUCE;
+ break;
+ case PAMI_XFER_ALLGATHER:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_ALLGATHER;
+ break;
+ case PAMI_XFER_ALLGATHERV:
+ case PAMI_XFER_ALLGATHERV_INT:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_ALLGATHERV;
+ break;
+ case PAMI_XFER_SCATTER:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_SCATTER;
+ break;
+ case PAMI_XFER_SCATTERV:
+ case PAMI_XFER_SCATTERV_INT:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_SCATTERV;
+ break;
+ case PAMI_XFER_GATHER:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_GATHER;
+ break;
+ case PAMI_XFER_GATHERV:
+ case PAMI_XFER_GATHERV_INT:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_GATHERV;
+ break;
+ case PAMI_XFER_BARRIER:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_BARRIER;
+ break;
+ case PAMI_XFER_ALLTOALL:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_ALLTOALL;
+ break;
+ case PAMI_XFER_ALLTOALLV:
+ case PAMI_XFER_ALLTOALLV_INT:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_ALLTOALLV;
+ break;
+ case PAMI_XFER_SCAN:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_SCAN;
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_EXSCAN;
+ break;
+ case PAMI_XFER_REDUCE_SCATTER:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_REDUCE_SCATTER;
+ break;
+ default:
+ MPIDI_Process.optimized.auto_select_colls |= MPID_AUTO_SELECT_COLLS_NONE;
+ }
+ }
+ MPIU_Free(collsel_collectives);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "Error. Collsel_table_load failed. result = %d\n", status);
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ }
+ }
+ else
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ }
+ else
+ PAMI_Extension_close(MPIDI_Collsel_extension);
+ }
+ else
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+}
+
+void MPIDI_Collsel_table_generate()
+{
+ external_geometry_ops_t external_ops;
+ external_ops.geometry_create = MPIDI_Comm_create_from_pami_geom;
+ external_ops.geometry_destroy = MPIDI_Comm_destroy_external;
+ external_ops.register_algorithms = MPIDI_Register_algorithms_ext;
+ pami_result_t status = PAMI_SUCCESS;
+ pami_extension_collsel_table_generate pamix_collsel_table_generate =
+ (pami_extension_collsel_table_generate) PAMI_Extension_symbol (MPIDI_Collsel_extension, "Collsel_table_generate");
+
+ status = pamix_collsel_table_generate (MPIDI_Collsel_advisor, MPIDI_Collsel_output_file, &MPIDI_Collsel_advisor_params, &external_ops, 1);
+ if(status != PAMI_SUCCESS)
+ {
+ fprintf (stderr, "Error. The collsel_table_generate failed. result = %d\n", status);
+ }
+
+}
+
static void
MPIDI_PAMI_context_init(int* threading, int *size)
@@ -494,7 +641,7 @@ MPIDI_PAMI_context_init(int* threading, int *size)
#ifdef MPIDI_TRACE
- int i;
+ int i;
MPIDI_Trace_buf = MPIU_Calloc0(numTasks, MPIDI_Trace_buf_t);
if(MPIDI_Trace_buf == NULL) MPID_abort();
memset((void *) MPIDI_Trace_buf,0, sizeof(MPIDI_Trace_buf_t));
@@ -529,6 +676,14 @@ MPIDI_PAMI_context_init(int* threading, int *size)
rc = PAMI_Context_createv(MPIDI_Client, config, cfgval, MPIDI_Context, MPIDI_Process.avail_contexts);
MPID_assert_always(rc == PAMI_SUCCESS);
+
+ /* --------------------------------------------- */
+ /* Get collective selection advisor and cache it */
+ /* --------------------------------------------- */
+ /* Context is created, i.e. collective selection extension is initialized in PAMI. Now I can get the
+ advisor if I am not in TUNE mode. If in TUNE mode, I can init collsel and generate the table */
+ MPIDI_Init_collsel_extension();
+
#if (MPIDI_STATISTICS || MPIDI_PRINTENV)
MPIDI_open_pe_extension();
#endif
@@ -731,7 +886,7 @@ MPIDI_PAMI_init(int* rank, int* size, int* threading)
MPIDI_Process.rma_pending,
MPIDI_Process.shmem_pt2pt,
MPIDI_Process.disable_internal_eager_scale,
-#if TOKEN_FLOW_CONTROL
+#if TOKEN_FLOW_CONTROL
MPIDI_Process.mp_buf_mem,
MPIDI_Process.mp_buf_mem_max,
MPIDI_Process.is_token_flow_control_on,
@@ -1089,6 +1244,26 @@ int MPID_Init(int * argc,
MPIDI_Print_mpenv(rank,size);
}
#endif
+ /* ----------------------------------------------- */
+ /* parse params for pami_tune if in benchmark mode */
+ /* ----------------------------------------------- */
+ if(MPIDI_Process.optimized.auto_select_colls == MPID_AUTO_SELECT_COLLS_TUNE)
+ {
+ if(argc != NULL && argv != NULL)
+ {
+ if(MPIDI_collsel_pami_tune_parse_params(*argc, *argv) != PAMI_SUCCESS)
+ {
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ }
+ }
+ else
+ {
+ if(MPIDI_collsel_pami_tune_parse_params(0, NULL) != PAMI_SUCCESS)
+ {
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
+ }
+ }
+ }
return MPI_SUCCESS;
}
@@ -1100,6 +1275,14 @@ int MPID_InitCompleted()
{
MPIDI_NBC_init();
MPIDI_Progress_init();
+ /* ----------------------------------------------- */
+ /* Now all is ready.. call table generate */
+ /* ----------------------------------------------- */
+ if(MPIDI_Process.optimized.auto_select_colls == MPID_AUTO_SELECT_COLLS_TUNE)
+ {
+ MPIDI_Collsel_table_generate();
+ MPIDI_collsel_pami_tune_cleanup();
+ }
return MPI_SUCCESS;
}
@@ -1182,7 +1365,7 @@ int MPIDI_Banner(char * bufPtr) {
MPIU_Free(tmx);
return MPI_SUCCESS;
}
-#endif
+#endif
static inline void
diff --git a/src/mpid/pamid/src/mpidi_env.c b/src/mpid/pamid/src/mpidi_env.c
index 3e25f06..f08acb7 100644
--- a/src/mpid/pamid/src/mpidi_env.c
+++ b/src/mpid/pamid/src/mpidi_env.c
@@ -456,7 +456,9 @@ ENV_Char__(char* name[], unsigned* val, char* string)
break;
}
- if ((env[0]=='y')|| (env[0]=='Y')|| (env[0]=='p')|| (env[0]=='P') || (env[0]=='F')|| (env[0]=='f'))
+ if ( (env[0]=='y')|| (env[0]=='Y')
+ || (env[0]=='p')|| (env[0]=='P')
+ || (env[0]=='F')|| (env[0]=='f'))
*val = 1;
/*This may seem redundant; however,
in some cases we need to force val=0 if value = no/none*/
@@ -864,22 +866,35 @@ MPIDI_Env_setup(int rank, int requested)
/* Finally, if MP_COLLECTIVE_SELECTION is "on", then we want to overwrite any other setting */
{
- unsigned temp;
- temp = 0;
- char* names[] = {"MP_COLLECTIVE_SELECTION", NULL};
- ENV_Char(names, &temp);
- if(temp)
+ char *env = getenv("MP_COLLECTIVE_SELECTION");
+ if(env != NULL)
{
pami_extension_t extension;
pami_result_t status = PAMI_ERROR;
status = PAMI_Extension_open (MPIDI_Client, "EXT_collsel", &extension);
if(status == PAMI_SUCCESS)
{
+ char *env = getenv("MP_COLLECTIVE_SELECTION");
+ if(env != NULL)
+ {
+ if(strncasecmp(env, "TUN", 3) == 0)
+ {
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_TUNE;
+ MPIDI_Process.optimized.collectives = 1;
+ }
+ else if(strncasecmp(env, "YES", 3) == 0)
+ {
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_ALL; /* All collectives will be using auto coll sel.
+ We will check later on each individual coll. */
+ MPIDI_Process.optimized.collectives = 1;
+ }
+ else
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;
- MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_ALL; /* All collectives will be using auto coll sel.
- We will check later on each individual coll. */
- MPIDI_Process.optimized.collectives = 1; /* Enable optimized collectives so we can create PAMI Geometry */
+ }
}
+ else
+ MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;/* Auto coll sel is disabled for all */
}
else
MPIDI_Process.optimized.auto_select_colls = MPID_AUTO_SELECT_COLLS_NONE;/* Auto coll sel is disabled for all */
diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index fceebe2..f1b508c 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -1256,3 +1256,557 @@ int MPIDI_atoll(char* str_in, long long* val)
}
+
+/****************************************************/
+/* Collective Selection Benchmarking utils */
+/****************************************************/
+
+const char * xfer_array_str[PAMI_XFER_COUNT];
+int task_id;
+int num_tasks;
+
+static int MPIDI_collsel_print_usage()
+{
+ if(!task_id)
+ fputs("Usage: pami_tune [options]\n\
+Options:\n\
+ -c Comma separated list of collectives to benchmark\n\
+ Valid options are: \n\
+ allgather, allgatherv, allgatherv_int, allreduce, alltoall,\n\
+ alltoallv, alltoallv_int, ambroadcast, amgather, amreduce,\n\
+ amscatter, barrier, broadcast, gather, gatherv, gatherv_int,\n\
+ reduce, reduce_scatter, scan, scatter, scatterv, scatterv_int\n\
+ (Default: all collectives)\n\n\
+ -m Comma separated list of message sizes to benchmark\n\
+ (Default: 1 to 2^k, where k <= 20)\n\n\
+ -g Comma separated list of geometry sizes to benchmark\n\
+ (Default: 2 to 2^k, where k <= world geometry size)\n\n\
+ -i Number of benchmark iterations per algorithm\n\
+ (Default: 100)\n\n\
+ -f <file> Input file containing benchmark parameters\n\
+ You can override a parameter with a command line argument\n\n\
+ -o <file> Output XML file containing benchmark results\n\
+ (Default: pami_tune_results.xml)\n\n\
+ -d Diagnostics mode. Verify correctness of collective algorithms\n\
+ (Default: Disabled)\n\n\
+ -v Verbose mode\n\
+ (Default: Disabled)\n\n\
+ -x Checkpoint mode. Enable pami_tune checkpointing\n\
+ (Default: Disabled)\n\n\
+ -h Print this help message\n\n", stdout);
+
+ return 0;
+}
+
+
+static void MPIDI_collsel_init_advisor_params(advisor_params_t *params)
+{
+ params->num_collectives = 0;
+ params->num_procs_per_node = 0;
+ params->num_geometry_sizes = 0;
+ params->num_message_sizes = 0;
+ params->collectives = NULL;
+ params->procs_per_node = NULL;
+ params->geometry_sizes = NULL;
+ params->message_sizes = NULL;
+ params->iter = 100;
+ /* Set the following to -1, so that we can
+ check if the user has set them or not */
+ params->verify = -1;
+ params->verbose = -1;
+ params->checkpoint = -1;
+}
+
+
+static void MPIDI_collsel_free_advisor_params(advisor_params_t *params)
+{
+ if(params->collectives) MPIU_Free(params->collectives);
+ if(params->procs_per_node) MPIU_Free(params->procs_per_node);
+ if(params->geometry_sizes) MPIU_Free(params->geometry_sizes);
+ if(params->message_sizes) MPIU_Free(params->message_sizes);
+}
+
+
+static void MPIDI_collsel_init_xfer_tables()
+{
+ xfer_array_str[PAMI_XFER_BROADCAST] ="broadcast";
+ xfer_array_str[PAMI_XFER_ALLREDUCE] ="allreduce";
+ xfer_array_str[PAMI_XFER_REDUCE] ="reduce";
+ xfer_array_str[PAMI_XFER_ALLGATHER] ="allgather";
+ xfer_array_str[PAMI_XFER_ALLGATHERV] ="allgatherv";
+ xfer_array_str[PAMI_XFER_ALLGATHERV_INT]="allgatherv_int";
+ xfer_array_str[PAMI_XFER_SCATTER] ="scatter";
+ xfer_array_str[PAMI_XFER_SCATTERV] ="scatterv";
+ xfer_array_str[PAMI_XFER_SCATTERV_INT] ="scatterv_int";
+ xfer_array_str[PAMI_XFER_GATHER] ="gather";
+ xfer_array_str[PAMI_XFER_GATHERV] ="gatherv";
+ xfer_array_str[PAMI_XFER_GATHERV_INT] ="gatherv_int";
+ xfer_array_str[PAMI_XFER_BARRIER] ="barrier";
+ xfer_array_str[PAMI_XFER_ALLTOALL] ="alltoall";
+ xfer_array_str[PAMI_XFER_ALLTOALLV] ="alltoallv";
+ xfer_array_str[PAMI_XFER_ALLTOALLV_INT] ="alltoallv_int";
+ xfer_array_str[PAMI_XFER_SCAN] ="scan";
+ xfer_array_str[PAMI_XFER_REDUCE_SCATTER]="reduce_scatter";
+ xfer_array_str[PAMI_XFER_AMBROADCAST] ="ambroadcast";
+ xfer_array_str[PAMI_XFER_AMSCATTER] ="amscatter";
+ xfer_array_str[PAMI_XFER_AMGATHER] ="amgather";
+ xfer_array_str[PAMI_XFER_AMREDUCE] ="amreduce";
+}
+
+static int MPIDI_collsel_process_collectives(char *coll_arg, advisor_params_t *params)
+{
+ int i, ret = 0, arg_len = strlen(coll_arg);
+ char *collectives = (char *) MPIU_Malloc(arg_len + 1);
+ char *coll;
+ /* if already set via config file, free it */
+ if(params->collectives)
+ {
+ MPIU_Free(params->collectives);
+ params->num_collectives = 0;
+ }
+ /* Allocating some extra space should be fine */
+ params->collectives = (pami_xfer_type_t *)MPIU_Malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
+
+ strcpy(collectives, coll_arg);
+ coll = strtok(collectives,",");
+ while (coll != NULL)
+ {
+ for(i=0; i<PAMI_XFER_COUNT; i++)
+ {
+ if(strcmp(coll, xfer_array_str[i]) == 0)
+ {
+ params->collectives[params->num_collectives++] = i;
+ break;
+ }
+ }
+ /* arg did not match any collective */
+ if(i == PAMI_XFER_COUNT)
+ {
+ MPIU_Free(params->collectives);
+ params->collectives = NULL;
+ if(!task_id)
+ {
+ fprintf(stderr, "Invalid collective: %s\n", coll);
+ }
+ ret = 1;
+ break;
+ }
+ coll = strtok(NULL,",");
+ }
+ MPIU_Free(collectives);
+ return ret;
+}
+
+
+static int MPIDI_collsel_process_msg_sizes(char *msg_sizes_arg, advisor_params_t *params)
+{
+ int ret = 0, arg_len = strlen(msg_sizes_arg);
+ char *msg_sizes = (char *) MPIU_Malloc(arg_len + 1);
+ char *msg_sz;
+ size_t tmp;
+ /* if already set via config file, free it */
+ if(params->message_sizes)
+ {
+ MPIU_Free(params->message_sizes);
+ params->num_message_sizes = 0;
+ }
+ /* Allocating some extra space should be fine */
+ params->message_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * 50);
+
+ strcpy(msg_sizes, msg_sizes_arg);
+ msg_sz = strtok(msg_sizes,",");
+ while (msg_sz != NULL)
+ {
+ tmp = strtol(msg_sz, NULL, 10);
+ if(tmp == 0)
+ {
+ MPIU_Free(params->message_sizes);
+ params->message_sizes = NULL;
+ if(!task_id)
+ {
+ fprintf(stderr, "Invalid message size: %s\n", msg_sz);
+ }
+ ret = 1;
+ break;
+ }
+
+ params->message_sizes[params->num_message_sizes++] = tmp;
+ msg_sz = strtok(NULL,",");
+ }
+ MPIU_Free(msg_sizes);
+ return ret;
+}
+
+
+static int MPIDI_collsel_process_geo_sizes(char *geo_sizes_arg, advisor_params_t *params)
+{
+ int ret = 0, arg_len = strlen(geo_sizes_arg);
+ char *geo_sizes = (char *) MPIU_Malloc(arg_len + 1);
+ char *geo_sz;
+ size_t tmp;
+ /* if already set via config file, free it */
+ if(params->geometry_sizes)
+ {
+ MPIU_Free(params->geometry_sizes);
+ params->num_geometry_sizes = 0;
+ }
+ /* Allocating some extra space should be fine */
+ params->geometry_sizes = (size_t *)MPIU_Malloc(sizeof(size_t) * 50);
+
+ strcpy(geo_sizes, geo_sizes_arg);
+ geo_sz = strtok(geo_sizes,",");
+ while (geo_sz != NULL)
+ {
+ tmp = strtol(geo_sz, NULL, 10);
+ if(tmp < 2 || tmp > num_tasks)
+ {
+ MPIU_Free(params->geometry_sizes);
+ params->geometry_sizes = NULL;
+ if(!task_id)
+ {
+ fprintf(stderr, "Invalid geometry size: %s\n", geo_sz);
+ }
+ ret = 1;
+ break;
+ }
+
+ params->geometry_sizes[params->num_geometry_sizes++] = tmp;
+ geo_sz = strtok(NULL,",");
+ }
+ MPIU_Free(geo_sizes);
+ return ret;
+}
+
+
+static int MPIDI_collsel_process_output_file(char *filename, char **out_file)
+{
+ char *newname;
+ int i, filename_len, ret = 0;
+
+ filename_len = strlen(filename);
+
+ /* Check if file already exists */
+ if(access(filename, F_OK) == 0)
+ {
+ fprintf(stderr, "File %s already exists, renaming existing file\n", filename);
+ newname = (char *) MPIU_Malloc(filename_len + 4);
+ for (i = 0; i < 500; ++i)
+ {
+ sprintf(newname,"%s.%d", filename, i);
+ if(!(access(newname, F_OK) == 0))
+ {
+ ret = rename(filename, newname);
+ break;
+ }
+ }
+ MPIU_Free(newname);
+ if(i == 500 || ret != 0)
+ {
+ fprintf(stderr, "Error renaming file\n");
+ return 1;
+ }
+ }
+ /* if file name is already set via config file, free it */
+ if(*out_file) MPIU_Free(*out_file);
+ *out_file = (char *)MPIU_Malloc(filename_len + 1);
+ strcpy(*out_file, filename);
+
+ return ret;
+}
+
+
+static char* MPIDI_collsel_ltrim(char *line)
+{
+ while(*line && isspace(*line))
+ ++line;
+
+ return line;
+}
+
+static char* MPIDI_collsel_rtrim(char *line)
+{
+ char *end = line + strlen(line);
+ while(end > line && isspace(*--end))
+ *end = '\0';
+
+ return line;
+}
+
+static int MPIDI_collsel_checkvalue(char *name, char *value, const char *filename, int *ival)
+{
+ int ret = 0;
+ char *tmp;
+ *ival = (int)strtol(value, &tmp, 10);
+ if(*ival != 1)
+ {
+ if((*ival == 0 && value == tmp)|| *ival != 0)
+ {
+ if(!task_id)
+ fprintf(stderr, "Invalid value for %s parameter: %s in file: %s\n", name, value, filename);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+
+
+static int MPIDI_collsel_process_ini_file(const char *filename, advisor_params_t *params, char **out_file)
+{
+ char *line, *start, *name, *value;
+ int ret = 0;
+ FILE *file = fopen(filename, "r");
+ if(!file)
+ {
+ fprintf(stderr, "Error. Can't open file %s\n", filename);
+ return 1;
+ }
+ line = (char *) MPIU_Malloc(1000);
+
+ while (fgets(line, 1000, file) != NULL)
+ {
+ start = MPIDI_collsel_ltrim(MPIDI_collsel_rtrim(line));
+ /* Skip comments and sections */
+ if(*start == ';' || *start == '[' || *start == '#')
+ continue;
+ name = strtok(line, "=");
+ if(name == NULL) continue;
+ value = strtok(NULL, "=");
+ if(value == NULL) continue;
+ name = MPIDI_collsel_rtrim(name);
+ value = MPIDI_collsel_ltrim(value);
+ /* Do not override command line values if they are set */
+ if(strcmp(name, "collectives") == 0)
+ {
+ if(!params->collectives)
+ ret = MPIDI_collsel_process_collectives(value, params);
+ }
+ else if(strcmp(name, "message_sizes") == 0)
+ {
+ if(!params->message_sizes)
+ ret = MPIDI_collsel_process_msg_sizes(value, params);
+ }
+ else if(strcmp(name, "geometry_sizes") == 0)
+ {
+ if(!params->geometry_sizes)
+ ret = MPIDI_collsel_process_geo_sizes(value, params);
+ }
+ else if(strcmp(name, "output_file") == 0)
+ {
+ if(!*out_file && !task_id) /* Only task 0 creates o/p file */
+ ret = MPIDI_collsel_process_output_file(value, out_file);
+ }
+ else if(strcmp(name, "iterations") == 0)
+ {
+ if(params->iter == 100)
+ {
+ params->iter = atoi(value);
+ if(params->iter <= 0)
+ {
+ if(!task_id)
+ fprintf(stderr, "Invalid iteration count: %s in file: %s\n", value, filename);
+ ret = 1;
+ }
+ }
+ }
+ else if(strcmp(name, "verbose") == 0)
+ {
+ if(params->verbose == -1)
+ ret = MPIDI_collsel_checkvalue(name, value, filename, ¶ms->verbose);
+ }
+ else if(strcmp(name, "diagnostics") == 0)
+ {
+ if(params->verify == -1)
+ ret = MPIDI_collsel_checkvalue(name, value, filename, ¶ms->verify);
+ }
+ else if(strcmp(name, "checkpoint") == 0)
+ {
+ if(params->checkpoint == -1)
+ ret = MPIDI_collsel_checkvalue(name, value, filename, ¶ms->checkpoint);
+ }
+ else
+ {
+ fprintf(stderr, "Invalid parameter: %s in file: %s\n", name, filename);
+ ret = 1;
+ }
+ if(ret) break;
+ }
+ MPIU_Free(line);
+ fclose(file);
+
+ return ret;
+}
+
+
+static int MPIDI_collsel_process_arg(int argc, char *argv[], advisor_params_t *params, char ** out_file)
+{
+ int i,c,ret = 0;
+
+ MPIDI_collsel_init_xfer_tables();
+ params->verify = 0;
+
+ opterr = 0;
+ while ((c = getopt (argc, argv, "c:m:g:f:o:i:v::d::x::h::")) != -1)
+ {
+ switch (c)
+ {
+ case 'c':
+ ret = MPIDI_collsel_process_collectives(optarg, params);
+ break;
+ case 'm':
+ ret = MPIDI_collsel_process_msg_sizes(optarg, params);
+ break;
+ case 'g':
+ ret = MPIDI_collsel_process_geo_sizes(optarg, params);
+ break;
+ case 'f':
+ ret = MPIDI_collsel_process_ini_file(optarg, params, out_file);
+ break;
+ case 'o':
+ if(!task_id) /* Only task 0 creates o/p file */
+ ret = MPIDI_collsel_process_output_file(optarg, out_file);
+ break;
+ case 'i':
+ params->iter = atoi(optarg);
+ if(params->iter <= 0)
+ {
+ if(!task_id)
+ fprintf(stderr, "Invalid iteration count %s\n", optarg);
+ ret = 1;
+ }
+ break;
+ case 'd':
+ params->verify = 1;
+ break;
+ case 'v':
+ params->verbose = 1;
+ break;
+ case 'x':
+ params->checkpoint = 1;
+ break;
+ case 'h':
+ ret = 2;
+ break;
+ case '?':
+ if(!task_id)
+ {
+ if (optopt == 'c' || optopt == 'm' || optopt == 'g' ||
+ optopt == 'f' || optopt == 'o' || optopt == 'i')
+ {
+ fprintf (stderr, "Option -%c requires an argument.\n", optopt);
+ }
+ else if (isprint (optopt))
+ {
+ fprintf (stderr, "Unknown option `-%c'.\n", optopt);
+ }
+ else
+ {
+ fprintf (stderr, "Unknown option character `\\x%x'.\n", optopt);
+ }
+ }
+ ret = 1;
+ break;
+ default:
+ abort();
+ break;
+ }
+ if(ret) return ret;
+ }
+ if(!task_id)
+ {
+ if (optind < argc)
+ {
+ printf ("Non-option arguments: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+ }
+
+ /* If user did not specify any collectives, benchmark all */
+ if(params->num_collectives == 0)
+ {
+ params->collectives = (pami_xfer_type_t *)MPIU_Malloc(sizeof(pami_xfer_type_t)*PAMI_XFER_COUNT);
+ for(i = 0; i < PAMI_XFER_COUNT; i++)
+ {
+ params->collectives[params->num_collectives++] = i;
+ }
+ }
+ /* If user did not set any of the following parameters, disable them */
+ if(params->verbose == -1) params->verbose = 0;
+ if(params->verify == -1) params->verify = 0;
+ if(params->checkpoint == -1) params->checkpoint = 0;
+ return 0;
+}
+
+
+static void MPIDI_collsel_print_params(advisor_params_t *params, char *output_file)
+{
+ size_t i;
+ printf(" Benchmark Parameters\n");
+ printf(" --------------------\n");
+
+ printf(" Collectives:\n ");
+ for(i=0; i<params->num_collectives; i++){
+ printf(" %s", xfer_array_str[params->collectives[i]]);
+ }
+ printf("\n Geometry sizes:\n ");
+ for(i=0; i<params->num_geometry_sizes; i++){
+ printf(" %zu", params->geometry_sizes[i]);
+ }
+ printf("\n Message sizes:\n ");
+ for(i=0; i<params->num_message_sizes; i++){
+ printf(" %zu", params->message_sizes[i]);
+ }
+ printf("\n Iterations : %d\n", params->iter);
+ printf(" Output file : %s\n", output_file);
+ printf(" Checkpoint mode : %d\n", params->checkpoint);
+ printf(" Diagnostics mode : %d\n", params->verify);
+ printf(" Verbose mode : %d\n", params->verbose);
+}
+
+
+int MPIDI_collsel_pami_tune_parse_params(int argc, char ** argv)
+{
+ pami_configuration_t config;
+ MPIDI_Collsel_output_file = NULL;
+ num_tasks = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_NUM_TASKS).value.intval;
+ task_id = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_TASK_ID ).value.intval;
+ MPIDI_collsel_init_advisor_params(&MPIDI_Collsel_advisor_params);
+ if(num_tasks < 2)
+ {
+ fprintf (stderr, "Error: pami_tune must be run with more than one task\n");
+ fflush(stderr);
+ MPIDI_collsel_print_usage();
+ return PAMI_ERROR;
+ }
+ MPIDI_Collsel_advisor_params.procs_per_node = (size_t*)MPIU_Malloc(1 * sizeof(size_t));
+ MPIDI_Collsel_advisor_params.num_procs_per_node = 1;
+ MPIDI_Collsel_advisor_params.procs_per_node[0] = PAMIX_Client_query(MPIDI_Client, PAMI_CLIENT_NUM_LOCAL_TASKS ).value.intval;
+
+ int result = MPIDI_collsel_process_arg(argc, argv, &MPIDI_Collsel_advisor_params, &MPIDI_Collsel_output_file);
+ if(result)
+ {
+ MPIDI_collsel_print_usage();
+ return PAMI_ERROR;
+ }
+
+ if(MPIDI_Collsel_output_file == NULL && !task_id)
+ {
+ if(MPIDI_collsel_process_output_file("pami_tune_results.xml", &MPIDI_Collsel_output_file))
+ {
+ return PAMI_ERROR;
+ }
+ }
+ if(MPIDI_Collsel_advisor_params.verbose && !task_id)
+ MPIDI_collsel_print_params(&MPIDI_Collsel_advisor_params, MPIDI_Collsel_output_file);
+
+ return PAMI_SUCCESS;
+
+}
+
+void MPIDI_collsel_pami_tune_cleanup()
+{
+ MPIDI_collsel_free_advisor_params(&MPIDI_Collsel_advisor_params);
+}
+
+
http://git.mpich.org/mpich.git/commitdiff/5673b82ca24c7481e312dc7573c84811c8244bb9
commit 5673b82ca24c7481e312dc7573c84811c8244bb9
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Mon May 6 18:37:54 2013 -0500
Initial drafts of MPID_Win_set/get_info in pamid.
No reviewer.
Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
diff --git a/src/mpid/pamid/src/onesided/Makefile.mk b/src/mpid/pamid/src/onesided/Makefile.mk
index 329da4a..f068454 100644
--- a/src/mpid/pamid/src/onesided/Makefile.mk
+++ b/src/mpid/pamid/src/onesided/Makefile.mk
@@ -35,6 +35,8 @@ lib_lib at MPILIBNAME@_la_SOURCES += \
src/mpid/pamid/src/onesided/mpid_win_lock.c \
src/mpid/pamid/src/onesided/mpid_win_pscw.c \
src/mpid/pamid/src/onesided/mpid_win_put.c \
+ src/mpid/pamid/src/onesided/mpid_win_get_info.c \
+ src/mpid/pamid/src/onesided/mpid_win_set_info.c \
src/mpid/pamid/src/onesided/mpidi_win_control.c
diff --git a/src/mpid/pamid/src/onesided/mpid_win_get_info.c b/src/mpid/pamid/src/onesided/mpid_win_get_info.c
new file mode 100644
index 0000000..ba16658
--- /dev/null
+++ b/src/mpid/pamid/src/onesided/mpid_win_get_info.c
@@ -0,0 +1,50 @@
+/* begin_generated_IBM_copyright_prolog */
+/* */
+/* This is an automatically generated copyright prolog. */
+/* After initializing, DO NOT MODIFY OR MOVE */
+/* --------------------------------------------------------------- */
+/* Licensed Materials - Property of IBM */
+/* Blue Gene/Q 5765-PER 5765-PRP */
+/* */
+/* (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved */
+/* US Government Users Restricted Rights - */
+/* Use, duplication, or disclosure restricted */
+/* by GSA ADP Schedule Contract with IBM Corp. */
+/* */
+/* --------------------------------------------------------------- */
+/* */
+/* end_generated_IBM_copyright_prolog */
+/* (C)Copyright IBM Corp. 2007, 2011 */
+/**
+ * \file src/onesided/mpid_win_get_info.c
+ * \brief ???
+ */
+#include "mpidi_onesided.h"
+
+/**
+ * \brief MPI-PAMI glue for MPI_WIN_GET_INFO function
+ *
+ * \param[in] win Window
+ * \param[in] info_p_p Info hint
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Win_get_info
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Win_get_info(MPID_Win *win,
+ MPID_Info **info_p_p)
+{
+ int mpi_errno = MPI_SUCCESS;
+
+ /* Allocate an empty info object */
+ mpi_errno = MPIU_Info_alloc(info_p_p);
+ if (mpi_errno != MPI_SUCCESS)
+ goto fn_fail;
+
+fn_exit:
+ return mpi_errno;
+fn_fail:
+ goto fn_exit;
+}
diff --git a/src/mpid/pamid/src/onesided/mpid_win_set_info.c b/src/mpid/pamid/src/onesided/mpid_win_set_info.c
new file mode 100644
index 0000000..b56a43a
--- /dev/null
+++ b/src/mpid/pamid/src/onesided/mpid_win_set_info.c
@@ -0,0 +1,40 @@
+/* begin_generated_IBM_copyright_prolog */
+/* */
+/* This is an automatically generated copyright prolog. */
+/* After initializing, DO NOT MODIFY OR MOVE */
+/* --------------------------------------------------------------- */
+/* Licensed Materials - Property of IBM */
+/* Blue Gene/Q 5765-PER 5765-PRP */
+/* */
+/* (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved */
+/* US Government Users Restricted Rights - */
+/* Use, duplication, or disclosure restricted */
+/* by GSA ADP Schedule Contract with IBM Corp. */
+/* */
+/* --------------------------------------------------------------- */
+/* */
+/* end_generated_IBM_copyright_prolog */
+/* (C)Copyright IBM Corp. 2007, 2011 */
+/**
+ * \file src/onesided/mpid_win_set_info.c
+ * \brief ???
+ */
+#include "mpidi_onesided.h"
+
+/**
+ * \brief MPI-PAMI glue for MPI_WIN_SET_INFO function
+ *
+ * \param[in] win Window
+ * \param[in] info Info hint
+ * \return MPI_SUCCESS
+ */
+#undef FUNCNAME
+#define FUNCNAME MPID_Win_set_info
+#undef FCNAME
+#define FCNAME MPIU_QUOTE(FUNCNAME)
+int
+MPID_Win_set_info(MPID_Win *win,
+ MPID_Info *info)
+{
+ return MPI_SUCCESS;
+}
http://git.mpich.org/mpich.git/commitdiff/a28689d4ff7104ba525ddc5ea512e2d45116c1ce
commit a28689d4ff7104ba525ddc5ea512e2d45116c1ce
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Tue May 7 11:18:41 2013 -0500
Rename mpich2 to mpich.
Also fixes tt#1829.
The IBM contributed parts of the patch were reviewed by Mike Blocksome
@ IBM.
diff --git a/src/mpid/pamid/include/mpix.h b/src/mpid/pamid/include/mpix.h
index 2f1f345..8996d82 100644
--- a/src/mpid/pamid/include/mpix.h
+++ b/src/mpid/pamid/include/mpix.h
@@ -214,7 +214,7 @@ extern "C" {
* The communicator is created to match the size of each dimension, the
* physical coords on each node, and the torus/mesh link status.
*
- * Because of MPICH2 dimension ordering, the associated arrays (i.e. coords,
+ * Because of MPICH dimension ordering, the associated arrays (i.e. coords,
* sizes, and periods) are in [a, b, c, d, e, t] order. Consequently, when
* using the default ABCDET mapping, the rank in cart_comm will match the rank
* in MPI_COMM_WORLD. However, when using a non-default mapping or a mapfile
diff --git a/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c b/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
index 6e6c39d..68b818b 100644
--- a/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
+++ b/src/mpid/pamid/src/dyntask/mpid_comm_spawn_multiple.c
@@ -108,7 +108,7 @@ int MPID_Comm_spawn_multiple(int count, char *array_of_commands[],
int mpi_errno = MPI_SUCCESS;
/* We allow an empty implementation of this function to
- simplify building MPICH2 on systems that have difficulty
+ simplify building MPICH on systems that have difficulty
supporing process creation */
mpi_errno = MPIDI_Comm_spawn_multiple(count, array_of_commands,
array_of_argv, array_of_maxprocs,
diff --git a/src/openpa/Makefile.am b/src/openpa/Makefile.am
index fa3afba..b119b3b 100644
--- a/src/openpa/Makefile.am
+++ b/src/openpa/Makefile.am
@@ -22,7 +22,7 @@ prettycheck:
| highlight --color=yellow 'WARN(ING)?' \
| highlight --color=cyan -- '-SKIP-'
-# This target exists to smooth the integration with MPICH2's upcoming build
+# This target exists to smooth the integration with MPICH's upcoming build
# system changes to support parallel make (i.e. "make -j 4"). It serves no
# other purpose, but should _not_ be removed unless you know what you are doing.
all-executable:
@@ -32,7 +32,7 @@ pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = openpa.pc
$(pkgconfig_DATA): config.status
-# make MPICH2 happy
+# make MPICH happy
coverage:
.PHONY: prettycheck all-executable coverage
diff --git a/src/openpa/README b/src/openpa/README
index 410b071..f668e6b 100644
--- a/src/openpa/README
+++ b/src/openpa/README
@@ -6,7 +6,7 @@ library that provides atomic primitives (and related constructs) for
high performance, concurrent software. This project is a collaboration
between the Mathematics and Computer Science (MCS) division at Argonne
National Laboratory (ANL) and the HDF Group. The code was originally
-derived from work on the MPICH2 project.
+derived from work on the MPICH project.
Project documentation and bug tracking can be found at:
diff --git a/src/openpa/autogen.sh b/src/openpa/autogen.sh
index 8dfe3a5..f05c2f7 100755
--- a/src/openpa/autogen.sh
+++ b/src/openpa/autogen.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-if [ -n "$MPICH2_AUTOTOOLS_DIR" ] ; then
- autoreconf=${MPICH2_AUTOTOOLS_DIR}/autoreconf
+if [ -n "$MPICH_AUTOTOOLS_DIR" ] ; then
+ autoreconf=${MPICH_AUTOTOOLS_DIR}/autoreconf
else
autoreconf=${AUTORECONF:-autoreconf}
fi
diff --git a/src/openpa/configure.ac b/src/openpa/configure.ac
index 11d677f..bf682fd 100644
--- a/src/openpa/configure.ac
+++ b/src/openpa/configure.ac
@@ -160,7 +160,7 @@ AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([int])
dnl Check for __attribute__ support. This was originally taken from
-dnl the PAC_C_GNU_ATTRIBUTE macro in mpich2.
+dnl the PAC_C_GNU_ATTRIBUTE macro in mpich.
dnl
dnl We start by requiring Gcc. Some other compilers accept __attribute__
dnl but generate warning messages, or have different interpretations
diff --git a/src/openpa/src/primitives/opa_by_lock.h b/src/openpa/src/primitives/opa_by_lock.h
index 2d7cd28..ea5d18c 100644
--- a/src/openpa/src/primitives/opa_by_lock.h
+++ b/src/openpa/src/primitives/opa_by_lock.h
@@ -16,7 +16,7 @@
/* defined in opa_primitives.c */
extern pthread_mutex_t *OPA_emulation_lock;
-/* FIXME these make less sense now that OPA is not inside of MPICH2. Is there a
+/* FIXME these make less sense now that OPA is not inside of MPICH. Is there a
simpler name/scheme that could be used here instead? [goodell@ 2009-02-19] */
#define OPA_IPC_SINGLE_CS_ENTER(msg) \
do { \
diff --git a/src/pm/smpd/README b/src/pm/smpd/README
index 4650f22..ed64668 100644
--- a/src/pm/smpd/README
+++ b/src/pm/smpd/README
@@ -43,14 +43,14 @@ hosts=<host1 host2 host3 ...>
log=<yes or no>
logfile=<path/filename>
-After mpich is built, the smpd commands are in mpich2/bin, or the bin
+After mpich is built, the smpd commands are in mpich/bin, or the bin
subdirectory of the install directory if you have done an install.
You should put this (bin) directory in your PATH
in your .cshrc or .bashrc:
-Put in .cshrc: setenv PATH /home/you/mpich2/bin:$PATH
+Put in .cshrc: setenv PATH /home/you/mpich/bin:$PATH
-Put in .bashrc: export PATH=/home/you/mpich2/bin:$PATH
+Put in .bashrc: export PATH=/home/you/mpich/bin:$PATH
You can run something with mpiexec
@@ -59,7 +59,7 @@ donner.mcs.anl.gov
foo.mcs.anl.gov
donner%
-You can run an mpich2 job:
+You can run an mpich job:
donner% mpiexec -n 10 /home/ashton/hellow
Hello world from process 0 of 10
diff --git a/src/pmi/pmi2/poe/subconfigure.m4 b/src/pmi/pmi2/poe/subconfigure.m4
index 1b10221..5e2ce7d 100644
--- a/src/pmi/pmi2/poe/subconfigure.m4
+++ b/src/pmi/pmi2/poe/subconfigure.m4
@@ -1,5 +1,5 @@
[#] start of __file__
-dnl MPICH2_SUBCFG_AFTER=src/pmi
+dnl MPICH_SUBCFG_AFTER=src/pmi
AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
])
diff --git a/src/pmi/pmi2/simple/subconfigure.m4 b/src/pmi/pmi2/simple/subconfigure.m4
index 530012a..1b0f5cc 100644
--- a/src/pmi/pmi2/simple/subconfigure.m4
+++ b/src/pmi/pmi2/simple/subconfigure.m4
@@ -1,5 +1,5 @@
[#] start of __file__
-dnl MPICH2_SUBCFG_AFTER=src/pmi
+dnl MPICH_SUBCFG_AFTER=src/pmi
AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
])
-----------------------------------------------------------------------
Summary of changes:
src/mpid/pamid/include/mpidi_constants.h | 1 +
src/mpid/pamid/include/mpidi_datatypes.h | 131 +++++-
src/mpid/pamid/include/mpidi_externs.h | 5 +
src/mpid/pamid/include/mpidi_prototypes.h | 29 +
src/mpid/pamid/include/mpidimpl.h | 14 +
src/mpid/pamid/include/mpix.h | 2 +-
.../pamid/src/coll/allgather/mpido_allgather.c | 57 ++-
.../pamid/src/coll/allgatherv/mpido_allgatherv.c | 66 ++-
.../pamid/src/coll/allreduce/mpido_allreduce.c | 47 ++-
src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c | 124 ++++-
.../pamid/src/coll/alltoallv/mpido_alltoallv.c | 58 ++-
src/mpid/pamid/src/coll/barrier/mpido_barrier.c | 14 +
src/mpid/pamid/src/coll/bcast/mpido_bcast.c | 35 ++
src/mpid/pamid/src/coll/coll_utils.c | 134 +++++
src/mpid/pamid/src/coll/gather/mpido_gather.c | 133 ++++-
src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c | 200 ++++++--
src/mpid/pamid/src/coll/reduce/mpido_reduce.c | 44 ++-
src/mpid/pamid/src/coll/scan/mpido_scan.c | 54 ++-
src/mpid/pamid/src/coll/scatter/mpido_scatter.c | 164 +++++-
src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c | 191 ++++++--
src/mpid/pamid/src/comm/mpid_comm.c | 109 ++++
src/mpid/pamid/src/comm/mpid_selectcolls.c | 258 ++++++---
.../pamid/src/dyntask/mpid_comm_spawn_multiple.c | 2 +-
src/mpid/pamid/src/mpid_init.c | 194 +++++++-
src/mpid/pamid/src/mpidi_env.c | 35 +-
src/mpid/pamid/src/mpidi_util.c | 568 ++++++++++++++++++++
src/mpid/pamid/src/onesided/Makefile.mk | 2 +
.../mpid_mem.c => onesided/mpid_win_get_info.c} | 40 +-
.../{mpid_probe.c => onesided/mpid_win_set_info.c} | 31 +-
src/openpa/Makefile.am | 4 +-
src/openpa/README | 2 +-
src/openpa/autogen.sh | 4 +-
src/openpa/configure.ac | 2 +-
src/openpa/src/primitives/opa_by_lock.h | 2 +-
src/pm/smpd/README | 8 +-
src/pmi/pmi2/poe/subconfigure.m4 | 2 +-
src/pmi/pmi2/simple/subconfigure.m4 | 2 +-
37 files changed, 2457 insertions(+), 311 deletions(-)
copy src/mpid/pamid/src/{misc/mpid_mem.c => onesided/mpid_win_get_info.c} (68%)
copy src/mpid/pamid/src/{mpid_probe.c => onesided/mpid_win_set_info.c} (73%)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list