Locality-Aware Neighbor Updates#63
Conversation
Fix syntax for date command in traffic workflow
Added logic to fetch and output daily clone traffic data.
Run at midnight is breaking; run at 6am each day instead.
… to remove object entirely...
|
This also includes a bug fix. The suitesparse neighbor alltoallv init test was missing : Which caused an error (creating a persistent request) without freeing it. Tests were still passing, but if you ran the test individually, you received an error statement from MPICH. |
|
Actually, there are two bug fixes here. The second was a missing MPI_Waitall in one implementation of alltoall_crs. |
TheMasterDirk
left a comment
There was a problem hiding this comment.
I leave the conceptual validation of the code to you, as I just skimmed that part (and it seemed ok to me).
Most of my requested changes are just consistency fixes and/or keeping things simpler. Let me know if there are any issues, and feel free to reject any of my suggestions (just let me know if you do).
| int main(int argc, char* argv[]) | ||
| { | ||
| MPI_Init(&argc, &argv); | ||
|
|
There was a problem hiding this comment.
Should we add an MPIL_Init here as well? I know this may not use what it sets up, but if we ever add more to the init function, might be a good idea
| int* counts; | ||
| int* indices; | ||
| char* buffer; | ||
| } CommData; |
There was a problem hiding this comment.
Since the struct is still around, would you mind this setup:
- Keep comm_data.h and comm_data.cpp but
- Move header to "library/include/neighborhood"
- Move source file to "library/source/neighborhood" (can sit just in that folder and not any subfolder) -- but still add it to CMakeLists in this folder
- Delete the struct here, and comm-data specific methods here.
That way we can keep the struct in its own header (so it's easier to find where it is), and we get to keep the documentation we made?
|
|
||
| void map_procs_to_nodes(LocalityComm* locality, | ||
| const int orig_num_msgs, | ||
| #ifdef __cplusplus |
There was a problem hiding this comment.
The CPP header guards are only necessary around the bindings (any file that has a MPIL_Foo function) Any other header/file inside the library can skip them since the main locality_aware.h header doesn't use these files.
If there are issues with undefined references at linking when removing this, lmk and I can help trace it down.
| extern "C" { | ||
| #endif | ||
|
|
||
| typedef struct _MPIL_Request MPIL_Request; |
There was a problem hiding this comment.
Was this necessary to avoid some compilation error?
If the compiler was unhappy about MPIL_Request* foo inside the struct, I believe you can just use _MPIL_Request* foo instead. I only ask because Andrew and I had a few headaches on resolving naming issues upstream when we did it like this, so if possible, I want to try and keep it the same.
| locality_comm.cpp | ||
| topology_functions.cpp | ||
| ) No newline at end of file | ||
| get_tag.cpp |
There was a problem hiding this comment.
Can I get the files in alphabetical order here? :)
Just personal preference
| // Get MPI Information | ||
| int rank, num_procs; | ||
| MPI_Comm_rank(mpil_comm->global_comm, &rank); | ||
| MPI_Comm_size(mpil_comm->global_comm, &num_procs); |
There was a problem hiding this comment.
| // Get MPI Information | |
| int rank, num_procs; | |
| MPI_Comm_rank(mpil_comm->global_comm, &rank); | |
| MPI_Comm_size(mpil_comm->global_comm, &num_procs); |
These aren't used in this function, might as well delete them until needed.
| // Initialize final variable (MPI_Request arrays, etc.) | ||
| finalize_locality_comm(locality_comm); | ||
| // Don't need local_S or global recv indices (just contiguous) | ||
| if (local_S_recv_data->indices) |
There was a problem hiding this comment.
| if (local_S_recv_data->indices) | |
| if (local_S_recv_data->indices != NULL) |
| free(local_S_recv_data->indices); | ||
| local_S_recv_data->indices = NULL; | ||
| } | ||
| if (global_recv_data->indices) |
There was a problem hiding this comment.
| if (global_recv_data->indices) | |
| if (global_recv_data->indices != NULL) |
| if (data->procs) | ||
| { | ||
| free(data->procs); | ||
| } | ||
| if (data->indptr) | ||
| { | ||
| free(data->indptr); | ||
| } | ||
| if (data->counts) | ||
| { | ||
| free(data->counts); | ||
| } | ||
| if (data->indices) | ||
| { | ||
| free(data->indices); | ||
| } | ||
| if (data->buffer) | ||
| { | ||
| free(data->buffer); | ||
| } | ||
|
|
||
| // Don't need local_S or global recv indices (just contiguous) | ||
| free(locality->local_S_comm->recv_data->indices); | ||
| locality->local_S_comm->recv_data->indices = NULL; | ||
| free(locality->global_comm->recv_data->indices); | ||
| locality->global_comm->recv_data->indices = NULL; | ||
| free(data); |
There was a problem hiding this comment.
For consistency, can these all get:
!= NULLadd to if statements- Variables set to NULL after freeing
| // Initialize send side for dynamic communication | ||
| std::vector<int> dest(global_send_data->num_msgs); | ||
| std::vector<int> vals(global_send_data->num_msgs, mpil_comm->rank_node); | ||
| for (int i = 0; i < global_send_data->num_msgs; i++) |
There was a problem hiding this comment.
Optional: Add "{}" to all the one line for loops.
Large refactor of locality-aware neighbor collectives: