- Notifications
You must be signed in to change notification settings - Fork9
Black-box Concurrent Data Structures for NUMA Architectures
License
NotificationsYou must be signed in to change notification settings
xqgex/NUMA_Black-Box
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Black-box Concurrent Data Structures for NUMA ArchitecturesBased on:http://cs.brown.edu/~irina/papers/asplos2017-final.pdfBy: Irina Calciu, Siddhartha Sen, Mahesh Balakrishnan, Marcos K. Aguilera Node #1 Node #2 ╔═══════╦═══════╦═══════╦═══════╗ ╔═══════╦═══════╦═══════╦═══════╗║ Core ║ Core ║ Core ║ Core ┣━━━━┫ Core ║ Core ║ Core ║ Core ║╟───────╫───────╫───────╫───────╊━━━━╉───────╫───────╫───────╫───────╢║ Cache ║ Cache ║ Cache ║ Cache ┣━━━━┫ Cache ║ Cache ║ Cache ║ Cache ║╟───────╨───────╨───────╨───────╢ ╟───────╨───────╨───────╨───────╢║ Cache ║ ║ Cache ║╚═════════════┳━┳━┳═════════════╝ ╚═════════════┳━┳━┳═════════════╝ ┃ ┃ ┃ ┃ ┃ ┃ ┌─────────────┺━┻━┹─────────────┐ ┌─────────────┺━┻━┹─────────────┐│ Memory │ │ Memory │└───────────────────────────────┘ └───────────────────────────────┘/************************************************************//************My implementation*********************//************************************************************/This is the general scheme of my implementation: ┌────────────────────────┐ │ libgenericDS │ ├────────────────────────┤ │ genericDataStructure.h │ │ genericDataStructure.c │ └────────────────────────┘ ▲ ║ Shared Memory ▼ ┌──────────────────────┐ ┌──────────────────┐ ┌────────────┐ │ libgenerateCommands │═══▶│ gds_commands.bin │═══▶│ libNUMAbb │ ├──────────────────────┤ └──────────────────┘ ├────────────┤ │ generateCommands.c │ │ NUMAbb.h │ │ │ │ NUMAbb.c │ └──────────────────────┘ └────────────┘ ▲ ▲ ║ ┌────────────┐ ║ ╚══════════════════│ myprogram │═════════════╝ ├────────────┤ │ main.c │ └────────────┘ The code was designed to work on unix system and was written in C.In order to run the program there is only one file that need to be run,But the files are still acting like a separate libraries.There is more work that need to be done, Feel free to fork my project.Run the program:Build and run the program by running the command: "sh makefile.sh"Limitation from the current implementation:1) The mmap size is a limitaion on the amount of commands.2) Variable MAX_CORES limit the program to work with up-to 512 cores.3) Maximum 'op' and 'args' size is 1024 chars each.Problems:Unfortunately, My code isn't perfect yet, More upgrades that can be done:Section 5.2To avoid small inefficient batches, the combiner in NR waitsif the batch size is smaller than a parameter MIN BATCH. Ratherthan idle waiting, the combiner refreshes the local replica fromthe log, though it might need to refresh again after finallyadding the batch to the logSection 5.5 - Better readers-writer lockThe distributed readers-writer lock uses a per-readerlock to reduce reader overhead; the writer must acquire thelocks from all readers. We modify this algorithm to reducewriter overhead as well, by adding an additional writer lock.To enter the critical section, the writer must acquire thewriter lock and wait for all the readers locks to be released,without acquiring them; to exit, it releases its lock. A readerwaits if the writer lock is taken, then acquires its local lock,and checks the writer lock again; if this lock is taken, thereader releases its local lock and restarts; otherwise, it entersthe critical section; to exit, it releases the local lock. Withthis scheme, the writer and readers incur just one atomicwrite each on distinct cache lines to enter the critical sec-tion. Readers may starve if writers keep coming, but this isunlikely with NR , as often only one thread wishes to be awriter at a time (the combiner) and that thread has signif-icant work outside the critical section.Section 5.7Padded the data and aligned the cache to avoid false sharing.GeneralWhat prevent two combiners (on separate nodes) to write the log at the same time?I think there is need to create something that will prevent it.Build errors:In case of compilation errors, Make sure you have all the dependency packages on your computer,Use "apt-get install" / "yum install" / "dnf install" To install: (On Ubunto devel => dev)1) libnuma-develDevelopment files for libnuma2) numactlLibrary for tuning for Non Uniform Memory Access machines3) numactl-libslibnuma libraries4) numactl-develDevelopment package for building Applications that use numa5) glibc-develObject files for development using standard C libraries.6) glibc-staticC library static libraries for -static linking.7) libstdc++-develHeader files and libraries for C++ development8) libstdc++-staticStatic libraries for the GNU standard C++ library
About
Black-box Concurrent Data Structures for NUMA Architectures