Coder Social home page Coder Social logo

nkallima / sim-universal-construction Goto Github PK

View Code? Open in Web Editor NEW
63.0 4.0 9.0 8.05 MB

An open-source framework for concurrent data-structures and benchmarks.

License: GNU Lesser General Public License v2.1

Makefile 0.28% C 95.23% Shell 4.49%
concurrency concurrent-programming parallel-programming pthreads cc-synch psim osci benchmarks concurrent-queues concurrent-stacks

sim-universal-construction's People

Contributors

edatsika avatar nkallima avatar spiros-n-agathos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sim-universal-construction's Issues

benchmarks emit "mbind: Function not implemented" in WSL2

Trying the tool in WSL2 debian 10 box (gcc 8.3.0) with single NUMA node the benchmarks emit warning:
"mbind: Function not implemented"

The solution is to deactivate the NUMA_SUPPORT compile flag.

It would be nice if the make system could auto-deactivate this setting.

Shell scripts and executables should use the same execution options

Currently the shell scripts i.e. bench.sh an validate.sh take the options in the form -option=value, in contrast the actual benchmark requires the options to be given as -option value.
This maybe confuse the user of the framework.

The goal is to use either option format uniformly throughout the Synch framework.

[FEATURE] Add user documentation and examples

Is your feature request related to a problem? Please describe.
Not related to a problem per-se, but first time users can benefit for more comprehensive and clear documentation.

Describe the solution you'd like
Add user documentation. While there is a substantial amount of documentation in the README.md a more comprehensive document would benefit the user that want more detail.

Describe alternatives you've considered
GitHub pages, ReadTheDocs, also providing functional examples could help the interested user for reproducibility of the claimed performance and functionality

Additional context
Some more specific points to be addressed and be clear about up front in the docs (possibly in README.md) to give a clear scope to the potential user:

  • Indicate if this is a library, executable. If it's a C library as it seems to be the case from the API example, please add a prefix_ "namespace" (e.g. synch_foo) to library API functions to avoid name clashes
  • Indicate this is a Linux-only library
  • What's the baseline used for performance claims? Is it measuring strong/weak scalability?
  • Illustrate examples comparing this implementation with existing implementations to justify performance (e.g. C++ std::queue, std::unordered_map for hash-table, C++ etc?) to users know what to expect in terms of performance.

Related to JOSS review 3143

[BUG] `CLHHashDelete` fails to delete an element if it's the first one in the linked list.

Code version
Tested on v3.1.1, though the bug should still be present in v3.1.2 (325fe30).

Machine architecture/setup
Tested on GNU/Linux 5.17.1 x86_64.

Compiler
Using GCC 11.3.0.

Describe the bug
Using a CLHHash structure, if you issue a CLHHashDelete() call for an element that is the first in the underlying linked-list construct, the element isn't deleted at all and nothing happens, leaving the element in place.

This is due to the following snippet in serialOperations():

if (found) {
if (top != prev)
prev->next = cur->next;
else
top->next = cur->next;
}

In the event that we delete the first element, we have:

  • found = true
  • cur = top
  • prev = top

Thus, the line executed is top->next = cur->next. Since top == cur, this does nothing, and the element stays present.

To Reproduce
Compile this code (using the correct linkage and libraries)

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <stdint.h>

#include <config.h>
#include <primitives.h>
#include <fastrand.h>
#include <threadtools.h>
#include <clhhash.h>
#include <barrier.h>
#include <bench_args.h>
#include <math.h>

#define N_BUCKETS        64
#define LOAD_FACTOR      1
#define INITIAL_CAPACITY (LOAD_FACTOR * N_BUCKETS)

#define RANDOM_RANGE (INITIAL_CAPACITY * log(INITIAL_CAPACITY))

CLHHash object_struct CACHE_ALIGN;
CLHHashThreadState *th_state;

int main(int argc, char *argv[]) {
    CLHHashStructInit(&object_struct, N_BUCKETS, 16);

    th_state = synchGetAlignedMemory(CACHE_LINE_SIZE, sizeof(CLHHashThreadState));
    CLHHashThreadStateInit(&object_struct, th_state, N_BUCKETS, 0);

    CLHHashInsert(&object_struct, th_state, 1, 1, 0);
    CLHHashDelete(&object_struct, th_state, 1, 0);

    int search = CLHHashSearch(&object_struct, th_state, 1, 0);

    fprintf(stderr, "search: %d\n", search);

    return 0;
}

In this, we initialize a CLHHash structure, insert an element to it, delete it immediately, and search for it afterwards.

Expected behavior
Given that we search for an element that has just been deleted, I expect the program to print search: 0.

However, the current behavior is to print search: 1.

make install

An automated way to install libconcurrent and the benchmarks should be provided?

[FEATURE] Improve Contributing documentation

Is your feature request related to a problem? Please describe.
Contributing is not clear for external engagement.

Describe the solution you'd like
Clarify the desired workflow (fork-branch ? Should master (now main be up-to-date?).
It's not clear if someone would like to do a Pull Request where things should go.

Describe alternatives you've considered
Just expand Contributing.md

Additional context
Part of JOSS review issue 3143

ftime is deprecated

primitives/primitives.c:140:5: warning: ‘ftime’ is deprecated [-Wdeprecated-declarations]
140 | ftime(&tm);
| ^~~~~
In file included from includes/primitives.h:9,
from primitives/primitives.c:1:

make debug

A make debug option could be provided in order to make debugging more easy.

Enhancements on bench.sh

It seems that the usability of bench.sh is somewhat restricted since v2.0.
More specifically, bench.sh passively passes the command-line arguments to the executed benchmark.
Some easy but useful enhancements could be the following:

  1. Run the benchmark with different number 'n' of threads.
  • In case that a machine is equipped with 80 cores, bench.sh runs the benchmark with n=1,10,20,...,80 threads (step is equal to 10 in this case).
  • In case that a machine is equipped with 64 cores, bench.sh runs the benchmark with n=1,8,16,24,...,64 threads (step is equal to 8).
  • In cases that the number of cores is less or equal to 8, the step should be equal to 1.
  1. The user should be able to define the step-size with an argument.
  2. The user should also be able to define a maximum number of threads, which may be greater or equal to the number of cores.

[FEATURE] Add code coverage report in CI

Is your feature request related to a problem? Please describe.
Code coverage is desired to build confidence in the current CI test and to see how much is tested when users want to use a certain feature. It'd also help guidance when adding new tests.

Describe the solution you'd like
Either Codecov or Coveralls coverage report + a badge would be a great bonus.

Describe alternatives you've considered
None, but it should be a minor task

Additional context
Related to JOSS review 3143

Run the ".run_all.sh" file, get stuck, and don't execute any further.

Hello, I have a question I would like to ask you: that is, when I run ".run_all.sh", I encountered a stuck phenomenon. Excuse me, how should this be resolved? thanks
I am using an ARM64 system with a raspberry pi.

pi@raspberrypi:/opt/sim-universal-construction $ cat /proc/cpuinfo
processor	: 0
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 1
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 2
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Hardware	: BCM2835
Revision	: d03141
Serial		: 10000000ad931999
Model		: Raspberry Pi Compute Module 4 Rev 1.1
root@raspberrypi:/opt/sim-universal-construction# . run_all.sh 
Executing activesetbench.run (1/32) ...Done
Executing ccqueuebench.run (2/32) ...Done
Executing ccstackbench.run (3/32) ...Done
Executing ccsynchbench.run (4/32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.