Skip to content

Commit

Permalink
Squashed 'mpi-serial/' changes from d757b65..b1b0bfd
Browse files Browse the repository at this point in the history
b1b0bfd Merge pull request MCSclimate#10 from gold2718/add_version
e2804c7 Fixed typo in print statement
1aa326e Added MPI_VERSION, MPI_SUBVERSION, and MPI_Get_Version
99df320 Merge branch `jedwards4b/jpe_add_mpi_type_create_hvector` (PR MCSclimate#2)
6d736e2 Merge branch 'gold2718/cleandoc' (PR MCSclimate#7)
94e39f8 Removed obsolete NOTES file
c696f25 Merge branch gold2718/add_tag_ub (PR MCSclimate#6)
481ffe3 Removed tabs from mpif.h and added new constant, MPI_TAG_UB. Added newer interfaces to README Removed redundant interface, mpi_op_create from collective.c
0a44baa add mpi_type_create_hvector
1ef3693 Merge branch MCSclimate/rljacob/remove-eolwhite (PR MCSclimate#1)
8c02275 Remove all whitespace from end-of-line

git-subtree-dir: mpi-serial
git-subtree-split: b1b0bfd4d4b71abe071abbe6ccf01ece98d93ab0
  • Loading branch information
Steve Goldhaber committed Sep 4, 2017
1 parent d757b65 commit 85128cc
Show file tree
Hide file tree
Showing 33 changed files with 584 additions and 553 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ LIB = lib$(MODULE).a
#RULES

.SUFFIXES:
.SUFFIXES: .F90 .c .o
.SUFFIXES: .F90 .c .o

.c.o:
$(CC) -c $(INCPATH) $(DEFS) $(CPPDEFS) $(CFLAGS) $<
Expand Down
46 changes: 0 additions & 46 deletions NOTES

This file was deleted.

42 changes: 40 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ List of MPI calls supported
mpi_abort
mpi_error_string
mpi_initialized
mpi_get_processor_name
mpi_get_library_version
mpi_wtime

comm and group ops
mpi_comm_free
Expand All @@ -74,29 +77,64 @@ List of MPI calls supported
mpi_comm_split
mpi_comm_group
mpi_group_incl
mpi_group_range_incl
mpi_group_union
mpi_group_intersection
mpi_group_difference
mpi_group_translate_ranks
mpi_group_free
mpi_cart_create
mpi_cart_coords
mpi_dims_create

send/receive ops
mpi_irecv
mpi_recv
mpi_test
mpi_testany
mpi_testall
mpi_testsome
mpi_wait
mpi_waitany
mpi_waitall
mpi_waitsome
mpi_isend
mpi_send
mpi_ssend
mpi_rsend
mpi_irsend
mpi_sendrecv
mpi_iprobe
mpi_probe
mpi_request_free

collective operations
mpi_barrier
mpi_bcast
mpi_gather
mpi_gatherv
mpi_allgather
mpi_scatter
mpi_scatterv
mpi_reduce
mpi_allreduce


mpi_reduce_scatter
mpi_scan
mpi_alltoall
mpi_alltoallv
mpi_alltoallw
mpi_op_create
mpi_op_free

data types and info objects
mpi_get_count
mpi_get_elements
mpi_pack
mpi_pack_size
mpi_unpack
mpi_info_create
mpi_info_set
mpi_info_free

-----
EOF
8 changes: 4 additions & 4 deletions cart.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "mpiP.h"

/*
/*
* MPI_Cart_create
*
* create a new communicator,
* create a new communicator,
*/


Expand Down Expand Up @@ -53,7 +53,7 @@ FC_FUNC( mpi_cart_get , MPI_CART_GET )


int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims,
int *periods, int *coords)
int *periods, int *coords)
{
int i;
for (i=0;i<maxdims;i++)
Expand All @@ -80,7 +80,7 @@ FC_FUNC( mpi_cart_coords , MPI_CART_COORDS)
}


int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords)
int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords)
{
int i;

Expand Down
55 changes: 17 additions & 38 deletions collective.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ FC_FUNC( mpi_gatherv , MPI_GATHERV )
}


int MPI_Gatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
int MPI_Gatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
Expand Down Expand Up @@ -200,7 +200,7 @@ int MPI_Allgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype,

/*********/

/* MPI_Scatter
/* MPI_Scatter
* Scattering to one proc involves only one copy operation, so copy
* data from source to dest pointer
*/
Expand Down Expand Up @@ -233,7 +233,7 @@ int MPI_Scatter(void * sendbuf, int sendcount, MPI_Datatype sendtype,

copy_data2(sendbuf, sendcount, sendtype,
recvbuf, recvcount, recvtype);

return(MPI_SUCCESS);
}

Expand All @@ -251,11 +251,11 @@ FC_FUNC( mpi_scatterv , MPI_SCATTERV )
*sendtype, mpi_c_in_place(recvbuf), *recvcount,
*recvtype, *root, *comm);
}



int MPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
MPI_Datatype sendtype, void* recvbuf, int recvcount,


int MPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
int offset;
Expand All @@ -278,7 +278,7 @@ int MPI_Scatterv(void* sendbuf, int *sendcounts, int *displs,
copy_data2((char*)sendbuf+offset, sendcounts[0], sendtype,
recvbuf, recvcount, recvtype);
// memcpy(recvbuf,(char *)sendbuf+offset,sendcounts[0] * sendtype);

return(MPI_SUCCESS);
}

Expand All @@ -298,7 +298,7 @@ FC_FUNC( mpi_reduce , MPI_REDUCE )



int MPI_Reduce(void* sendbuf, void* recvbuf, int count,
int MPI_Reduce(void* sendbuf, void* recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)

{
Expand Down Expand Up @@ -328,7 +328,7 @@ FC_FUNC( mpi_allreduce , MPI_ALLREDUCE )
}


int MPI_Allreduce(void* sendbuf, void* recvbuf, int count,
int MPI_Allreduce(void* sendbuf, void* recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
if (sendbuf==MPI_IN_PLACE)
Expand All @@ -345,7 +345,7 @@ int MPI_Allreduce(void* sendbuf, void* recvbuf, int count,
/*********/


/* MPI_Reduce_scatter
/* MPI_Reduce_scatter
* Performs reduction of n*sum(recvcounts) and distributes to all members
* in a group. We do this to only one proc, so recvcounts[0] is only used.
*/
Expand All @@ -358,8 +358,8 @@ FC_FUNC(mpi_reduce_scatter, MPI_REDUCE_SCATTER)
}


int MPI_Reduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
int MPI_Reduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
copy_data2(sendbuf, recvcounts[0], datatype, recvbuf, recvcounts[0], datatype);
}
Expand All @@ -379,7 +379,7 @@ FC_FUNC( mpi_scan , MPI_SCAN)



int MPI_Scan(void* sendbuf, void* recvbuf, int count,
int MPI_Scan(void* sendbuf, void* recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm )
{
copy_data2(sendbuf, count, datatype, recvbuf, count, datatype);
Expand Down Expand Up @@ -431,7 +431,7 @@ int MPI_Alltoallv(void *sendbuf, int *sendcounts,
int *sdispls, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts,
int *rdispls, MPI_Datatype recvtype,
MPI_Comm comm)
MPI_Comm comm)

{
int send_offset;
Expand All @@ -447,7 +447,7 @@ int MPI_Alltoallv(void *sendbuf, int *sendcounts,

copy_data2((char*)sendbuf+send_offset, sendcounts[0], sendtype,
(char*)recvbuf+recv_offset, recvcounts[0], recvtype);

// memcpy( (char *)recvbuf+recv_offset, (char *)sendbuf+send_offset,
// sendcounts[0] * sendtype);

Expand Down Expand Up @@ -476,40 +476,19 @@ int MPI_Alltoallw(void *sendbuf, int *sendcounts,
int *sdispls, MPI_Datatype *sendtypes,
void *recvbuf, int *recvcounts,
int *rdispls, MPI_Datatype *recvtypes,
MPI_Comm comm)
MPI_Comm comm)

{

copy_data2((char*)sendbuf+sdispls[0], sendcounts[0], sendtypes[0],
(char*)recvbuf+rdispls[0], recvcounts[0], recvtypes[0]);


return(MPI_SUCCESS);
}


/*********/


FC_FUNC( mpi_op_create , MPI_OP_CREATE )
( void *function, int *commute, int *op, int *ierror )
{
*ierror=MPI_Op_create(function,*commute,op);
}



int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op)
{
*op=MPI_OP_NULL;

return(MPI_SUCCESS);

}




/*********/

MPI_Op MPI_Op_f2c(MPI_Fint op)
Expand Down
6 changes: 3 additions & 3 deletions comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
*group= MPI_GROUP_ONE;

return(MPI_SUCCESS);
}
}

/* Intercomm_create
*
*
*/

FC_FUNC(mpi_intercomm_create, MPI_INTERCOMM_CREATE)(
Expand All @@ -220,7 +220,7 @@ FC_FUNC(mpi_intercomm_create, MPI_INTERCOMM_CREATE)(

int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader,
MPI_Comm peer_comm, int remote_leader,
int tag, MPI_Comm *newintercomm)
int tag, MPI_Comm *newintercomm)
{
if (local_comm==MPI_COMM_NULL && peer_comm==MPI_COMM_NULL)
*newintercomm = MPI_COMM_NULL;
Expand Down
10 changes: 5 additions & 5 deletions copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* fix this issue later...
*/

extern int Pcopy_data2(void *source, int src_count, Datatype src_type,
extern int Pcopy_data2(void *source, int src_count, Datatype src_type,
void *dest, int dest_count, Datatype dest_type);


Expand All @@ -39,7 +39,7 @@ int copy_data2(void *source, int src_count, MPI_Datatype src_type,



int Pcopy_data2(void *source, int src_count, Datatype src_type,
int Pcopy_data2(void *source, int src_count, Datatype src_type,
void *dest, int dest_count, Datatype dest_type)
{
int i;
Expand All @@ -55,7 +55,7 @@ int Pcopy_data2(void *source, int src_count, Datatype src_type,
exit(-1);
}

// A receive of less elements than sent
// A receive of less elements than sent
// is valid, but the reverse is a violation

if (src_type->count * src_count < dest_type->count * dest_count)
Expand All @@ -71,7 +71,7 @@ int Pcopy_data2(void *source, int src_count, Datatype src_type,
{

#ifdef TYPE_CHECKING
if ( src_type->pairs[i % src_type->count].type !=
if ( src_type->pairs[i % src_type->count].type !=
dest_type->pairs[i % dest_type->count].type)
{
printf("copy_data: Types don't match.\n");
Expand All @@ -80,7 +80,7 @@ int Pcopy_data2(void *source, int src_count, Datatype src_type,
#endif

soffset = src_type->pairs[i % src_type->count].disp + ((i / src_type->count) * src_extent);
doffset = dest_type->pairs[i % dest_type->count].disp + ((i / dest_type->count) * dest_extent);
doffset = dest_type->pairs[i % dest_type->count].disp + ((i / dest_type->count) * dest_extent);

memcpy(dest+doffset, source+soffset, Simpletype_length(dest_type->pairs[i % dest_type->count].type));
}
Expand Down
2 changes: 1 addition & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/*
* Error handling code
* Just a stub for now to support the MPI interface without actually
* Just a stub for now to support the MPI interface without actually
* doing anything
*/

Expand Down
Loading

0 comments on commit 85128cc

Please sign in to comment.