-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPI Standalone Implementation - First Bits #46
Conversation
1d196dc
to
3f8b499
Compare
46fad57
to
fa8ebe2
Compare
73f8bec
to
8619945
Compare
…osing the binary as a mount volume
…irectory and in-file coherence
fa20d52
to
8b6251a
Compare
8b6251a
to
448c1f3
Compare
cd7bdab
to
6f0afcd
Compare
cmake/ExternalProjects.cmake
Outdated
@@ -30,6 +30,7 @@ set(PROTOC_EXE /usr/local/bin/protoc) | |||
set(GRPC_PLUGIN /usr/local/bin/grpc_cpp_plugin) | |||
|
|||
# Pistache | |||
link_directories(${CMAKE_INSTALL_PREFIX}/lib) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying the global CMake context like this should be avoided where possible, as it's changing it for all targets, and can lead to hard-to-diagnose build issues if this produces a conflict (e.g. if someone has installed pistache natively and there are two versions available). The CMake docs advise against using link_directories
unless absolutely necessary (https://cmake.org/cmake/help/latest/command/link_directories.html).
As it is, this is not technically related to pistache either, so if it was to make it in, it should live in the top-level CMake file.
Can you look at the grey box in the docs page and try the alternatives they list there?
include/faabric/endpoint/Endpoint.h
Outdated
int port = faabric::util::getSystemConfig().endpointPort; | ||
int threadCount = faabric::util::getSystemConfig().endpointNumThreads; | ||
std::thread servingThread; | ||
std::unique_ptr<Pistache::Http::Endpoint> httpEndpoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the modifications to the endpoint here? I would have thought we'd run the endpoint in the foreground or not run it at all. Is it needed for this native MPI stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint is currently used to bootstrap execution. This is, before instantiating the SingletonPool
object that starts the thread pool, state server, and http endpoint, we make a call to the scheduler in examples/mpi_helloworld.cpp:35
this in turn loads the function defined in faabric::executor::mpiFunc
and at this point we don't need the endpoint anymore.
If running the HTTP endpoint in the background is something we definately won't need down the road, then these changes may add complexity for a single call, but as previously mentioned they are needed for initialisation.
Alternatively, we could try and come up with a different bootstrapping scheme offline (that does not rely on the handling of http requests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see where the call to the endpoint is actually made. I can see that the scheduler is called, but I don't think the endpoint needs to be running for the scheduler to work. IIRC the endpoint is basically just an HTTP wrapper around the scheduler that doesn't do much else. What does the endpoint add in this case and where in mpi_helloworld.cpp
is the endpoint actually used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are completely right about this. I missunderstood some of the endpoint functionalities, I really don't need it at all. I will revert to the implementation in master
.
741b446
to
883c62f
Compare
883c62f
to
4efc512
Compare
a4a26fc
to
4a4904f
Compare
4a4904f
to
1ecd8f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor requests
add_dependencies(pistache pistache_ext) | ||
set_target_properties(pistache | ||
PROPERTIES IMPORTED_LOCATION ${CMAKE_INSTALL_PREFIX}/lib/libpistache.so | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks relatively clean. Can you move faasm and faasm-toolchain to this version of Faabric to check they both still work after (or before) merging this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is faasm's and here the toolchain's. Should we merge those PRs?
Note that the toolchain one would not pass for some missmatch in the submodule build (which I am looking into) but afaik everything else worked fine (as to what this PR is concerned).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny typo, then good to go
tasks/container.py
Outdated
@task | ||
def push_mpi_native(ctx): | ||
""" | ||
Push current version of gRPC container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny typo
This PR is the first bit towards running standalone MPI applications #42 . In it I include a simple executor implementation for MPI methods. It consists of a single thread execution thread in a singleton thread pool. I also implement support to run both
threadPool
andendpoint
either in the background or in the foreground (depending on where we want our program to hang).As of now, the way to port an MPI application is to change the
int main
line for a custom function (faabric::executor::mpiFunc
), and prepend a different main entrypoint (this could be wrapped in a macro).To test the hello world program, from a fresh instance:
To-Do:
mpi_helloworld
mpi_helloworld
mpi_helloworld
After this gets merged in:
To be discussed:
invoke
from outside the container is a bit dodgy, migrate to standalone script?