Giter Site home page Giter Site logo

Comments (7)

lucjaulmes avatar lucjaulmes commented on June 30, 2024

That would be really nice. Passing ompss programs through valgrind is always a very painful process.

from nanox.

vlopezh avatar vlopezh commented on June 30, 2024

While I wouldn't mind to add such support, the Valgrind documentation states this warning about all the three client requests related to stacks:

Warning: Unfortunately, this client request is unreliable and best avoided.

Which makes me think whether this effort is worthwhile.

Have you considered to disable user-level threads when running Valgrind with OmpSs?
(export NX_ARGS+=' --disable-ut').

from nanox.

devreal avatar devreal commented on June 30, 2024

@vlopezh I didn't see these warnings. I have incorporated the Valgrind macros into my own UT runtime and hacked it into OmpSs (because the false positives made using Valgrind impossible).

Have you considered to disable user-level threads when running Valgrind with OmpSs?
(export NX_ARGS+=' --disable-ut').

How does that change the behavior of the runtime? Does that mean task execution is serialized? I cannot find documentation for it right of the hand...

from nanox.

xteruel avatar xteruel commented on June 30, 2024

Disabling User Threads (or ULT) does not mean to serialize task execution, but to avoid task migration among threads. It directly means that once a task is started in one thread, it will be tied to this thread and, after suspended (e.g., taskwait) it could not be resumed by another thread.

It corresponds, more or less, to the implementation of a tied task in OpenMP (which, by the way, is the default behaviour in this model).

from nanox.

xteruel avatar xteruel commented on June 30, 2024

I have incorporated the Valgrind macros into my own UT runtime and hacked it into OmpSs (because the false positives made using Valgrind impossible).

Could you circulate your implementation to have a clearer idea of the required changes and the parameters used.

from nanox.

devreal avatar devreal commented on June 30, 2024

It's by far not complete (misses deregistration) but it did the trick for me:

--- ompss-19.06/nanox-0.15/src/arch/smp/smpdd.cpp	2019-06-27 19:00:34.000000000 +0200
+++ ompss-19.06-valgrind/nanox-0.15/src/arch/smp/smpdd.cpp	2020-02-03 13:57:23.675151305 +0100
@@ -25,6 +25,7 @@
 #include "taskexecutionexception.hpp"
 #include "smpdevice.hpp"
 #include "schedule.hpp"
+#include <valgrind/valgrind.h>
 #include <string>
 
 using namespace nanos;
@@ -88,6 +89,7 @@
    if (isUserLevelThread) {
       if (previous == NULL) {
          _stack = (void *) NEW char[_stackSize];
+         VALGRIND_STACK_REGISTER(_stack, (void*)(((uintptr_t)_stack)+_stackSize));
          verbose0("   new stack created: " << _stackSize << " bytes");
       } else {
          verbose0("   reusing stacks");

I didn't bother wrapping the valgrind calls in some nanox macros to disable them if needed. It could be sufficient to add another configure flag --enable-valgrind that needs to be explicitly added.

from nanox.

vlopezh avatar vlopezh commented on June 30, 2024

Added feature in e4b5dbe.
Thank you.

from nanox.

Related Issues (10)

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.