Search:

Type: Posts; User: dayalsoap

Page 1 of 11 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    2
    Views
    8,936

    what does this mean: if ((i & 0x3) != 0)

    Hi all,

    I have some code I need to change and the code has some things like this:



    for (size_t i = 0; i < numiters; i++) ...
  2. Replies
    7
    Views
    5,626

    Anything specific out of there I should look for?

    Anything specific out of there I should look for?
  3. Replies
    7
    Views
    5,626

    Something like a textual htop would be perfect...

    Something like a textual htop would be perfect haha
  4. Replies
    7
    Views
    5,626

    I should also say, I'd like to get it on a...

    I should also say, I'd like to get it on a per-core basis if that's even posssible
  5. Replies
    7
    Views
    5,626

    Top is interesting but I want to collect data...

    Top is interesting but I want to collect data over the run and plot it. I'd need something in text form. Basically, top must use something that linux has from /proc, right?
  6. Replies
    7
    Views
    5,626

    measuring CPU usage

    Hi all,

    Is there a way to measure CPU usage from your application's perspective? For example, I have an application that uses MPI and OpenMP that runs on a Xeon Phi. I just want to, using...
  7. I have solved the problem. Basically, there is an...

    I have solved the problem. Basically, there is an inherent race condition here. shm_open, ftruncate, mmap, setup mutex/cond.

    The reading application, i.e., applicaiton B, can start to access the...
  8. Should I try to produce a minimal version of the...

    Should I try to produce a minimal version of the bug? Or is this a familiar problem and I'm just missing something?
  9. The error I am getting is SIGBUS, but it doesn't...

    The error I am getting is SIGBUS, but it doesn't make sense. I can ftruncate the file to something larger than the mutex + cond (i.e., getpagesize()) and I can even do msync(...MS_SYNC) and it still...
  10. shared memory: how to synchronize exchanging pthread_mutex and pthread_condition?

    Hi All, I am writing a shared memory application in which two processes A and B communicate over shared memory. Process B is NOT a forked process from A. The issue I'm having is the following:

    A...
  11. That's a good point actually, both about not...

    That's a good point actually, both about not doing subsequent mmaps, and the page size. I think it's working because mmap will map a multiple of the page size, so it seems it's getting one page size....
  12. I have done a quick test and it seems to work...

    I have done a quick test and it seems to work fine. Yes, I know the sleeps lead to race conditions and all that. It's not the way the real code is written, it was just meant to be a quick and dirty...
  13. ftruncate, mmap, posix shared memory of changing size.

    Hi,

    I have two processes that communicate over posix shared memory (only in one direction, one process is a writer, another is a reader). They do this for a number of iterations.

    This seems to...
  14. Replies
    1
    Views
    1,864

    Linking to Thrust (cuda) compiled code.

    Hi All. Basically, all I want to do is figure out how to link this thrust code (compiled with nvcc) from a code that uses an MPI c++ compiler. Here is the code:

    thrust/histogram.cu at master *...
  15. Replies
    6
    Views
    644

    Okay. I guess then there's a performance issue...

    Okay. I guess then there's a performance issue here as the entire vector will be copied? if there are 1 million elements in there, then all 1 million would have to be copied?
  16. Replies
    6
    Views
    644

    C++ "new" and scope

    So, I'm debugging a library I was given by someone else to use. At some point, the code gets garbage values. One of their functions returns a vector of uint64_ts. It's defined like this:


    ...
  17. Replies
    11
    Views
    1,082

    I don't see why I need to subtract one, at all....

    I don't see why I need to subtract one, at all. If I pass in position 0, I don't want to subtract position -1.

    You can run the code as I've written with your removal of the if statement and it...
  18. Replies
    11
    Views
    1,082

    This line num ^= (1

    This line


    num ^= (1 << p);

    Hmm. You are right. No need for the if. I thought this always sets it to 0, but it actually just flips it.
  19. Replies
    11
    Views
    1,082

    Here is what I've done: uint64_t...

    Here is what I've done:



    uint64_t flip(uint64_t num, int p) {
    if (num & (1 << p)) {
    //odd
    num &= ~(1 << p);
    return num;
    }
  20. Replies
    11
    Views
    1,082

    Okay, I don't really see any code here.

    Okay, I don't really see any code here.
  21. Replies
    11
    Views
    1,082

    Flipping a bit at position p

    Hi, suppose I have a sequence of 64bits, i.e., a uint64_t. The goal is to flip a bit at position p of the bit sequence. How can I do this with C? I've read about masks and stuff, but masks only are...
  22. Replies
    4
    Views
    890

    Okay, so it turns out I DID have a label: I...

    Okay, so it turns out I DID have a label: I didn't realize that the case statement of a switch counted as a label. C has a requirement that you can't have declarations directly after labels. I just...
  23. Replies
    4
    Views
    890

    Sorry, that was my mistake. I've fixed that. ...

    Sorry, that was my mistake. I've fixed that.

    I know I don't have a label so I'm confused why it's saying that error.
  24. Replies
    4
    Views
    890

    static array of function pointers.

    I basically have some code that lets users register callbacks into a callback table at a specified index. There is one element in this table for each event that can trigger a callback. I basically do...
  25. The problem is you assume there's only one single...

    The problem is you assume there's only one single standard. YOu live in your Webpage + Database world where gcc is king. That's fine and good, but don't try to be pedantic just for the sake of...
Results 1 to 25 of 274
Page 1 of 11 1 2 3 4