commits
Threads by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 2054 discussions
[mpich] MPICH primary repository branch, master, updated. v3.0.4-161-g058286b
by noreply@mpich.org 07 May '13
by noreply@mpich.org 07 May '13
07 May '13
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 058286b1b5308c965c4790878a49dbb3ffa1fcdf (commit)
from bbb5a3c4b26f9642fc1dec6c96c9c7ca1f695f17 (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/058286b1b5308c965c4790878a49dbb3f…
commit 058286b1b5308c965c4790878a49dbb3ffa1fcdf
Author: William Gropp <wgropp(a)illinois.edu>
Date: Tue May 7 14:25:13 2013 -0500
Add casts to suppress false warnings about alignment issues.
diff --git a/src/mpl/src/mpltrmem.c b/src/mpl/src/mpltrmem.c
index dc455ff..cac9f12 100644
--- a/src/mpl/src/mpltrmem.c
+++ b/src/mpl/src/mpltrmem.c
@@ -233,7 +233,8 @@ void *MPL_trmalloc(size_t a, int lineno, const char fname[])
goto fn_exit;
memset(new, TRDefaultByte, nsize + sizeof(TrSPACE) + sizeof(unsigned long));
- head = (TRSPACE *) new;
+ /* Cast to (void*) to avoid false warnings about alignment issues */
+ head = (TRSPACE *) (void *)new;
new += sizeof(TrSPACE);
if (TRhead[0] != TRHEAD_PRESENTINAL || TRhead[2] != TRHEAD_POSTSENTINAL) {
@@ -256,7 +257,8 @@ void *MPL_trmalloc(size_t a, int lineno, const char fname[])
MPL_strncpy(head->fname, fname, TR_FNAME_LEN);
head->fname[TR_FNAME_LEN - 1] = 0;
head->cookie = COOKIE_VALUE;
- nend = (unsigned long *) (new + nsize);
+ /* Cast to (void*) to avoid false warning about alignment */
+ nend = (unsigned long *) (void *) (new + nsize);
nend[0] = COOKIE_VALUE;
allocated += nsize;
@@ -309,7 +311,9 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
return;
}
- head = (TRSPACE *) ( ((char *)a_ptr) - sizeof(TrSPACE) );
+ /* Alignment guaranteed by the way a_ptr was allocated. Use
+ (void *) cast to suppress false warning about alignment issues */
+ head = (TRSPACE *) (void *) ( ((char *)a_ptr) - sizeof(TrSPACE) );
/* We need to mark the memory as defined before performing our own error
* checks or valgrind will flag the trfree function as erroneous. The real
@@ -328,7 +332,8 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
"called in %s at line %d\n", world_rank, hexstring, file, line);
return;
}
- nend = (unsigned long *) ((char *)a_ptr + head->size);
+ /* Cast to (void*) to avoid false warning about alignment */
+ nend = (unsigned long *) (void *) ((char *)a_ptr + head->size);
/* Check that nend is properly aligned */
if ((sizeof(long) == 4 && ((long) nend & 0x3) != 0) ||
(sizeof(long) == 8 && ((long) nend & 0x7) != 0)) {
@@ -506,7 +511,8 @@ int MPL_trvalid2(const char str[], int line, const char file[] )
the full header is padded to ensure correct byte alignment with
the data */
a = (char *)( (TrSPACE *)head + 1 );
- nend = (unsigned long *) (a + head->size);
+ /* Cast to (void*) to avoid false warning about alignment */
+ nend = (unsigned long *) (void *)(a + head->size);
/* mark defined before accessing nend contents */
MPL_VG_MAKE_MEM_DEFINED(nend, sizeof(*nend));
@@ -785,9 +791,9 @@ void *MPL_trrealloc(void *p, size_t size, int lineno, const char fname[])
TRSPACE *head = 0;
char hexstring[MAX_ADDRESS_CHARS];
-/* We should really use the size of the old block... */
+ /* We should really use the size of the old block... */
if (p) {
- head = (TRSPACE *) ((char *)p - sizeof(TrSPACE));
+ head = (TRSPACE *) (void*) ((char *)p - sizeof(TrSPACE));
MPL_VG_MAKE_MEM_DEFINED(head, sizeof(*head)); /* mark defined before accessing contents */
if (head->cookie != COOKIE_VALUE) {
/* Damaged header */
diff --git a/src/util/mem/handlemem.c b/src/util/mem/handlemem.c
index 61ed867..7894746 100644
--- a/src/util/mem/handlemem.c
+++ b/src/util/mem/handlemem.c
@@ -157,7 +157,9 @@ void *MPIU_Handle_direct_init(void *direct,
for (i=0; i<direct_size; i++) {
/* printf( "Adding %p in %d\n", ptr, handle_type ); */
- hptr = (MPIU_Handle_common *)ptr;
+ /* First cast to (void*) to avoid false warnings about alignment
+ (consider that a requirement of the input parameters) */
+ hptr = (MPIU_Handle_common *)(void *)ptr;
ptr = ptr + obj_size;
hptr->next = ptr;
hptr->handle = ((unsigned)HANDLE_KIND_DIRECT << HANDLE_KIND_SHIFT) |
@@ -209,7 +211,8 @@ static void *MPIU_Handle_indirect_init( void *(**indirect)[],
}
ptr = (char *)block_ptr;
for (i=0; i<indirect_num_indices; i++) {
- hptr = (MPIU_Handle_common *)ptr;
+ /* Cast to (void*) to avoid false warning about alignment */
+ hptr = (MPIU_Handle_common *)(void*)ptr;
ptr = ptr + obj_size;
hptr->next = ptr;
hptr->handle = ((unsigned)HANDLE_KIND_INDIRECT << HANDLE_KIND_SHIFT) |
-----------------------------------------------------------------------
Summary of changes:
src/mpl/src/mpltrmem.c | 20 +++++++++++++-------
src/util/mem/handlemem.c | 7 +++++--
2 files changed, 18 insertions(+), 9 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-160-gbbb5a3c
by noreply@mpich.org 07 May '13
by noreply@mpich.org 07 May '13
07 May '13
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/bbb5a3c4b26f9642fc1dec6c96c9c7ca1…
commit bbb5a3c4b26f9642fc1dec6c96c9c7ca1f695f17
Author: sssharka <sssharka(a)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(a)us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom(a)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/e50a1dd3dd9460f0c7c23b63fb7416206…
commit e50a1dd3dd9460f0c7c23b63fb74162068b98593
Author: sssharka <sssharka(a)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(a)us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom(a)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/dd85044ba8d3cf760e4138a1f6012c45e…
commit dd85044ba8d3cf760e4138a1f6012c45e54547af
Author: Michael Blocksome <blocksom(a)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(a)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/313640c691ee440e85ab2a04375c80403…
commit 313640c691ee440e85ab2a04375c804031fe90db
Author: sssharka <sssharka(a)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(a)us.ibm.com>
Signed-off-by: Michael Blocksome <blocksom(a)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/f4f0de65736a8abf6c96b727e87b08299…
commit f4f0de65736a8abf6c96b727e87b082992616cf5
Author: sssharka <sssharka(a)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(a)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/5673b82ca24c7481e312dc7573c84811c…
commit 5673b82ca24c7481e312dc7573c84811c8244bb9
Author: Pavan Balaji <balaji(a)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(a)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@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/a28689d4ff7104ba525ddc5ea512e2d45…
commit a28689d4ff7104ba525ddc5ea512e2d45116c1ce
Author: Pavan Balaji <balaji(a)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
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-153-g1be61fb
by noreply@mpich.org 06 May '13
by noreply@mpich.org 06 May '13
06 May '13
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 1be61fbcad263cffe6dedfb1597be46ccad2b714 (commit)
via 3b8afffb24a94858a44c20f6c4fd1ab11838fc1f (commit)
via c18320d3188bfc075e04dbcba3e2899451e133ee (commit)
via 9164d3db668e1f2c0f82cd238599782dfc1fc045 (commit)
via 9d291d1ee2015c96969df984af28b56ed6726f31 (commit)
via 2bfe261f076b3845159f1d1c87cec4c3129fa3ee (commit)
via 1170238979cfa69a7c9645e115e041f8cf43e3e4 (commit)
via 47ea47409a0785044f94435d7565ff4d30f4520f (commit)
from bff81082f8524d2a74f7bfd2f85623bb103a6557 (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/1be61fbcad263cffe6dedfb1597be46cc…
commit 1be61fbcad263cffe6dedfb1597be46ccad2b714
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Wed Jan 30 11:33:05 2013 -0600
Allow f90 mod files to be installed in an arbitrary directory.
Instead of using 'includedir' to install the mod file headers the
automake 'modincdir' is used instead. For example:
./configure --includedir=$some_dir modincdir=$some_dir/gnu
This is needed because the fortran mod files are essentially
pre-compiled headers and are therefore compiler-specific. This means
that an application can not compile with xlf90 using a mpif90 script
that was configured and installed using gfortran. By separating out the
mod files generated by gfortran and xlf90 we can create compile scripts
that use the appropriate mod files depending on the compiler used.
Note: For some reason the normal configure processing does NOT check for
a user-specified 'modincdir' variable and, if not set, default to
use 'includedir'.
(ibm) CPS 92BQ9Q
(ibm) 52931bf950b389d49177a9aa94acf01c3583a8ce
diff --git a/configure.ac b/configure.ac
index d560419..7836b1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2310,6 +2310,12 @@ if test "$enable_fc" = "yes" ; then
# ------------------------------------------------
fi
+if test "X$modincdir" = "X" ; then
+ modincdir=$includedir
+fi
+export modincdir
+AC_SUBST(modincdir)
+
# ----------------------------------------------------------------------------
# We previously allowed "default" as a valid value for $enable_cxx. Now we
# assume its available by default and error out if it doesn't work (just like
diff --git a/src/binding/f90/buildiface b/src/binding/f90/buildiface
index fdd5109..7ae05be 100755
--- a/src/binding/f90/buildiface
+++ b/src/binding/f90/buildiface
@@ -1016,7 +1016,7 @@ mpi_f90_modules = \\
src/binding/f90/\$(MPIBASEMOD).\$(MOD)
# the modules are effectively precompiled headers for Fortran programs
-include_HEADERS += \$(mpi_f90_modules)
+modinc_HEADERS = \$(mpi_f90_modules)
# We need a free-format version of mpif.h with no external commands,
# including no wtime/wtick (removing MPI_WTICK also removes MPI_WTIME,
diff --git a/src/env/mpif90.bash.in b/src/env/mpif90.bash.in
index 1e23550..e3529af 100644
--- a/src/env/mpif90.bash.in
+++ b/src/env/mpif90.bash.in
@@ -33,6 +33,7 @@ exec_prefix=@exec_prefix@
sysconfdir=@sysconfdir@
includedir=@includedir@
libdir=@libdir@
+modincdir=@modincdir@
# Default settings for compiler, flags, and libraries
# Determined by a combination of environment variables and tests within
@@ -308,7 +309,6 @@ else
fi
# Handle the specification of the directory containing the modules
-# For now, these are in the includedir (no choice argument supported)
modulelib="@FCWRAPNAME@"
if [ -n "$FCMODINCSPEC" ] ; then
newarg=`echo A"$FCMODINCSPEC" | \
@@ -316,7 +316,7 @@ if [ -n "$FCMODINCSPEC" ] ; then
FCMODDIRS="$newarg"
FCMODLIBS="-l$modulelib"
elif [ -n "$FCMODINC" ] ; then
- FCMODDIRS="${FCMODINC}$includedir"
+ FCMODDIRS="${FCMODINC}$modincdir"
FCMODLIBS="-l$modulelib"
fi
diff --git a/src/env/mpif90.sh.in b/src/env/mpif90.sh.in
index 7527e78..238df12 100644
--- a/src/env/mpif90.sh.in
+++ b/src/env/mpif90.sh.in
@@ -33,6 +33,7 @@ exec_prefix=@exec_prefix@
sysconfdir=@sysconfdir@
includedir=@includedir@
libdir=@libdir@
+modincdir=@modincdir@
# Default settings for compiler, flags, and libraries
# Determined by a combination of environment variables and tests within
@@ -325,7 +326,6 @@ else
fi
# Handle the specification of the directory containing the modules
-# For now, these are in the includedir (no choice argument supported)
modulelib="@FCWRAPNAME@"
if [ -n "$FCMODINCSPEC" ] ; then
newarg=`echo A"$FCMODINCSPEC" | \
@@ -333,7 +333,7 @@ if [ -n "$FCMODINCSPEC" ] ; then
FCMODDIRS="$newarg"
FCMODLIBS="-l$modulelib"
elif [ -n "$FCMODINC" ] ; then
- FCMODDIRS="${FCMODINC}$includedir"
+ FCMODDIRS="${FCMODINC}$modincdir"
FCMODLIBS="-l$modulelib"
fi
http://git.mpich.org/mpich.git/commitdiff/3b8afffb24a94858a44c20f6c4fd1ab11…
commit 3b8afffb24a94858a44c20f6c4fd1ab11838fc1f
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Thu Feb 14 13:44:06 2013 -0600
Add '--with-mpl-prefix=DIR' configure option.
(ibm) CPS 92XMVJ
(ibm) db1d16976caeaece627c157ad258f5c361ecf80e
diff --git a/Makefile.am b/Makefile.am
index ca283d3..779fad4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,9 +47,9 @@ pkgconfigdir = @pkgconfigdir@
# to build src/mpi/errhan/defmsg.h
errnames_txt_files =
-external_subdirs = src/mpl @opasrcdir@
+external_subdirs = @mplsrcdir@ @opasrcdir@
# FIXME how/where does external_libs/ldflags get used?
-external_ldflags = -L$(top_builddir)/src/mpl -L@opalibdir@
+external_ldflags = -L@mpllibdir@ -L@opalibdir@
external_libs = -l@MPLLIBNAME@ -l@OPALIBNAME@
# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
diff --git a/configure.ac b/configure.ac
index ecc8438..d560419 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1168,10 +1168,38 @@ AC_ARG_VAR([MPLLIBNAME],[can be used to override the name of the MPL library (de
MPLLIBNAME=${MPLLIBNAME:-"mpl"}
export MPLLIBNAME
AC_SUBST(MPLLIBNAME)
-PAC_CONFIG_SUBDIR(src/mpl,,AC_MSG_ERROR(MPL configure failed))
-PAC_PREPEND_FLAG([-l${MPLLIBNAME}], [WRAPPER_LIBS])
-PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
-PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
+AC_ARG_WITH([mpl-prefix],
+ [AS_HELP_STRING([[--with-mpl-prefix[=DIR]]],
+ [use the MPL library installed in DIR,
+ rather than the one included in src/mpl. Pass
+ "embedded" to force usage of the MPL source
+ distributed with MPICH2.])],
+ [],dnl action-if-given
+ [with_mpl_prefix=embedded]) dnl action-if-not-given
+mpldir=""
+AC_SUBST([mpldir])
+mplsrcdir=""
+AC_SUBST([mplsrcdir])
+mpllibdir=""
+AC_SUBST([mpllibdir])
+if test "$with_mpl_prefix" = "embedded" ; then
+ PAC_CONFIG_SUBDIR(src/mpl,,AC_MSG_ERROR(MPL configure failed))
+ PAC_PREPEND_FLAG([-l${MPLLIBNAME}], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
+ PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
+
+ mpllibdir="${master_top_builddir}/src/mpl"
+ mplsrcdir="${master_top_builddir}/src/mpl"
+else
+ # The user specified an already-installed MPL; just sanity check, don't
+ # subconfigure it
+ AS_IF([test -s "${with_mpl_prefix}/include/mplconfig.h"],
+ [:],[AC_MSG_ERROR([the MPL installation in "${with_mpl_prefix}" appears broken])])
+ PAC_APPEND_FLAG([-I${with_mpl_prefix}/include],[CPPFLAGS])
+ PAC_PREPEND_FLAG([-l${MPLLIBNAME}],[WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-L${with_mpl_prefix}/lib],[WRAPPER_LDFLAGS])
+ mpllibdir="${with_mpl_prefix}/lib"
+fi
# OpenPA
AC_ARG_VAR([OPALIBNAME],[can be used to override the name of the OpenPA library (default: "opa")])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index c97b378..77b21f0 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -36,7 +36,7 @@ cpi_DEPENDENCIES =
# the make-time instances of libpmpich.la and libmpich.la live here
LDFLAGS += -L../lib
# the make-time instances of libmpl.la and libopa.la live here
-LDFLAGS += -L../src/mpl -L@opalibdir@
+LDFLAGS += -L@mpllibdir@ -L@opalibdir@
# Wrapper LDFLAGS need to be added at the end to make sure we link
# with the libraries we just built, and not any previously installed
http://git.mpich.org/mpich.git/commitdiff/c18320d3188bfc075e04dbcba3e289945…
commit c18320d3188bfc075e04dbcba3e2899451e133ee
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Thu Feb 14 10:35:52 2013 -0600
Fix '--with-openpa-prefix=DIR' so it actually works.
(ibm) CPS 92XMVJ
(ibm) 10855cb7c8e22e9018144ce14b986a3aa8f9d80f
diff --git a/Makefile.am b/Makefile.am
index 29a2d3e..ca283d3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,9 +47,9 @@ pkgconfigdir = @pkgconfigdir@
# to build src/mpi/errhan/defmsg.h
errnames_txt_files =
-external_subdirs = src/mpl src/openpa
+external_subdirs = src/mpl @opasrcdir@
# FIXME how/where does external_libs/ldflags get used?
-external_ldflags = -L$(top_builddir)/src/mpl -L$(top_builddir)/src/openpa/src
+external_ldflags = -L$(top_builddir)/src/mpl -L@opalibdir@
external_libs = -l@MPLLIBNAME@ -l@OPALIBNAME@
# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
diff --git a/configure.ac b/configure.ac
index ed41a25..ecc8438 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1200,8 +1200,15 @@ OPA_fetch_and_incr_int(&i,5);
PAC_POP_FLAG([LIBS])
])
+opasrcdir=""
+AC_SUBST([opasrcdir])
+opalibdir=""
+AC_SUBST([opalibdir])
+
if test "$with_openpa_prefix" = "embedded" ; then
if test -e "${use_top_srcdir}/src/openpa" ; then
+ opasrcdir="${master_top_builddir}/src/openpa"
+ opalibdir="${master_top_builddir}/src/openpa/src"
PAC_APPEND_FLAG([-I${use_top_srcdir}/src/openpa/src],[CPPFLAGS])
PAC_APPEND_FLAG([-I${master_top_builddir}/src/openpa/src],[CPPFLAGS])
@@ -1237,6 +1244,9 @@ else
PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
if test -d ${with_openpa_prefix}/lib64 ; then
PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib64],[WRAPPER_LDFLAGS])
+ opalibdir="${with_openpa_prefix}/lib64"
+ else
+ opalibdir="${with_openpa_prefix}/lib"
fi
PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib],[WRAPPER_LDFLAGS])
fi
diff --git a/examples/Makefile.am b/examples/Makefile.am
index c846a98..c97b378 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -36,7 +36,7 @@ cpi_DEPENDENCIES =
# the make-time instances of libpmpich.la and libmpich.la live here
LDFLAGS += -L../lib
# the make-time instances of libmpl.la and libopa.la live here
-LDFLAGS += -L../src/mpl -L../src/openpa/src
+LDFLAGS += -L../src/mpl -L@opalibdir@
# Wrapper LDFLAGS need to be added at the end to make sure we link
# with the libraries we just built, and not any previously installed
http://git.mpich.org/mpich.git/commitdiff/9164d3db668e1f2c0f82cd238599782df…
commit 9164d3db668e1f2c0f82cd238599782dfc1fc045
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Thu Jan 31 12:26:00 2013 -0600
Allow pkgconfig files to be installed in an arbitrary directory.
Instead of using 'libdir' to install the pkgconfig files the automake variable
'pkgconfigdir' is used instead. The configure processing checks for a
user-specified 'pkgconfigdir' variable and, if not set, defaults to use
'libdir' as before.
(ibm) CPS 92XMVJ
(ibm) 1a294c56db2e0d9405f14558d2943ea5ac8211a1
diff --git a/Makefile.am b/Makefile.am
index f1bb3b9..29a2d3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,7 @@ doc1_src_txt =
CLEAN_LOCAL_TARGETS =
# used by nodist_pkgconfig_DATA
-pkgconfigdir = $(libdir)/pkgconfig
+pkgconfigdir = @pkgconfigdir@
# contains all of the "errnames.txt" files that are used by maint/extracterrmsgs
# to build src/mpi/errhan/defmsg.h
diff --git a/configure.ac b/configure.ac
index 805bc84..ed41a25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6137,6 +6137,13 @@ fi
########################################################################
+if test -z "$pkgconfigdir" ; then
+ # The default pkgconfig dir is under the lib dir
+ pkgconfigdir=$libdir/pkgconfig
+fi
+AC_SUBST(pkgconfigdir)
+export pkgconfigdir
+
dnl This includes an experimental pkgconfig file for ch3 in the src/pkgconfig
dnl directory
AC_OUTPUT(Makefile \
diff --git a/src/openpa/Makefile.am b/src/openpa/Makefile.am
index dedda7a..fa3afba 100644
--- a/src/openpa/Makefile.am
+++ b/src/openpa/Makefile.am
@@ -28,7 +28,7 @@ prettycheck:
all-executable:
# pkgconfig files
-pkgconfigdir = $(libdir)/pkgconfig
+pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = openpa.pc
$(pkgconfig_DATA): config.status
diff --git a/src/openpa/configure.ac b/src/openpa/configure.ac
index 5063164..11d677f 100644
--- a/src/openpa/configure.ac
+++ b/src/openpa/configure.ac
@@ -431,6 +431,12 @@ fi
export libopa_so_versionflags
AC_SUBST(libopa_so_versionflags)
+if test -z "$pkgconfigdir" ; then
+ # The default pkgconfig dir is under the lib dir
+ pkgconfigdir=$libdir/pkgconfig
+fi
+AC_SUBST(pkgconfigdir)
+export pkgconfigdir
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile openpa.pc])
AC_OUTPUT
http://git.mpich.org/mpich.git/commitdiff/9d291d1ee2015c96969df984af28b56ed…
commit 9d291d1ee2015c96969df984af28b56ed6726f31
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Mon Feb 4 12:25:13 2013 -0600
Add ability to customize the PAMI library name
To change the name from the default ("pami") specify the environment
variable "PAMILIBNAME=name" on configure.
(ibm) CPS 92XMVJ
(ibm) 61c11409a6a9af43994bbca99614f1cddc9c71ab
diff --git a/src/mpid/pamid/subconfigure.m4 b/src/mpid/pamid/subconfigure.m4
index 0ca5777..507243c 100644
--- a/src/mpid/pamid/subconfigure.m4
+++ b/src/mpid/pamid/subconfigure.m4
@@ -26,6 +26,11 @@ dnl _PREREQ handles the former role of mpichprereq, setup_device, etc
AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
AM_CONDITIONAL([BUILD_PAMID],[test "$device_name" = "pamid"])
+AC_ARG_VAR([PAMILIBNAME],[can be used to override the name of the PAMI library (default: "pami")])
+PAMILIBNAME=${PAMILIBNAME:-"pami"}
+AC_SUBST(PAMILIBNAME)
+export PAMILIBNAME
+
dnl this subconfigure.m4 handles the configure work for the ftb subdir too
dnl this AM_CONDITIONAL only works because enable_ftb is set very early on by
dnl autoconf's argument parsing code. The "action-if-given" from the
@@ -146,12 +151,12 @@ if test "${pamid_platform}" = "BGQ" ; then
#
# The bgq compile requires these libraries.
#
- PAC_APPEND_FLAG([-lpami], [WRAPPER_LIBS])
- PAC_APPEND_FLAG([-lSPI], [WRAPPER_LIBS])
- PAC_APPEND_FLAG([-lSPI_cnk], [WRAPPER_LIBS])
- PAC_APPEND_FLAG([-lrt], [WRAPPER_LIBS])
- PAC_APPEND_FLAG([-lpthread], [WRAPPER_LIBS])
- PAC_APPEND_FLAG([-lstdc++], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-l${PAMILIBNAME}], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-lSPI], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-lSPI_cnk], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-lrt], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-lpthread], [WRAPPER_LIBS])
+ PAC_APPEND_FLAG([-lstdc++], [WRAPPER_LIBS])
# For some reason, on bgq, libtool will incorrectly attempt a static link
# of libstdc++.so unless this '-all-static' option is used. This seems to
http://git.mpich.org/mpich.git/commitdiff/2bfe261f076b3845159f1d1c87cec4c31…
commit 2bfe261f076b3845159f1d1c87cec4c3129fa3ee
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Wed Jan 30 16:36:19 2013 -0600
Add ability to customize the MPL library name
To change the name from the default ("mpl") specify the environment
variable "MPLLIBNAME=name" on configure.
(ibm) CPS 92XMVJ
(ibm) 27904f81cf1fbc5f3230adecd5317ddf5c29e800
diff --git a/Makefile.am b/Makefile.am
index a5c0404..f1bb3b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,7 @@ errnames_txt_files =
external_subdirs = src/mpl src/openpa
# FIXME how/where does external_libs/ldflags get used?
external_ldflags = -L$(top_builddir)/src/mpl -L$(top_builddir)/src/openpa/src
-external_libs = -lmpl -l@OPALIBNAME@
+external_libs = -l@MPLLIBNAME@ -l@OPALIBNAME@
# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
# The automake manual recommends thinking of DIST_SUBDIRS as the list of all
diff --git a/configure.ac b/configure.ac
index 631ae31..805bc84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -777,6 +777,7 @@ export MPILIBNAME
export PMPILIBNAME
export RANLIB
export OPALIBNAME
+export MPLLIBNAME
# ----------------------------------------------------------------------------
# with-device
if test "$with_device" = "default" ; then
@@ -1163,8 +1164,12 @@ if test "$MPID_NO_SPAWN" = yes ; then
fi
# MPL
+AC_ARG_VAR([MPLLIBNAME],[can be used to override the name of the MPL library (default: "mpl")])
+MPLLIBNAME=${MPLLIBNAME:-"mpl"}
+export MPLLIBNAME
+AC_SUBST(MPLLIBNAME)
PAC_CONFIG_SUBDIR(src/mpl,,AC_MSG_ERROR(MPL configure failed))
-PAC_PREPEND_FLAG([-lmpl], [WRAPPER_LIBS])
+PAC_PREPEND_FLAG([-l${MPLLIBNAME}], [WRAPPER_LIBS])
PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index b0b1cf4..c846a98 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -43,7 +43,7 @@ LDFLAGS += -L../src/mpl -L../src/openpa/src
# libraries.
LDFLAGS += $(WRAPPER_LDFLAGS)
-external_libs = -lmpl -l@OPALIBNAME@ $(WRAPPER_LIBS)
+external_libs = -l@MPLLIBNAME@ -l@OPALIBNAME@ $(WRAPPER_LIBS)
if BUILD_PROFILING_LIB
LIBS += -l@PMPILIBNAME@
cpi_DEPENDENCIES += ../lib/lib@[email protected]
diff --git a/src/mpl/Makefile.am b/src/mpl/Makefile.am
index 5b266e3..8693ae6 100644
--- a/src/mpl/Makefile.am
+++ b/src/mpl/Makefile.am
@@ -7,15 +7,15 @@
ACLOCAL_AMFLAGS = -I confdb
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
-lib_LTLIBRARIES = libmpl.la
-libmpl_la_SOURCES = src/mplstr.c src/mpltrmem.c src/mplenv.c
-libmpl_la_LDFLAGS = ${libmpl_so_versionflags}
+lib_LTLIBRARIES = lib@[email protected]
+lib@MPLLIBNAME@_la_SOURCES = src/mplstr.c src/mpltrmem.c src/mplenv.c
+lib@MPLLIBNAME@_la_LDFLAGS = ${lib@MPLLIBNAME@_so_versionflags}
MPL_TESTS = strsep
TESTS = $(MPL_TESTS)
check_PROGRAMS = $(MPL_TESTS)
strsep_SOURCES = test/strsep.c
-strsep_LDADD = libmpl.la
+strsep_LDADD = lib@[email protected]
mpl_headers = \
include/mpl.h \
diff --git a/src/mpl/configure.ac b/src/mpl/configure.ac
index d048814..451ffb4 100644
--- a/src/mpl/configure.ac
+++ b/src/mpl/configure.ac
@@ -25,6 +25,13 @@ PAC_PUSH_FLAG([CFLAGS])
LT_INIT(disable-shared)
PAC_POP_FLAG([CFLAGS])
+# ----------------------------------------------------------------------------
+# Set default library names if names haven't already been provided
+AC_ARG_VAR([MPLLIBNAME],[can be used to override the name of the MPL library (default: "mpl")])
+MPLLIBNAME=${MPLLIBNAME:-"mpl"}
+AC_SUBST(MPLLIBNAME)
+export MPLLIBNAME
+
if test -s "$srcdir/VERSION" ; then
. $srcdir/VERSION
AC_SUBST(libmpl_so_version)
http://git.mpich.org/mpich.git/commitdiff/1170238979cfa69a7c9645e115e041f8c…
commit 1170238979cfa69a7c9645e115e041f8cf43e3e4
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Wed Jan 30 14:24:51 2013 -0600
Add ability to customize the OpenPA library name
To change the name from the default ("opa") specify the environment
variable "OPALIBNAME=name" on configure.
(ibm) CPS 92XMVJ
(ibm) cde8a03e9d2745a32901878b73b2b3047fa0f9d6
diff --git a/Makefile.am b/Makefile.am
index 52a4e94..a5c0404 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,7 @@ errnames_txt_files =
external_subdirs = src/mpl src/openpa
# FIXME how/where does external_libs/ldflags get used?
external_ldflags = -L$(top_builddir)/src/mpl -L$(top_builddir)/src/openpa/src
-external_libs = -lmpl -lopa
+external_libs = -lmpl -l@OPALIBNAME@
# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
# The automake manual recommends thinking of DIST_SUBDIRS as the list of all
diff --git a/configure.ac b/configure.ac
index a56bd3b..631ae31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -776,7 +776,7 @@ export LIBS
export MPILIBNAME
export PMPILIBNAME
export RANLIB
-
+export OPALIBNAME
# ----------------------------------------------------------------------------
# with-device
if test "$with_device" = "default" ; then
@@ -1169,6 +1169,10 @@ PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
# OpenPA
+AC_ARG_VAR([OPALIBNAME],[can be used to override the name of the OpenPA library (default: "opa")])
+OPALIBNAME=${OPALIBNAME:-"opa"}
+export OPALIBNAME
+AC_SUBST(OPALIBNAME)
AC_ARG_WITH([openpa-prefix],
[AS_HELP_STRING([[--with-openpa-prefix[=DIR]]],
[use the OpenPA atomics library installed in DIR,
@@ -1178,7 +1182,7 @@ AC_ARG_WITH([openpa-prefix],
[],
[# see if OPA is already installed on the system
PAC_PUSH_FLAG([LIBS])
- PAC_PREPEND_FLAG([-lopa],[LIBS])
+ PAC_PREPEND_FLAG([-l${OPALIBNAME}],[LIBS])
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
#include "opa_primitives.h"
],[
@@ -1209,12 +1213,12 @@ if test "$with_openpa_prefix" = "embedded" ; then
opa_subdir_args="--with-atomic-primitives=auto_allow_emulation"
fi
PAC_CONFIG_SUBDIR_ARGS([src/openpa],[$opa_subdir_args],[],[AC_MSG_ERROR([OpenPA configure failed])])
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+ PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
else
AC_MSG_WARN([Attempted to use the embedded OpenPA source tree in "src/openpa", but it is missing. Configuration or compilation may fail later.])
fi
elif test "$with_openpa_prefix" = "system" ; then
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+ PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
elif test "$with_openpa_prefix" = "no" ; then
# The user doesn't want to use OPA. This may or may not cause MPICH to
# fail to configure/build, depending on many other factors.
@@ -1225,7 +1229,7 @@ else
AS_IF([test -s "${with_openpa_prefix}/include/opa_primitives.h" -a -s "${with_openpa_prefix}/include/opa_config.h"],
[:],[AC_MSG_ERROR([the OpenPA installation in "${with_openpa_prefix}" appears broken])])
PAC_APPEND_FLAG([-I${with_openpa_prefix}/include],[CPPFLAGS])
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+ PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
if test -d ${with_openpa_prefix}/lib64 ; then
PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib64],[WRAPPER_LDFLAGS])
fi
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3c33360..b0b1cf4 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -43,7 +43,7 @@ LDFLAGS += -L../src/mpl -L../src/openpa/src
# libraries.
LDFLAGS += $(WRAPPER_LDFLAGS)
-external_libs = -lmpl -lopa $(WRAPPER_LIBS)
+external_libs = -lmpl -l@OPALIBNAME@ $(WRAPPER_LIBS)
if BUILD_PROFILING_LIB
LIBS += -l@PMPILIBNAME@
cpi_DEPENDENCIES += ../lib/lib@[email protected]
diff --git a/src/openpa/configure.ac b/src/openpa/configure.ac
index fe8865a..5063164 100644
--- a/src/openpa/configure.ac
+++ b/src/openpa/configure.ac
@@ -25,6 +25,13 @@ save_cflags=$CFLAGS
LT_INIT(disable-shared)
CFLAGS=$save_cflags
+# ----------------------------------------------------------------------------
+# Set default library names if names haven't already been provided
+AC_ARG_VAR([OPALIBNAME],[can be used to override the name of the OpenPA library (default: "opa")])
+OPALIBNAME=${OPALIBNAME:-"opa"}
+AC_SUBST(OPALIBNAME)
+export OPALIBNAME
+
if test -s "$srcdir/VERSION" ; then
. $srcdir/VERSION
AC_SUBST([libopa_so_version])
diff --git a/src/openpa/src/Makefile.am b/src/openpa/src/Makefile.am
index 7f55e44..2283681 100644
--- a/src/openpa/src/Makefile.am
+++ b/src/openpa/src/Makefile.am
@@ -3,9 +3,9 @@
# (C) 2008 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
-lib_LTLIBRARIES = libopa.la
-libopa_la_SOURCES = opa_primitives.c opa_queue.c
-libopa_la_LDFLAGS = ${libopa_so_versionflags}
+lib_LTLIBRARIES = lib@[email protected]
+lib@OPALIBNAME@_la_SOURCES = opa_primitives.c opa_queue.c
+lib@OPALIBNAME@_la_LDFLAGS = ${lib@OPALIBNAME@_so_versionflags}
include_HEADERS = opa_primitives.h opa_queue.h opa_util.h
nodist_include_HEADERS = opa_config.h
diff --git a/src/openpa/test/Makefile.am b/src/openpa/test/Makefile.am
index 9efd79c..8006f22 100644
--- a/src/openpa/test/Makefile.am
+++ b/src/openpa/test/Makefile.am
@@ -8,8 +8,8 @@ TESTS = sanity test_primitives test_barriers test_queue
check_PROGRAMS = $(TESTS)
AM_LDFLAGS = -L../src
-LDADD = -lopa
-DEPENDENCIES = libopa.la
+LDADD = -l@OPALIBNAME@
+DEPENDENCIES = lib@[email protected]
sanity_SOURCES = sanity.c
test_primitives_SOURCES = test_primitives.c opa_test.h
http://git.mpich.org/mpich.git/commitdiff/47ea47409a0785044f94435d7565ff4d3…
commit 47ea47409a0785044f94435d7565ff4d30f4520f
Author: Michael Blocksome <blocksom(a)us.ibm.com>
Date: Wed Jan 30 11:44:05 2013 -0600
Add ability to customize the mpich fortran 90 library name
Previously, the f90 library name was forced to be:
lib@MPILIBNAME@f90
This change adds the '--with-fcwrapname' configure option so that the
following is now allowed:
./configure --with-fcwrapname=mpichf90-foo
.. which results in the f90 mpich library named:
lib@FCWRAPNAME@
(ibm) CPS 92XMVJ
(ibm) 9346973f8d1dbf6a09b28446b2f7c3c7c5953ea8
diff --git a/configure.ac b/configure.ac
index f3d3c2d..a56bd3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -628,6 +628,13 @@ AC_ARG_WITH(fwrapname,
[FWRAPNAME=$withval;set_FWRAPNAME="yes"],FWRAPNAME=fmpich)
AC_SUBST(FWRAPNAME)
+dnl The default is a special wrapper library
+AC_ARG_WITH(fcwrapname,
+ AC_HELP_STRING([--with-fcwrapname=name],
+ [Specify name of library containing Fortran 90 interface routines]),
+ [FCWRAPNAME=$withval;set_FCWRAPNAME="yes"],FCWRAPNAME=mpichf90)
+AC_SUBST(FCWRAPNAME)
+
# Find a C compiler.
# We also need to do this before the F77 and FC test to ensure that we
# find the C preprocessor reliably.
diff --git a/src/binding/f90/buildiface b/src/binding/f90/buildiface
index d84ef1f..fdd5109 100755
--- a/src/binding/f90/buildiface
+++ b/src/binding/f90/buildiface
@@ -898,7 +898,7 @@ if BUILD_F90_LIB
# in a VPATH build)
AM_FCFLAGS += \@FCINCFLAG\@src/binding/f90
-lib_LTLIBRARIES += lib/lib\@MPILIBNAME\@f90.la
+lib_LTLIBRARIES += lib/lib\@FCWRAPNAME\@.la
EOT
@@ -930,27 +930,27 @@ nodist_noinst_HEADERS += \\
src/binding/f90/mpif90model.h
# actual f90 code that also gets compiled into modules
-lib_lib\@MPILIBNAME\@f90_la_LDFLAGS = \$(ABIVERSIONFLAGS)
+lib_lib\@FCWRAPNAME\@_la_LDFLAGS = \$(ABIVERSIONFLAGS)
# cause any .\$(MOD) files to be output in the f90 bindings directory instead of
# the current directory
AM_FCFLAGS += \$(FCMODOUTFLAG)src/binding/f90
# we "manually" build the f90 sources and add them with LIBADD
-lib_lib\@MPILIBNAME\@f90_la_SOURCES =
-lib_lib\@MPILIBNAME\@f90_la_LIBADD = \\
+lib_lib\@FCWRAPNAME\@_la_SOURCES =
+lib_lib\@FCWRAPNAME\@_la_LIBADD = \\
src/binding/f90/mpi.lo \\
src/binding/f90/mpi_constants.lo \\
src/binding/f90/mpi_sizeofs.lo \\
src/binding/f90/${outfile_prefix}_base.lo
# now force libtool FC rules/variables to be generated and cause FC linking to
-# be selected for lib/lib\@MPILIBNAME\@f90.la
-EXTRA_lib_lib\@MPILIBNAME\@f90_la_SOURCES = \\
+# be selected for lib/lib\@FCWRAPNAME\@.la
+EXTRA_lib_lib\@FCWRAPNAME\@_la_SOURCES = \\
src/binding/f90/mpi.f90 \\
src/binding/f90/mpi_constants.f90
-nodist_EXTRA_lib_lib\@MPILIBNAME\@f90_la_SOURCES = \\
+nodist_EXTRA_lib_lib\@FCWRAPNAME\@_la_SOURCES = \\
src/binding/f90/mpi_sizeofs.f90 \\
src/binding/f90/${outfile_prefix}_base.f90
diff --git a/src/env/mpif90.bash.in b/src/env/mpif90.bash.in
index 75aadd6..1e23550 100644
--- a/src/env/mpif90.bash.in
+++ b/src/env/mpif90.bash.in
@@ -309,7 +309,7 @@ fi
# Handle the specification of the directory containing the modules
# For now, these are in the includedir (no choice argument supported)
-modulelib="@MPILIBNAME@f90"
+modulelib="@FCWRAPNAME@"
if [ -n "$FCMODINCSPEC" ] ; then
newarg=`echo A"$FCMODINCSPEC" | \
sed -e 's/^A//' -e 's%<dir>%'"$includedir%g" -e 's/<file>/mpi/g'`
diff --git a/src/env/mpif90.sh.in b/src/env/mpif90.sh.in
index 8c72c9c..7527e78 100644
--- a/src/env/mpif90.sh.in
+++ b/src/env/mpif90.sh.in
@@ -326,7 +326,7 @@ fi
# Handle the specification of the directory containing the modules
# For now, these are in the includedir (no choice argument supported)
-modulelib="@MPILIBNAME@f90"
+modulelib="@FCWRAPNAME@"
if [ -n "$FCMODINCSPEC" ] ; then
newarg=`echo A"$FCMODINCSPEC" | \
sed -e 's/^A//' -e 's%<dir>%'"$includedir%g" -e 's/<file>/mpi/g'`
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 8 ++--
configure.ac | 85 +++++++++++++++++++++++++++++++++++----
examples/Makefile.am | 4 +-
src/binding/f90/buildiface | 16 ++++----
src/env/mpif90.bash.in | 6 +-
src/env/mpif90.sh.in | 6 +-
src/mpid/pamid/subconfigure.m4 | 17 +++++---
src/mpl/Makefile.am | 8 ++--
src/mpl/configure.ac | 7 +++
src/openpa/Makefile.am | 2 +-
src/openpa/configure.ac | 13 ++++++
src/openpa/src/Makefile.am | 6 +-
src/openpa/test/Makefile.am | 4 +-
13 files changed, 137 insertions(+), 45 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-145-gbff8108
by noreply@mpich.org 06 May '13
by noreply@mpich.org 06 May '13
06 May '13
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 bff81082f8524d2a74f7bfd2f85623bb103a6557 (commit)
from 384e0138cec5abac9afe9533f2d3b25a93c8eabb (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/bff81082f8524d2a74f7bfd2f85623bb1…
commit bff81082f8524d2a74f7bfd2f85623bb103a6557
Author: James Dinan <dinan(a)mcs.anl.gov>
Date: Mon May 6 10:52:17 2013 -0500
Add missing initializer
Reviewer: None
diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c
index 1f6cbf9..00b0a76 100644
--- a/src/mpid/ch3/src/ch3u_rma_sync.c
+++ b/src/mpid/ch3/src/ch3u_rma_sync.c
@@ -2507,7 +2507,7 @@ static int MPIDI_CH3I_Do_passive_target_rma(MPID_Win *win_ptr, int target_rank,
{
int mpi_errno = MPI_SUCCESS, nops;
MPIDI_RMA_Op_t *curr_ptr;
- MPI_Win source_win_handle, target_win_handle = MPI_WIN_NULL;
+ MPI_Win source_win_handle = MPI_WIN_NULL, target_win_handle = MPI_WIN_NULL;
int nRequest=0, nRequestNew=0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_DO_PASSIVE_TARGET_RMA);
-----------------------------------------------------------------------
Summary of changes:
src/mpid/ch3/src/ch3u_rma_sync.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-144-g384e013
by noreply@mpich.org 06 May '13
by noreply@mpich.org 06 May '13
06 May '13
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 384e0138cec5abac9afe9533f2d3b25a93c8eabb (commit)
via 59e0d3b2971a2fcd31f82def69fa15968bbbd658 (commit)
via af11500e1fbacbe31c231ee1dea8cb7bd23457b6 (commit)
via b0ec78c5004601025cfb2f4d521057b80c698686 (commit)
from 939601e06b888bb350e8a7bc5decc7332659ab07 (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/384e0138cec5abac9afe9533f2d3b25a9…
commit 384e0138cec5abac9afe9533f2d3b25a93c8eabb
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 21:52:44 2013 -0500
Allow devices to override the number of handles and indices through
mpidpre.h.
See trac ticket #1645 at mpich.org for background information, and trac
ticket #1831 for discussion.
https://trac.mpich.org/projects/mpich/ticket/1645
The default values for HANDLE_NUM_BLOCKS and HANDLE_NUM_INDICES in the
src/include/mpihandlemem.h file can be overridden by setting the
MPID_HANDLE_NUM_BLOCKS and MPID_HANDLE_NUM_INDICES #define in the adi
`mpidpre.h` file.
---
The motivation for this change is to allow bgq to customize how quickly
the memory pools grow without changing the behavior for all other
platforms.
Before the changes for ticket 1645, in commits 72eb56 and 62c720, the
default pool limit was 256k (256 elements * 1024 blocks) and the current
default pool limit is 8192k (1024 elements * 8192 blocks).
With this change the default pool limit for bgq in the pamid deivce is
2048k (256 elements * 8102 blocks). The current mpich default number of
elements causes gpaw on bgq to run out of memory at scale - an increment
of 1024 communicators in a pool is too large. While the new bgq defaults
will limit the maximum pool size, it is unlikely that bgq will support
such large pools given the bgq memory limitations.
(ibm) Issue 8178
(ibm) 2ed3b95378bba964e276772bac3bb6aa45b007da
diff --git a/src/include/mpihandlemem.h b/src/include/mpihandlemem.h
index 584d8e8..905deec 100644
--- a/src/include/mpihandlemem.h
+++ b/src/include/mpihandlemem.h
@@ -97,10 +97,19 @@ const char *MPIU_Handle_get_kind_str(int kind);
#define HANDLE_BLOCK_INDEX(a) ((a) & 0x00000FFF)
/* Number of blocks is between 1 and 16384 */
+#if defined MPID_HANDLE_NUM_BLOCKS
+#define HANDLE_NUM_BLOCKS MPID_HANDLE_NUM_BLOCKS
+#else
#define HANDLE_NUM_BLOCKS 8192
+#endif /* MPID_HANDLE_NUM_BLOCKS */
+
/* Number of objects in a block is bewtween 1 and 4096 (each obj has an index
* within its block) */
+#if defined MPID_HANDLE_NUM_INDICES
+#define HANDLE_NUM_INDICES MPID_HANDLE_NUM_INDICES
+#else
#define HANDLE_NUM_INDICES 1024
+#endif /* MPID_HANDLE_NUM_INDICES */
/* For direct, the remainder of the handle is the index into a predefined
block */
diff --git a/src/mpid/pamid/include/mpidpre.h b/src/mpid/pamid/include/mpidpre.h
index 4214268..68ab472 100644
--- a/src/mpid/pamid/include/mpidpre.h
+++ b/src/mpid/pamid/include/mpidpre.h
@@ -66,4 +66,8 @@
#define HAVE_GPID_ROUTINES
#endif
+#ifdef __BGQ__
+#define MPID_HANDLE_NUM_INDICES 256
+#endif /* __BGQ__ */
+
#endif
http://git.mpich.org/mpich.git/commitdiff/59e0d3b2971a2fcd31f82def69fa15968…
commit 59e0d3b2971a2fcd31f82def69fa15968bbbd658
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Mon May 6 06:26:46 2013 -0500
Fix typo in hwloc's autogen.sh.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/autogen.sh b/src/pm/hydra/tools/topo/hwloc/hwloc/autogen.sh
index 88a122a..df42802 100755
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/autogen.sh
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/autogen.sh
@@ -1,2 +1,2 @@
:
-autoreconf ${autoreconf_args:"-ivf"}
+autoreconf ${autoreconf_args:-"-ivf"}
http://git.mpich.org/mpich.git/commitdiff/af11500e1fbacbe31c231ee1dea8cb7bd…
commit af11500e1fbacbe31c231ee1dea8cb7bd23457b6
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Mon May 6 06:25:41 2013 -0500
Use hwloc's autogen.sh directly.
Don't just run autoreconf from hydra and use hwloc's autogen.sh, since
it might do more work than just autoreconf in the future.
No reviewer.
diff --git a/src/pm/hydra/autogen.sh b/src/pm/hydra/autogen.sh
index b84ab3b..e13fb9f 100755
--- a/src/pm/hydra/autogen.sh
+++ b/src/pm/hydra/autogen.sh
@@ -10,7 +10,7 @@ echo "=== running autoreconf in 'mpl' ==="
(cd mpl && $autoreconf ${autoreconf_args:-"-vif"}) || exit 1
echo "=== running autoreconf in 'tools/topo/hwloc/hwloc' ==="
-(cd tools/topo/hwloc/hwloc && $autoreconf ${autoreconf_args:-"-vif"}) || exit 1
+(cd tools/topo/hwloc/hwloc && ./autogen.sh) || exit 1
echo "=== running autoreconf in '.' ==="
$autoreconf ${autoreconf_args:-"-vif"} || exit 1
http://git.mpich.org/mpich.git/commitdiff/b0ec78c5004601025cfb2f4d521057b80…
commit b0ec78c5004601025cfb2f4d521057b80c698686
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 20:46:39 2013 -0500
Reorder compiler preference.
clang seems to have the same or slightly better performance compared
to gcc, which, in turn has the same or slightly better performance
compared to cc.
No reviewer.
diff --git a/confdb/aclocal_cc.m4 b/confdb/aclocal_cc.m4
index 98fdc34..f8ace03 100644
--- a/confdb/aclocal_cc.m4
+++ b/confdb/aclocal_cc.m4
@@ -11,7 +11,7 @@ AC_DEFUN([PAC_PROG_CC],[
dnl developers notice this case.
AC_BEFORE([$0],[AC_PROG_CC])
PAC_PUSH_FLAG([CFLAGS])
- AC_PROG_CC([icc pgcc xlc xlC pathcc cc gcc clang])
+ AC_PROG_CC([icc pgcc xlc xlC pathcc clang gcc cc])
PAC_POP_FLAG([CFLAGS])
])
dnl
-----------------------------------------------------------------------
Summary of changes:
confdb/aclocal_cc.m4 | 2 +-
src/include/mpihandlemem.h | 9 +++++++++
src/mpid/pamid/include/mpidpre.h | 4 ++++
src/pm/hydra/autogen.sh | 2 +-
src/pm/hydra/tools/topo/hwloc/hwloc/autogen.sh | 2 +-
5 files changed, 16 insertions(+), 3 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-140-g939601e
by noreply@mpich.org 05 May '13
by noreply@mpich.org 05 May '13
05 May '13
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 939601e06b888bb350e8a7bc5decc7332659ab07 (commit)
from 259e65db9ecda965c47949295adc80978913fd80 (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/939601e06b888bb350e8a7bc5decc7332…
commit 939601e06b888bb350e8a7bc5decc7332659ab07
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 20:17:15 2013 -0500
hwloc fix to support c89 builds.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
index 564ede4..3bec360 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
@@ -460,6 +460,10 @@ EOF])
[return sysctlbyname(NULL,NULL,NULL,NULL,0);],
AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable]))
+ AC_CHECK_DECLS([strtoull],
+ [AC_DEFINE([HWLOC_HAVE_DECL_STRTOULL],[1],[Define to '1' if strtoull declaration is present])],,
+ [AC_INCLUDES_DEFAULT])
+
case ${target} in
*-*-mingw*|*-*-cygwin*)
hwloc_pid_t=HANDLE
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/include/private/misc.h b/src/pm/hydra/tools/topo/hwloc/hwloc/include/private/misc.h
index f2d475e..e1ce98a 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/include/private/misc.h
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/include/private/misc.h
@@ -28,6 +28,10 @@
#error "unknown size for unsigned int."
#endif
+#if !defined(HWLOC_HAVE_DECL_STRTOULL)
+unsigned long long int strtoull(const char *nptr, char **endptr, int base);
+#endif /* HWLOC_HAVE_DECL_STRTOULL */
+
/**
* ffsl helpers.
-----------------------------------------------------------------------
Summary of changes:
.../hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 | 4 ++++
.../tools/topo/hwloc/hwloc/include/private/misc.h | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-139-g259e65d
by noreply@mpich.org 05 May '13
by noreply@mpich.org 05 May '13
05 May '13
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 259e65db9ecda965c47949295adc80978913fd80 (commit)
from d207289628674edd0f4036f1745a1b97d6eaa403 (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/259e65db9ecda965c47949295adc80978…
commit 259e65db9ecda965c47949295adc80978913fd80
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 16:05:20 2013 -0500
Revert IBM hwloc versioning patch.
This patch is not required since mpich does not build libhwloc at all.
It always builds libhwloc_embedded which is neither versioned nor
installed.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/configure.ac b/src/pm/hydra/tools/topo/hwloc/hwloc/configure.ac
index 5700b77..db3bd69 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/configure.ac
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/configure.ac
@@ -187,20 +187,6 @@ fi
# Is ltdl included?
# AM_CONDITIONAL([HWLOC_LTDL_INCLUDED], [test "x$with_included_ltdl" = xyes])
-
-## Enable creation of libtool-style versioning or no versioning
-AC_ARG_ENABLE(versioning,
- [AC_HELP_STRING([--enable-versioning],[Enable library versioning])],,
- [enable_versioning=yes])
-
-if test "$enable_versioning" = "yes" ; then
- libhwloc_so_versionflags="-version-info \$(libhwloc_so_version)"
-else
- libhwloc_so_versionflags="-avoid-version"
-fi
-export libhwloc_so_versionflags
-AC_SUBST(libhwloc_so_versionflags)
-
# Party on
AC_OUTPUT
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/src/Makefile.am b/src/pm/hydra/tools/topo/hwloc/hwloc/src/Makefile.am
index 44413cd..53de278 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/src/Makefile.am
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/src/Makefile.am
@@ -201,7 +201,7 @@ endif HWLOC_HAVE_WINDOWS
# Installable library
libhwloc_la_SOURCES = $(sources)
-libhwloc_la_LDFLAGS = $(ldflags) $(libhwloc_so_versionflags) $(HWLOC_LIBS)
+libhwloc_la_LDFLAGS = $(ldflags) -version-info $(libhwloc_so_version) $(HWLOC_LIBS)
if HWLOC_HAVE_PLUGINS
AM_CPPFLAGS += $(LTDLINCL)
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/tools/topo/hwloc/hwloc/configure.ac | 14 --------------
.../hydra/tools/topo/hwloc/hwloc/src/Makefile.am | 2 +-
2 files changed, 1 insertions(+), 15 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-138-gd207289
by noreply@mpich.org 05 May '13
by noreply@mpich.org 05 May '13
05 May '13
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 d207289628674edd0f4036f1745a1b97d6eaa403 (commit)
via ea41f80f7807ea22599f3d6d7ed93ff791af342f (commit)
via 350fe9b85399f00d4505864f4aba2c45f3df5e38 (commit)
via 43bd72a48283612bd86cf8603ce99cb2104a64c8 (commit)
from 5b7f9166920e16e02eeb2bc1c4153c9c9795eac0 (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/d207289628674edd0f4036f1745a1b97d…
commit d207289628674edd0f4036f1745a1b97d6eaa403
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 14:42:37 2013 -0500
Include stdio.h in the configure test for the definition of NULL.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
index 2ffb4ad..564ede4 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
@@ -447,10 +447,16 @@ EOF])
# or other similar definitions. So while the symbols "sysctl" and
# "sysctlbyname" might still be available in libc (which autoconf
# checks for), they might not be actually usable.
- AC_TRY_LINK([#include <sys/sysctl.h>],
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <sys/sysctl.h>
+ ],
[return sysctl(NULL,0,NULL,NULL,NULL,0);],
AC_DEFINE([HAVE_SYSCTL],[1],[Define to '1' if sysctl is present and usable]))
- AC_TRY_LINK([#include <sys/sysctl.h>],
+ AC_TRY_LINK([
+ #include <stdio.h>
+ #include <sys/sysctl.h>
+ ],
[return sysctlbyname(NULL,NULL,NULL,NULL,0);],
AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable]))
http://git.mpich.org/mpich.git/commitdiff/ea41f80f7807ea22599f3d6d7ed93ff79…
commit ea41f80f7807ea22599f3d6d7ed93ff791af342f
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 14:31:01 2013 -0500
Include stdio.h in the configure test for getifaddrs.
No reviewer.
diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac
index 68289ec..46a980e 100644
--- a/src/pm/hydra/configure.ac
+++ b/src/pm/hydra/configure.ac
@@ -160,6 +160,7 @@ if test "$ac_cv_func_killpg" = "yes" ; then
fi
AC_TRY_LINK([
+ #include <stdio.h>
#include <sys/types.h>
#include <ifaddrs.h>
],
http://git.mpich.org/mpich.git/commitdiff/350fe9b85399f00d4505864f4aba2c45f…
commit 350fe9b85399f00d4505864f4aba2c45f3df5e38
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 14:22:19 2013 -0500
Simplify C89 header checks.
We can assume that C89 headers exist. Just throw an error in hydra if
the compiler can't even support that, though that shouldn't be
necessary either.
No reviewer.
diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac
index 053e98d..68289ec 100644
--- a/src/pm/hydra/configure.ac
+++ b/src/pm/hydra/configure.ac
@@ -134,10 +134,10 @@ AC_SUBST(top_srcdir)
PAC_ENABLE_COVERAGE
# Check if the necessary headers are available
-AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \
- sched.h sys/stat.h sys/param.h netinet/in.h netinet/tcp.h \
- sys/un.h netdb.h sys/time.h time.h ifaddrs.h arpa/inet.h \
- errno.h poll.h fcntl.h netdb.h winsock2.h windows.h signal.h)
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h strings.h sys/types.h sys/socket.h sched.h sys/stat.h sys/param.h \
+ netinet/in.h netinet/tcp.h sys/un.h netdb.h sys/time.h time.h ifaddrs.h arpa/inet.h \
+ poll.h fcntl.h netdb.h winsock2.h windows.h)
AC_CHECK_LIB(socket,socket,LDFLAGS="$LDFLAGS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS="$LDFLAGS -lnsl",)
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index adfcdeb..491a2e9 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -18,7 +18,17 @@
extern char *HYD_dbg_prefix;
+/* C89 headers can be included without a check */
+#if defined STDC_HEADERS
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <signal.h>
+#else
+#error "STDC_HEADERS are assumed in the Hydra code"
+#endif /* STDC_HEADERS */
#if defined NEEDS_POSIX_FOR_SIGACTION
#define _POSIX_SOURCE
@@ -33,22 +43,10 @@ extern char *HYD_dbg_prefix;
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
-#if defined HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-
-#if defined HAVE_STRING_H
-#include <string.h>
-#endif /* HAVE_STRING_H */
-
#if defined HAVE_STRINGS_H
#include <strings.h>
#endif /* HAVE_STRINGS_H */
-#if defined HAVE_STDARG_H
-#include <stdarg.h>
-#endif /* HAVE_STDARG_H */
-
#if defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
@@ -73,10 +71,6 @@ extern char *HYD_dbg_prefix;
#include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */
-#if defined HAVE_ERRNO_H
-#include <errno.h>
-#endif /* HAVE_ERRNO_H */
-
#if !defined HAVE_GETTIMEOFDAY
#error "hydra requires gettimeofday support"
#endif /* HAVE_GETTIMEOFDAY */
http://git.mpich.org/mpich.git/commitdiff/43bd72a48283612bd86cf8603ce99cb21…
commit 43bd72a48283612bd86cf8603ce99cb2104a64c8
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 13:47:02 2013 -0500
Die on autoreconf error instead of chugging along.
No reviewer.
diff --git a/src/pm/hydra/autogen.sh b/src/pm/hydra/autogen.sh
index 51306b9..b84ab3b 100755
--- a/src/pm/hydra/autogen.sh
+++ b/src/pm/hydra/autogen.sh
@@ -8,9 +8,12 @@ fi
echo "=== running autoreconf in 'mpl' ==="
(cd mpl && $autoreconf ${autoreconf_args:-"-vif"}) || exit 1
+
echo "=== running autoreconf in 'tools/topo/hwloc/hwloc' ==="
(cd tools/topo/hwloc/hwloc && $autoreconf ${autoreconf_args:-"-vif"}) || exit 1
-$autoreconf ${autoreconf_args:-"-vif"}
+
+echo "=== running autoreconf in '.' ==="
+$autoreconf ${autoreconf_args:-"-vif"} || exit 1
# Remove the autom4te.cache folders for a release-like structure.
find . -name autom4te.cache | xargs rm -rf
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/autogen.sh | 5 +++-
src/pm/hydra/configure.ac | 9 ++++---
src/pm/hydra/include/hydra.h | 26 +++++++------------
.../hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 | 10 ++++++-
4 files changed, 27 insertions(+), 23 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-134-g5b7f916
by noreply@mpich.org 05 May '13
by noreply@mpich.org 05 May '13
05 May '13
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 5b7f9166920e16e02eeb2bc1c4153c9c9795eac0 (commit)
from d2338c2d853b9f6c20f882975df6883a858afc91 (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/5b7f9166920e16e02eeb2bc1c4153c9c9…
commit 5b7f9166920e16e02eeb2bc1c4153c9c9795eac0
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 11:54:59 2013 -0500
Warning squash.
No reviewer.
diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index 0bdb63c..af04cba 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -499,8 +499,8 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
{
struct hostent *ht;
char *ip1 = NULL, *ip2 = NULL;
- char buf1[INET_ADDRSTRLEN], buf2[INET_ADDRSTRLEN];
- struct sockaddr_in *sa_ptr, sa;
+ char buf1[INET_ADDRSTRLEN];
+ struct sockaddr_in sa;
#if defined(HAVE_GETIFADDRS)
struct ifaddrs *ifaddr, *ifa;
@@ -546,13 +546,19 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
for (ifa = ifaddr; ifa; ifa = ifa->ifa_next) {
if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) {
+ struct sockaddr_in *sa_ptr;
+
sa_ptr = (struct sockaddr_in *) ifa->ifa_addr;
#if defined HAVE_INET_NTOP
- ip2 = HYDU_strdup((char *)
- inet_ntop(AF_INET, (const void *) &(sa_ptr->sin_addr), buf2,
- MAX_HOSTNAME_LEN));
- HYDU_ASSERT(ip2, status);
+ {
+ char buf2[INET_ADDRSTRLEN];
+
+ ip2 = HYDU_strdup((char *)
+ inet_ntop(AF_INET, (const void *) &(sa_ptr->sin_addr), buf2,
+ MAX_HOSTNAME_LEN));
+ HYDU_ASSERT(ip2, status);
+ }
#endif /* HAVE_INET_NTOP */
if (!strcmp(ip1, ip2)) {
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/utils/sock/sock.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0
[mpich] MPICH primary repository branch, master, updated. v3.0.4-133-gd2338c2
by noreply@mpich.org 05 May '13
by noreply@mpich.org 05 May '13
05 May '13
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 d2338c2d853b9f6c20f882975df6883a858afc91 (commit)
via db276e4eca99a9dee6f1b9c30f28e3c6b9af924a (commit)
via 90da6e9004433937e0b54bd847c09e1e982a1744 (commit)
via 255da3f6dff4aa605b00d36316497100d4bfa017 (commit)
via 581d59f5cf0926cc828fe6302f371cb427bb9bbd (commit)
via e801995ec7558e5fa24ee462aac395c6acad374c (commit)
from 33e53f7ad9043bcd1b6578a0b7f1157c45f28438 (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/d2338c2d853b9f6c20f882975df6883a8…
commit d2338c2d853b9f6c20f882975df6883a858afc91
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 10:51:20 2013 -0500
Include strings.h for strcasecmp.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/src/traversal.c b/src/pm/hydra/tools/topo/hwloc/hwloc/src/traversal.c
index 452462b..40f1263 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/src/traversal.c
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/src/traversal.c
@@ -11,6 +11,9 @@
#include <private/private.h>
#include <private/misc.h>
#include <private/debug.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif /* HAVE_STRINGS_H */
int
hwloc_get_type_depth (struct hwloc_topology *topology, hwloc_obj_type_t type)
http://git.mpich.org/mpich.git/commitdiff/db276e4eca99a9dee6f1b9c30f28e3c6b…
commit db276e4eca99a9dee6f1b9c30f28e3c6b9af924a
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat May 4 11:34:21 2013 -0500
Fixes for sysctl checks in strict builds of hwloc.
Do a full link test instead of just using AC_CHECK_FUNCS, which just
checks to see if the symbol exists or not. For example, the prototype
of sysctl uses u_int, which on some platforms (such as FreeBSD) is
only defined under __BSD_VISIBLE, __USE_BSD or other similar
definitions. So while the symbols "sysctl" and "sysctlbyname" might
still be available in libc (which autoconf checks for), they might not
be actually usable.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
index 8a6445f..2ffb4ad 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
@@ -439,7 +439,20 @@ EOF])
#include <sys/param.h>
#endif
])
- AC_CHECK_FUNCS([sysctl sysctlbyname])
+
+ # Do a full link test instead of just using AC_CHECK_FUNCS, which
+ # just checks to see if the symbol exists or not. For example,
+ # the prototype of sysctl uses u_int, which on some platforms
+ # (such as FreeBSD) is only defined under __BSD_VISIBLE, __USE_BSD
+ # or other similar definitions. So while the symbols "sysctl" and
+ # "sysctlbyname" might still be available in libc (which autoconf
+ # checks for), they might not be actually usable.
+ AC_TRY_LINK([#include <sys/sysctl.h>],
+ [return sysctl(NULL,0,NULL,NULL,NULL,0);],
+ AC_DEFINE([HAVE_SYSCTL],[1],[Define to '1' if sysctl is present and usable]))
+ AC_TRY_LINK([#include <sys/sysctl.h>],
+ [return sysctlbyname(NULL,NULL,NULL,NULL,0);],
+ AC_DEFINE([HAVE_SYSCTLBYNAME],[1],[Define to '1' if sysctlbyname is present and usable]))
case ${target} in
*-*-mingw*|*-*-cygwin*)
http://git.mpich.org/mpich.git/commitdiff/90da6e9004433937e0b54bd847c09e1e9…
commit 90da6e9004433937e0b54bd847c09e1e982a1744
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 10:33:46 2013 -0500
Fix check for declarations in hwloc.
hwloc's check for whether an explicitly function declaration is needed
was relying on whether a redefinition of the function throws an error.
This only works if the function declaration is already present in one
of the headers. If such a declaration is not present, the test might
fail with "implicit function declaration" with the right CFLAGS. This
leads the m4 macro to think that the declaration is already there in
one of the headers and an additional declaration is not needed.
This commit fixes this by adding a dummy function declaration,
together with the dummy function definition.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
index c66f26c..8a6445f 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/config/hwloc.m4
@@ -1217,7 +1217,10 @@ dnl number of arguments (10). Success means the compiler couldn't really check.
AC_DEFUN([_HWLOC_CHECK_DECL], [
AC_MSG_CHECKING([whether function $1 is declared])
AC_REQUIRE([AC_PROG_CC])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],[$1(1,2,3,4,5,6,7,8,9,10);])],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT([$4])
+ $1(int,long,int,long,int,long,int,long,int,long);],
+ [$1(1,2,3,4,5,6,7,8,9,10);])],
[AC_MSG_RESULT([no])
$3],
[AC_MSG_RESULT([yes])
http://git.mpich.org/mpich.git/commitdiff/255da3f6dff4aa605b00d36316497100d…
commit 255da3f6dff4aa605b00d36316497100d4bfa017
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Fri May 3 22:28:56 2013 -0500
Fixes for hwloc to build with -D_POSIX_C_SOURCE=200112L.
No reviewer.
diff --git a/src/pm/hydra/tools/topo/hwloc/hwloc/src/topology-freebsd.c b/src/pm/hydra/tools/topo/hwloc/hwloc/src/topology-freebsd.c
index c172264..c3a82f7 100644
--- a/src/pm/hydra/tools/topo/hwloc/hwloc/src/topology-freebsd.c
+++ b/src/pm/hydra/tools/topo/hwloc/hwloc/src/topology-freebsd.c
@@ -19,7 +19,7 @@
#ifdef HAVE_SYS_CPUSET_H
#include <sys/cpuset.h>
#endif
-#ifdef HAVE_SYSCTL
+#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
@@ -164,7 +164,7 @@ hwloc_freebsd_get_thread_cpubind(hwloc_topology_t topology __hwloc_attribute_unu
#endif
#endif
-#ifdef HAVE_SYSCTL
+#if defined(HAVE_SYSCTL) && defined(HAVE_SYSCTL_H)
static void
hwloc_freebsd_node_meminfo_info(struct hwloc_topology *topology)
{
http://git.mpich.org/mpich.git/commitdiff/581d59f5cf0926cc828fe6302f371cb42…
commit 581d59f5cf0926cc828fe6302f371cb427bb9bbd
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sun May 5 08:31:52 2013 -0500
Fix strict build errors in PMI simple.
FreeBSD seems to require arpa/inet.h for htons/ntohs definitions
during a strict build. This header might always be required on all
machines TCP/IP is present, but I'm configure protecting it to play
safe.
No reviewer.
diff --git a/src/pmi/simple/simple_pmiutil.h b/src/pmi/simple/simple_pmiutil.h
index ed0b741..020398d 100644
--- a/src/pmi/simple/simple_pmiutil.h
+++ b/src/pmi/simple/simple_pmiutil.h
@@ -16,6 +16,10 @@
# define PMIU_Assert(expr)
#endif
+#if defined HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif /* HAVE_ARPA_INET_H */
+
/* prototypes for PMIU routines */
void PMIU_Set_rank( int PMI_rank );
diff --git a/src/pmi/simple/subconfigure.m4 b/src/pmi/simple/subconfigure.m4
index 73ce6d5..a108cc9 100644
--- a/src/pmi/simple/subconfigure.m4
+++ b/src/pmi/simple/subconfigure.m4
@@ -12,13 +12,14 @@ AM_COND_IF([BUILD_PMI_SIMPLE],[
if test "$enable_pmiport" != "no" ; then
enable_pmiport=yes
fi
-AC_CHECK_HEADERS(unistd.h string.h stdlib.h sys/socket.h strings.h assert.h)
+AC_CHECK_HEADERS(unistd.h string.h stdlib.h sys/socket.h strings.h assert.h arpa/inet.h)
dnl Use snprintf if possible when creating messages
AC_CHECK_FUNCS(snprintf)
if test "$ac_cv_func_snprintf" = "yes" ; then
PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
fi
AC_CHECK_FUNCS(strncasecmp)
+
#
# PM's that need support for a port can set the environment variable
# NEED_PMIPORT in their setup_pm script.
http://git.mpich.org/mpich.git/commitdiff/e801995ec7558e5fa24ee462aac395c6a…
commit e801995ec7558e5fa24ee462aac395c6acad374c
Author: Pavan Balaji <balaji(a)mcs.anl.gov>
Date: Sat May 4 13:02:40 2013 -0500
Fix strict build failure in hydra.
No reviewer.
diff --git a/src/pm/hydra/configure.ac b/src/pm/hydra/configure.ac
index 892363f..053e98d 100644
--- a/src/pm/hydra/configure.ac
+++ b/src/pm/hydra/configure.ac
@@ -137,15 +137,34 @@ PAC_ENABLE_COVERAGE
AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \
sched.h sys/stat.h sys/param.h netinet/in.h netinet/tcp.h \
sys/un.h netdb.h sys/time.h time.h ifaddrs.h arpa/inet.h \
- errno.h poll.h fcntl.h netdb.h winsock2.h windows.h)
+ errno.h poll.h fcntl.h netdb.h winsock2.h windows.h signal.h)
AC_CHECK_LIB(socket,socket,LDFLAGS="$LDFLAGS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS="$LDFLAGS -lnsl",)
# Check for necessary functions
AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \
- strerror strsignal stat getifaddrs fcntl alarm isatty inet_ntop getpgid \
- setsid)
+ strerror strsignal stat fcntl alarm isatty inet_ntop getpgid \
+ setsid killpg)
+
+if test "$ac_cv_func_gettimeofday" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <sys/time.h>],gettimeofday)
+fi
+
+if test "$ac_cv_func_getpgid" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],getpgid)
+fi
+
+if test "$ac_cv_func_killpg" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <signal.h>],killpg)
+fi
+
+AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <ifaddrs.h>
+ ],
+ [return getifaddrs(NULL);],
+ [AC_DEFINE([HAVE_GETIFADDRS],1,[Define to '1' if getifaddrs is present and usable])])
# Check what we need to do about the environ extern
AC_CACHE_CHECK([for environ in unistd.h],pac_cv_environ_in_unistd,
diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index 6cdbfa9..adfcdeb 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -112,7 +112,11 @@ extern char *HYD_dbg_prefix;
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
-#endif
+#endif /* HAVE_SYS_SOCKET_H */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif /* HAVE_SIGNAL_H */
#define HYD_POLLIN (0x0001)
#define HYD_POLLOUT (0x0002)
@@ -159,6 +163,18 @@ extern char *HYD_dbg_prefix;
extern char **environ;
#endif /* MANUAL_EXTERN_ENVIRON */
+#if defined NEEDS_GETTIMEOFDAY_DECL
+int gettimeofday(struct timeval *tv, struct timezone *tz);
+#endif /* NEEDS_GETTIMEOFDAY_DECL */
+
+#if defined NEEDS_GETPGID_DECL
+pid_t getpgid(pid_t pid);
+#endif /* NEEDS_GETPGID_DECL */
+
+#if defined NEEDS_KILLPG_DECL
+int killpg(int pgrp, int sig);
+#endif /* NEEDS_KILLPG_DECL */
+
#define HYD_SILENT_ERROR(status) (((status) == HYD_GRACEFUL_ABORT) || ((status) == HYD_TIMED_OUT))
#define HYDRA_NAMESERVER_DEFAULT_PORT 6392
-----------------------------------------------------------------------
Summary of changes:
src/pm/hydra/configure.ac | 25 +++++++++++++++++--
src/pm/hydra/include/hydra.h | 18 +++++++++++++-
.../hydra/tools/topo/hwloc/hwloc/config/hwloc.m4 | 20 ++++++++++++++-
.../tools/topo/hwloc/hwloc/src/topology-freebsd.c | 4 +-
.../hydra/tools/topo/hwloc/hwloc/src/traversal.c | 3 ++
src/pmi/simple/simple_pmiutil.h | 4 +++
src/pmi/simple/subconfigure.m4 | 3 +-
7 files changed, 68 insertions(+), 9 deletions(-)
hooks/post-receive
--
MPICH primary repository
1
0