Skip to content
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

Move libfabric-refactor-traits into libfabric-refactor #36

Merged
merged 33 commits into from
Sep 25, 2023

Conversation

mattnappo
Copy link
Collaborator

All of the recent development of the refactor this summer was done on libfabric-refactor-traits. It would probably suffice to delete libfabric-refactor and just rename libfabric-refactor-traits to libfabric-refactor, but opening this PR for completion.

@mattnappo mattnappo merged commit f18622a into libfabric-refactor Sep 25, 2023
/home/ubuntu/rfaas-refactor/rfaas/lib/resources.cpp:43:40: warning: unused parameter ‘cores’ [-Wunused-parameter]
43 | std::vector<int> servers::select(int cores)
| ~~~~^~~~~
In file included from /home/ubuntu/rfaas-refactor/server/executor/server.hpp:15,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this code even compile? What's the purpose of this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean to commit this file.


#ifdef USE_LIBFABRIC
#include <rdma/fabric.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this include be behind #ifdef? What if we compile without libfabric but with ibverbs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the code contains symbols from this header, I was getting compiler issues when it was not included. I discussed this issue with Marcin earlier in the summer and he said that this was okay for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattnappo The problem is not inclusion - the problem is that the include should be guarded by #ifdef. If I compile just with verbs but not libfabric, then will it work?

{
ar(CEREAL_NVP(addr), CEREAL_NVP(rkey), CEREAL_NVP(size));
}
};

template<typename T>
struct Buffer : impl::Buffer{
struct LibfabricRemoteBuffer : RemoteBuffer<libfabric>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any difference between both implementations when it comes to RemoteBufer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. You are correct, this doesn't need to be a template.

using sge_t = typename library_traits<Library>::sge_t;
using lkey_t = typename library_traits<Library>::lkey_t;

mutable std::vector<sge_t> _sges;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of mutable here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was in the original codebase.

return static_cast<Derived *>(this)->array();
}

size_t size() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this function be defined here? A function member of a template class should not go into a .cpp file IMO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I will fix this.

}

namespace rdmalib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will delete

#ifdef USE_LIBFABRIC
_allocation_buffer.register_memory(_active.pd(), FI_WRITE | FI_REMOTE_WRITE);
#else
_allocation_buffer.register_memory(_active.pd(), IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just use the new refactored traits?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I must have missed this one.

{}

executor::~executor()
rdmalib::Buffer<char, libfabric> libfabric_executor::load_library(std::string path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function any different from ibverbs implementation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is different in the sense that they return different kinds of buffers. I guess I can make it return the parent buffer class?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, in that context it's fine - unless you can just make it a template in a parent class (depends if anything changes beyond the type itself).

bool execute(std::string fname, const std::vector<rdmalib::Buffer<T, Library>> & in, std::vector<rdmalib::Buffer<T, Library>> & out);
};

struct libfabric_executor : executor<libfabric_executor, libfabric> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are separate implementations for ibverbs and libfabric necessary? This is the executor from rfaas - shouldn't they just use the concepts from rdmalib? Why the need to duplicate executors?


int main(int argc, char ** argv)
{
// Register a SIGINT handler so that we can gracefully exit
//server::SignalHandler sighandler;

auto opts = server::opts(argc, argv);

#ifdef USE_LIBFABRIC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better for this to be a runtime switch - we can compile with both implementations enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants