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++) ...
Type: Posts; User: dayalsoap
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++) ...
Anything specific out of there I should look for?
Something like a textual htop would be perfect haha
I should also say, I'd like to get it on a per-core basis if that's even posssible
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?
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...
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...
Should I try to produce a minimal version of the bug? Or is this a familiar problem and I'm just missing something?
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...
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...
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....
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...
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...
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 *...
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?
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:
...
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...
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.
Here is what I've done:
uint64_t flip(uint64_t num, int p) {
if (num & (1 << p)) {
//odd
num &= ~(1 << p);
return num;
}
Okay, I don't really see any code here.
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...
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...
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.
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...
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...