git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4487 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-08-16 18:51:25 +00:00
parent c98147c8e9
commit 211e5f3c09
3 changed files with 132 additions and 103 deletions

View File

@ -38,32 +38,35 @@ struct {
/* MPI Functions */
/* ---------------------------------------------------------------------- */
void MPI_Init(int *argc, char ***argv) {}
int MPI_Init(int *argc, char ***argv) {return 0;}
/* ---------------------------------------------------------------------- */
void MPI_Comm_rank(MPI_Comm comm, int *me)
int MPI_Comm_rank(MPI_Comm comm, int *me)
{
*me = 0;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Comm_size(MPI_Comm comm, int *nprocs)
int MPI_Comm_size(MPI_Comm comm, int *nprocs)
{
*nprocs = 1;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Abort(MPI_Comm comm, int errorcode)
int MPI_Abort(MPI_Comm comm, int errorcode)
{
exit(1);
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Finalize() {}
int MPI_Finalize() {return 0;}
/* ---------------------------------------------------------------------- */
@ -79,141 +82,156 @@ double MPI_Wtime()
/* ---------------------------------------------------------------------- */
void MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
int MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
{
printf("MPI Stub WARNING: Should not send message to self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Rsend(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
int MPI_Rsend(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)
{
printf("MPI Stub WARNING: Should not rsend message to self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status)
int MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status)
{
printf("MPI Stub WARNING: Should not recv message from self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Request *request)
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Request *request)
{
printf("MPI Stub WARNING: Should not recv message from self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Wait(MPI_Request *request, MPI_Status *status)
int MPI_Wait(MPI_Request *request, MPI_Status *status)
{
printf("MPI Stub WARNING: Should not wait on message from self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Waitall(int n, MPI_Request *request, MPI_Status *status)
int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status)
{
printf("MPI Stub WARNING: Should not wait on message from self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Waitany(int count, MPI_Request *request, int *index,
MPI_Status *status)
int MPI_Waitany(int count, MPI_Request *request, int *index,
MPI_Status *status)
{
printf("MPI Stub WARNING: Should not wait on message from self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Sendrecv(void *sbuf, int scount, MPI_Datatype sdatatype,
int dest, int stag, void *rbuf, int rcount,
MPI_Datatype rdatatype, int source, int rtag,
MPI_Comm comm, MPI_Status *status)
int MPI_Sendrecv(void *sbuf, int scount, MPI_Datatype sdatatype,
int dest, int stag, void *rbuf, int rcount,
MPI_Datatype rdatatype, int source, int rtag,
MPI_Comm comm, MPI_Status *status)
{
printf("MPI Stub WARNING: Should not send message to self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count)
int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count)
{
printf("MPI Stub WARNING: Should not get count of message to self\n");
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out)
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out)
{
*comm_out = comm;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Comm_dup(MPI_Comm comm, MPI_Comm *comm_out)
int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *comm_out)
{
*comm_out = comm;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Comm_free(MPI_Comm *comm) { }
int MPI_Comm_free(MPI_Comm *comm) {return 0;}
/* ---------------------------------------------------------------------- */
void MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods,
int reorder, MPI_Comm *comm_cart)
int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods,
int reorder, MPI_Comm *comm_cart)
{
*comm_cart = comm_old;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods,
int *coords)
int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods,
int *coords)
{
dims[0] = dims[1] = dims[2] = 1;
periods[0] = periods[1] = periods[2] = 1;
coords[0] = coords[1] = coords[2] = 0;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Cart_shift(MPI_Comm comm, int direction, int displ,
int *source, int *dest)
int MPI_Cart_shift(MPI_Comm comm, int direction, int displ,
int *source, int *dest)
{
*source = *dest = 0;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank)
int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank)
{
*rank = 0;
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Barrier(MPI_Comm comm) {}
int MPI_Barrier(MPI_Comm comm) {return 0;}
/* ---------------------------------------------------------------------- */
void MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm) {}
int MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm) {return 0;}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
int n;
if (datatype == MPI_INT) n = count*sizeof(int);
@ -224,13 +242,14 @@ void MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void 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)
{
@ -243,12 +262,14 @@ void MPI_Reduce(void *sendbuf, void *recvbuf, int count,
else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
void MPI_Scan(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
int MPI_Scan(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
int n;
if (datatype == MPI_INT) n = count*sizeof(int);
@ -259,15 +280,16 @@ void MPI_Scan(void *sendbuf, void *recvbuf, int count,
else if (datatype == MPI_DOUBLE_INT) n = count*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
int n;
if (sendtype == MPI_INT) n = sendcount*sizeof(int);
@ -278,15 +300,16 @@ void MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPI_Comm comm)
int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPI_Comm comm)
{
int n;
if (sendtype == MPI_INT) n = sendcount*sizeof(int);
@ -297,14 +320,15 @@ void MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void 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)
{
int n;
if (datatype == MPI_INT) n = *recvcounts*sizeof(int);
@ -315,15 +339,16 @@ void MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
else if (datatype == MPI_DOUBLE_INT) n = *recvcounts*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm)
int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm)
{
int n;
if (sendtype == MPI_INT) n = sendcount*sizeof(int);
@ -334,13 +359,14 @@ void MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}
/* ---------------------------------------------------------------------- */
/* copy values from data1 to data2 */
void 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)
{
@ -353,4 +379,5 @@ void MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
else if (sendtype == MPI_DOUBLE_INT) n = sendcount*sizeof(double_int);
memcpy(recvbuf,sendbuf,n);
return 0;
}

View File

@ -18,6 +18,8 @@
#define MPI_COMM_WORLD 0
#define MPI_SUCCESS 0
#define MPI_INT 1
#define MPI_FLOAT 2
#define MPI_DOUBLE 3
@ -47,64 +49,64 @@ struct MPI_Status {
/* Function prototypes for MPI stubs */
void MPI_Init(int *argc, char ***argv);
void MPI_Comm_rank(MPI_Comm comm, int *me);
void MPI_Comm_size(MPI_Comm comm, int *nprocs);
void MPI_Abort(MPI_Comm comm, int errorcode);
void MPI_Finalize();
int MPI_Init(int *argc, char ***argv);
int MPI_Comm_rank(MPI_Comm comm, int *me);
int MPI_Comm_size(MPI_Comm comm, int *nprocs);
int MPI_Abort(MPI_Comm comm, int errorcode);
int MPI_Finalize();
double MPI_Wtime();
void MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
void MPI_Rsend(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
void MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status);
void MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Request *request);
void MPI_Wait(MPI_Request *request, MPI_Status *status);
void MPI_Waitall(int n, MPI_Request *request, MPI_Status *status);
void MPI_Waitany(int count, MPI_Request *request, int *index,
MPI_Status *status);
void MPI_Sendrecv(void *sbuf, int scount, MPI_Datatype sdatatype,
int MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
int MPI_Rsend(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
int MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status);
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Request *request);
int MPI_Wait(MPI_Request *request, MPI_Status *status);
int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status);
int MPI_Waitany(int count, MPI_Request *request, int *index,
MPI_Status *status);
int MPI_Sendrecv(void *sbuf, int scount, MPI_Datatype sdatatype,
int dest, int stag, void *rbuf, int rcount,
MPI_Datatype rdatatype, int source, int rtag,
MPI_Comm comm, MPI_Status *status);
void MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count);
int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count);
void MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
void MPI_Comm_dup(MPI_Comm comm, MPI_Comm *comm_out);
void MPI_Comm_free(MPI_Comm *comm);
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *comm_out);
int MPI_Comm_free(MPI_Comm *comm);
void MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods,
int reorder, MPI_Comm *comm_cart);
void MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods,
int *coords);
void MPI_Cart_shift(MPI_Comm comm, int direction, int displ,
int *source, int *dest);
void MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank);
int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods,
int reorder, MPI_Comm *comm_cart);
int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods,
int *coords);
int MPI_Cart_shift(MPI_Comm comm, int direction, int displ,
int *source, int *dest);
int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank);
void MPI_Barrier(MPI_Comm comm);
void MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm);
void MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
void MPI_Reduce(void *sendbuf, void *recvbuf, int count,
int MPI_Barrier(MPI_Comm comm);
int MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm);
int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
void MPI_Scan(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
void MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm);
void MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPI_Comm comm);
void MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
void MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm);
void MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
int MPI_Scan(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm);
int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPI_Comm comm);
int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm);
int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm);

View File

@ -552,7 +552,7 @@ void FixAveTime::invoke_scalar(int ntimestep)
scalar = compute->vector[argindex[i]-1];
}
// access fix fields, guaranteed to be ready
// access fix fields, guaranteed to be ready
} else if (which[i] == FIX) {
if (argindex[i] == 0)
@ -560,7 +560,7 @@ void FixAveTime::invoke_scalar(int ntimestep)
else
scalar = modify->fix[m]->compute_vector(argindex[i]-1);
// evaluate equal-style variable
// evaluate equal-style variable
} else if (which[i] == VARIABLE)
scalar = input->variable->compute_equal(m);