mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-13 09:46:00 +00:00
Fix performance bug and base pointer offset
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <numa.h>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
// Get current Compute Capability
|
||||
// int mscclppCudaCompCap() {
|
||||
@@ -112,7 +113,7 @@ uint64_t getHash(const char* string, int n)
|
||||
* This string can be overridden by using the MSCCLPP_HOSTID env var.
|
||||
*/
|
||||
#define HOSTID_FILE "/proc/sys/kernel/random/boot_id"
|
||||
uint64_t getHostHash(void)
|
||||
uint64_t computeHostHash(void)
|
||||
{
|
||||
char hostHash[1024];
|
||||
char* hostId;
|
||||
@@ -144,6 +145,12 @@ uint64_t getHostHash(void)
|
||||
return getHash(hostHash, strlen(hostHash));
|
||||
}
|
||||
|
||||
uint64_t getHostHash(void)
|
||||
{
|
||||
thread_local std::unique_ptr<uint64_t> hostHash = std::make_unique<uint64_t>(computeHostHash());
|
||||
return *hostHash;
|
||||
}
|
||||
|
||||
/* Generate a hash of the unique identifying string for this process
|
||||
* that will be unique for both bare-metal and container instances
|
||||
* Equivalent of a hash of;
|
||||
|
||||
Reference in New Issue
Block a user