-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A first cut of Froozle MPI, a no-op MPI implementation just to experiment with MPI Forum issue #137 (mpi-forum/mpi-issues#137). This commit includes a first cut of C and C++ APIs; Fortran is still to come. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
- Loading branch information
0 parents
commit 125b5af
Showing
41 changed files
with
1,023 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*.in | ||
Makefile | ||
|
||
autom4te.cache | ||
|
||
config.log | ||
config.status | ||
config.guess | ||
config.sub | ||
|
||
aclocal.m4 | ||
configure | ||
libtool | ||
stamp-h? | ||
|
||
.libs | ||
.deps | ||
|
||
*.o | ||
*.lo | ||
*.la |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
- Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer listed | ||
in this license in the documentation and/or other materials | ||
provided with the distribution. | ||
|
||
- Neither the name of the copyright holders nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
The copyright holders provide no reassurances that the source code | ||
provided does not infringe any patent, copyright, or any other | ||
intellectual property rights of third parties. The copyright holders | ||
disclaim any liability to any recipient for claims brought against | ||
recipient by any third party for infringement of that parties | ||
intellectual property rights. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
|
||
SUBDIRS = \ | ||
config \ | ||
c \ | ||
cxx \ | ||
fortran-mpifh \ | ||
fortran-usempi \ | ||
fortran-usempif08 \ | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
This is a dummy, no-op MPI implementation that is an example of | ||
[MPI Forum issue | ||
#137](https://github.com/mpi-forum/mpi-issues/issues/137). | ||
|
||
Specifically: the API calls in these libraries do nothing other than | ||
print out that they were called. The intent is to show how ticket | ||
#137 could be implemented, and what the resulting symbols will look | ||
like. It also gives a platform for real experimentation with | ||
different compilers, options, run-time environments, etc. | ||
|
||
Froozle MPI provides only a few MPI API functions, just to give a | ||
flavor of how things will look with ticket #137: | ||
|
||
- MPI_INIT, MPI_FINALIZE, MPI_COMM_RANK, MPI_COMM_SIZE | ||
- MPI_SEND, MPI_RECV | ||
- MPI_ALLGATHER | ||
|
||
5 flavors of the APIs are available: | ||
|
||
1. C: in the c/ directory. Both "int" and "MPI_Count" versions of the | ||
send, receive, and allgather APIs are implemented. | ||
|
||
2. C++: in the cxx/ directory. The C symbols are used for everything | ||
except for the send, receive, and allgather APIs. | ||
|
||
3. Fortran mpif.h: in the fortran-mpifh/ directory. The "glue" APIs | ||
(init, finalize, comm_rank, comm_size) are implemented in Fortran. | ||
The others are implemented in C, but per ticket #137, only "integer" | ||
versions are available. | ||
|
||
4. Fortran mpi module: in the fortran-usempi/ directory. ...more to | ||
write here. | ||
|
||
5. Fortran mpi_f08 module: in the fortran-usempif08/ directory. | ||
...more to write here. | ||
|
||
You must have a C, C++, and Fortran compiler available to compile | ||
Froozle. | ||
|
||
Build Froozle with the following: | ||
|
||
---- | ||
# If running from a git clone, you must have the GNU Autotools | ||
# installed, and then run: | ||
$ ./autogen.sh | ||
|
||
# If you are building from a bootstrapped tarball, you can skip the | ||
# above autogen.sh step proceed directly to the next steps. | ||
|
||
# Run the configure script: | ||
$ ./configure |& tee config.out | ||
|
||
# Build Froozle | ||
$ make -j 8 |& tee make.out | ||
|
||
# Optionally install Froozle | ||
$ make install | ||
----- | ||
|
||
A few example applications are in the examples/ directory. | ||
|
||
Comments are welcome. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
set +x | ||
|
||
autoreconf -ivf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mpi-config.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
|
||
lib_LTLIBRARIES = libmpi.la | ||
|
||
libmpi_la_SOURCES = \ | ||
mpi.h \ | ||
mpi-config.h \ | ||
mpi-common.h \ | ||
globals.c \ | ||
allgather_int.c \ | ||
allgather_count.c \ | ||
comm_rank.c \ | ||
comm_size.c \ | ||
finalize.c \ | ||
init.c \ | ||
recv_int.c \ | ||
recv_count.c \ | ||
send_int.c \ | ||
send_count.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Allgather_count(const void *sendbuf, MPI_Count sendcount, | ||
MPI_Datatype sendtype, | ||
void *recvbuf, MPI_Count recvcount, | ||
MPI_Datatype recvtype, MPI_Comm comm) | ||
{ | ||
printf("This is C MPI_Allgather_count\n"); | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Allgather(const void *sendbuf, int sendcount, | ||
MPI_Datatype sendtype, | ||
void *recvbuf, int recvcount, | ||
MPI_Datatype recvtype, MPI_Comm comm) | ||
{ | ||
printf("This is C MPI_Allgather_count\n"); | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Comm_rank(MPI_Comm comm, int *rank) | ||
{ | ||
printf("This is C MPI_Comm_rank\n"); | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Comm_size(MPI_Comm comm, int *size) | ||
{ | ||
printf("This is C MPI_Comm_size\n"); | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Finalize(void) | ||
{ | ||
printf("This is C MPI_Finalize\n"); | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
struct froozle_comm { | ||
int bogus; | ||
}; | ||
|
||
struct froozle_datatype { | ||
int bogus; | ||
}; | ||
|
||
|
||
static struct froozle_comm froozle_comm_world = {0}; | ||
|
||
static struct froozle_datatype froozle_int = {0}; | ||
static struct froozle_datatype froozle_char = {0}; | ||
|
||
MPI_Comm MPI_COMM_WORLD = &froozle_comm_world; | ||
|
||
MPI_Datatype MPI_INT = &froozle_int; | ||
MPI_Datatype MPI_CHAR = &froozle_char; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#include "froozle_config.h" | ||
|
||
#include <stdio.h> | ||
|
||
#define FROOZLE_BUILDING 1 | ||
|
||
#include "mpi.h" | ||
|
||
|
||
int MPI_Init(int *argc, char ***argv) | ||
{ | ||
printf("This is C MPI_Init\n"); | ||
|
||
#if FROOZLE_HAVE_C11_GENERIC | ||
printf("NOTE: This Froozle built with C11 _Generic support. Yay!\n"); | ||
#else | ||
printf("NOTE: This Froozle was built without C11 _Generic support. Bummer.\n"); | ||
#endif | ||
|
||
return MPI_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. | ||
*/ | ||
|
||
#ifndef MPI_COMMON_H | ||
#define MPI_COMMON_H | ||
|
||
/***************************************************************/ | ||
|
||
struct froozle_comm; | ||
struct froozle_datatype; | ||
struct froozle_status; | ||
|
||
typedef struct froozle_comm *MPI_Comm; | ||
typedef struct froozle_datatype *MPI_Datatype; | ||
|
||
typedef struct froozle_status MPI_Status; | ||
|
||
typedef long MPI_Count; | ||
|
||
enum { | ||
MPI_SUCCESS | ||
}; | ||
|
||
extern MPI_Comm MPI_COMM_WORLD; | ||
|
||
extern MPI_Datatype MPI_INT; | ||
extern MPI_Datatype MPI_CHAR; | ||
|
||
/***************************************************************/ | ||
|
||
// These functions do not have count arguments, and are therefore | ||
// shared between both C and C++ interfaces. | ||
|
||
int MPI_Init(int *argc, char ***argv); | ||
int MPI_Comm_rank(MPI_Comm comm, int *rank); | ||
int MPI_Comm_size(MPI_Comm comm, int *size); | ||
int MPI_Finalize(void); | ||
|
||
#endif // !MPI_COMMON_H |
Oops, something went wrong.