Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ludwig-cf/ludwig into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
kevinstratford committed Dec 23, 2021
2 parents 08c07f0 + 823f2df commit 4a76117
Show file tree
Hide file tree
Showing 105 changed files with 8,072 additions and 1,127 deletions.
2 changes: 1 addition & 1 deletion config/codeql-g++.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
BUILD = serial
MODEL = -D_D3Q19_

CC = g++
CC = g++ -fopenmp
CFLAGS = -O -g -Wall -Werror

AR = ar
Expand Down
21 changes: 8 additions & 13 deletions mpi_s/mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ enum collective_operations {MPI_MAX,
MPI_LOR,
MPI_LXOR};

/* special datatypes for constructing derived datatypes */

#define MPI_UB 0
#define MPI_LB 0

/* reserved communicators */

enum reserved_communicators{MPI_COMM_WORLD, MPI_COMM_SELF};
Expand All @@ -112,6 +107,13 @@ enum reserved_communicators{MPI_COMM_WORLD, MPI_COMM_SELF};

#define MPI_IN_PLACE ((void *) 1)

/* Thread support level */

#define MPI_THREAD_SINGLE 1
#define MPI_THREAD_FUNNELED 2
#define MPI_THREAD_SERIALIZED 3
#define MPI_THREAD_MULTIPLE 4

/* Interface */

int MPI_Barrier(MPI_Comm comm);
Expand Down Expand Up @@ -161,10 +163,6 @@ int MPI_Type_contiguous(int count, MPI_Datatype oldtype,
MPI_Datatype * newtype);
int MPI_Type_vector(int count, int blocklength, int stride,
MPI_Datatype oldtype, MPI_Datatype * newtype);
int MPI_Type_struct(int count, int * array_of_blocklengths,
MPI_Aint * array_of_displacements,
MPI_Datatype * array_of_types, MPI_Datatype * newtype);
int MPI_Address(void * location, MPI_Aint * address);
int MPI_Type_commit(MPI_Datatype * datatype);
int MPI_Type_free(MPI_Datatype * datatype);
int MPI_Waitall(int count, MPI_Request * array_of_requests,
Expand Down Expand Up @@ -209,16 +207,13 @@ double MPI_Wtime(void);
double MPI_Wtick(void);

int MPI_Init(int * argc, char *** argv);
int MPI_Init_thread(int * argc, char *** argv, int required, int * provided);
int MPI_Finalize(void);
int MPI_Initialized(int * flag);
int MPI_Abort(MPI_Comm comm, int errorcode);

/* MPI 2.0 */
/* In particular, replacements for routines removed from MPI 3 */
/* MPI_Address() -> MPI_Get_Address()
* MPI_Type_struct() -> MPI_Type_create_struct()
* MPI_Type_lb() and MPI_Type_ub() -> MPI_Type_get_extent()
* See MPI 3 standard */

int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler erhandler);
int MPI_Get_address(const void * location, MPI_Aint * address);
Expand Down
103 changes: 42 additions & 61 deletions mpi_s/mpi_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,29 @@ int MPI_Init(int * argc, char *** argv) {
return MPI_SUCCESS;
}

/*****************************************************************************
*
* MPI_Init_thread
*
*****************************************************************************/

int MPI_Init_thread(int * argc, char *** argv, int required, int * provided) {

assert(argc);
assert(argv);
assert(MPI_THREAD_SINGLE <= required && required <= MPI_THREAD_MULTIPLE);
assert(provided);

MPI_Init(argc, argv);

/* We are going to say that MPI_THREAD_SERIALIZED is available */
/* Not MPI_THREAD_MULTIPLE */

*provided = MPI_THREAD_SERIALIZED;

return MPI_SUCCESS;
}

/*****************************************************************************
*
* MPI_Initialized
Expand Down Expand Up @@ -309,8 +332,8 @@ int MPI_Irecv(void * buf, int count, MPI_Datatype datatype, int source,
assert(buf);
assert(request);

printf("MPI_Irecv should not be called in serial.\n");
exit(0);
/* Could assert tag is ok */
*request = tag;

return MPI_SUCCESS;
}
Expand Down Expand Up @@ -345,8 +368,8 @@ int MPI_Isend(void * buf, int count, MPI_Datatype datatype, int dest,
assert(buf);
assert(request);

printf("MPI_Isend should not be called in serial\n");
exit(0);
/* Could assert tag is ok */
*request = tag;

return MPI_SUCCESS;
}
Expand Down Expand Up @@ -394,12 +417,26 @@ int MPI_Waitall(int count, MPI_Request * requests, MPI_Status * statuses) {
*****************************************************************************/

int MPI_Waitany(int count, MPI_Request requests[], int * index,
MPI_Status * statuses) {
MPI_Status * status) {

assert(count >= 0);
assert(requests);
assert(index);

*index = MPI_UNDEFINED;

for (int ireq = 0; ireq < count; ireq++) {
if (requests[ireq] != MPI_REQUEST_NULL) {
*index = ireq;
requests[ireq] = MPI_REQUEST_NULL;
if (status) {
status->MPI_SOURCE = 0;
status->MPI_TAG = requests[ireq];
}
break;
}
}

return MPI_SUCCESS;
}

Expand Down Expand Up @@ -732,62 +769,6 @@ int MPI_Type_vector(int count, int blocklength, int stride,
return MPI_SUCCESS;
}

/*****************************************************************************
*
* MPI_Type_struct
*
* Superceded by MPI_Type_create_struct.
*
*****************************************************************************/

int MPI_Type_struct(int count, int * array_of_blocklengths,
MPI_Aint * array_of_displacements,
MPI_Datatype * array_of_types, MPI_Datatype * newtype) {

assert(count > 0);
assert(array_of_blocklengths);
assert(array_of_displacements);
assert(array_of_types);
assert(newtype);

printf("MPI_Type_struct: please use MPI_Type_create_struct instead\n");

return -1;
}

/*****************************************************************************
*
* MPI_Address
*
* Please use MPI_Get_Address().
*
*****************************************************************************/

int MPI_Address(void * location, MPI_Aint * address) {

assert(location);
assert(address);

*address = 0;

return MPI_SUCCESS;
}

/*****************************************************************************
*
* MPI_Errhandler_set
*
*****************************************************************************/

int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {

assert(mpi_info);
assert(comm != MPI_COMM_NULL);
assert(errhandler == MPI_ERRORS_ARE_FATAL);

return MPI_SUCCESS;
}

/*****************************************************************************
*
* MPI_Cart_create
Expand Down
Loading

0 comments on commit 4a76117

Please sign in to comment.