-
Notifications
You must be signed in to change notification settings - Fork 17
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
One RPCClient per Core #345
Open
hunhoffe
wants to merge
10
commits into
master
Choose a base branch
from
dev/fxmark-bench
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e293f23
prepare for fxmark bench
hunhoffe 2ab2732
One shmem transport per client core
hunhoffe a57bbe8
Added flag for initial connection to shmem client registration request
zmckevitt 01a7101
Remove commented code
hunhoffe d4c3a32
Re-enable ethernet tests
hunhoffe 8f301ef
remove unused argument from shmem initialization function
zmckevitt 22da29b
Preliminary code for multi-server rpc over ethernet
zmckevitt 13012e7
Updated ethernet RPC initialization on client and controller, synchro…
zmckevitt 4acf557
Fixed ethernet rpc connection issues on single core client
zmckevitt 3a48415
Client initialization only waits when there is more than one core to …
zmckevitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ use crate::arch::rackscale::dcm::{ | |
use crate::arch::MAX_MACHINES; | ||
use crate::cmdline::Transport; | ||
use crate::transport::ethernet::ETHERNET_IFACE; | ||
use crate::transport::shmem::create_shmem_transport; | ||
use crate::transport::shmem::{create_shmem_transport, NUM_SHMEM_TRANSPORTS}; | ||
|
||
use super::*; | ||
|
||
|
@@ -31,46 +31,32 @@ static DCMServerReady: AtomicBool = AtomicBool::new(false); | |
pub(crate) fn run() { | ||
let mid = *crate::environment::CORE_ID; | ||
|
||
// Initialize one server per controller thread | ||
let mut server = if crate::CMDLINE | ||
.get() | ||
.map_or(false, |c| c.transport == Transport::Ethernet) | ||
{ | ||
let transport = Box::new( | ||
TCPTransport::new( | ||
None, | ||
CONTROLLER_PORT_BASE + mid as u16 - 1, | ||
Arc::clone(ÐERNET_IFACE), | ||
) | ||
.expect("Failed to create TCP transport"), | ||
); | ||
let mut server = Server::new(transport); | ||
register_rpcs(&mut server); | ||
server | ||
} else if crate::CMDLINE | ||
.get() | ||
.map_or(false, |c| c.transport == Transport::Shmem) | ||
{ | ||
let transport = Box::new( | ||
create_shmem_transport(mid.try_into().unwrap()) | ||
.expect("Failed to create shmem transport"), | ||
); | ||
let transports = | ||
create_shmem_transport(mid.try_into().unwrap()).expect("Failed to create shmem transport"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to use ethernet instead of shmem when ethernet is selected |
||
|
||
let mut server = Server::new(transport); | ||
let mut servers: ArrayVec<Server<'_>, { NUM_SHMEM_TRANSPORTS as usize }> = ArrayVec::new(); | ||
for transport in transports.into_iter() { | ||
let mut server = Server::new(Box::new(transport)); | ||
register_rpcs(&mut server); | ||
server | ||
servers.push(server); | ||
} | ||
|
||
/* | ||
} else { | ||
unreachable!("No supported transport layer specified in kernel argument"); | ||
}; | ||
*/ | ||
|
||
ClientReadyCount.fetch_add(1, Ordering::SeqCst); | ||
|
||
// Wait for all clients to connect before fulfilling any RPCs. | ||
while !DCMServerReady.load(Ordering::SeqCst) {} | ||
|
||
server | ||
.add_client(&CLIENT_REGISTRAR) | ||
.expect("Failed to accept client"); | ||
for s_index in 0..servers.len() { | ||
servers[s_index] | ||
.add_client(&CLIENT_REGISTRAR) | ||
.expect("Failed to accept client"); | ||
} | ||
|
||
ClientReadyCount.fetch_add(1, Ordering::SeqCst); | ||
|
||
|
@@ -114,9 +100,11 @@ pub(crate) fn run() { | |
// Start running the RPC server | ||
log::info!("Starting RPC server for client {:?}!", mid); | ||
loop { | ||
let _handled = server | ||
.try_handle() | ||
.expect("Controller failed to handle RPC"); | ||
for s_index in 0..servers.len() { | ||
let _handled = servers[s_index] | ||
.try_handle() | ||
.expect("Controller failed to handle RPC"); | ||
} | ||
} | ||
} | ||
|
||
|
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to create ethernet instead of shmem when ethernet is selected