Mandelbrot Example
The heavy computation here is the Mandelbrot set, probably the world's most famous fractal. These days, while sophisticated programs such as XaoS that provide real-time zooming in the Mandelbrot set, the standard Mandelbrot algorithm is just slow enough for our purposes.
In real life, the approach described here is applicable to a large set of problems, including synchronous network I/O and database access, where the user interface must remain responsive while some heavy operation is taking place. The Blocking Fortune Client Example shows the same principle at work in a TCP client.
The Mandelbrot application supports zooming and scrolling using the mouse or the keyboard. To avoid freezing the main thread's event loop (and, as a consequence, the application's user interface), we put all the fractal computation in a separate worker thread. The thread emits a signal when it is done rendering the fractal.
During the time where the worker thread is recomputing the fractal to reflect the new zoom factor position, the main thread simply scales the previously rendered pixmap to provide immediate feedback. The result doesn't look as good as what the worker thread eventually ends up providing, but at least it makes the application more responsive. The sequence of screenshots below shows the original image, the scaled image, and the rerendered image.
Similarly, when the user scrolls, the previous pixmap is scrolled immediately, revealing unpainted areas beyond the edge of the pixmap, while the image is rendered by the worker thread.
The application consists of two classes:
RenderThread
is a QThread subclass that renders the Mandelbrot set.MandelbrotWidget
is a QWidget subclass that shows the Mandelbrot set on screen and lets the user zoom and scroll.
If you are not already familiar with Qt's thread support, we recommend that you start by reading the Thread Support in Qt overview.
RenderThread Class Definition
We'll start with the definition of the RenderThread
class:
class RenderThread : public QThread { Q_OBJECT public: RenderThread(QObject *parent = 0); ~RenderThread(); void render(double centerX, double centerY, double scaleFactor, QSize resultSize); signals: void renderedImage(const QImage &image, double scaleFactor); protected: void run() override; private: uint rgbFromWaveLength(double wave); QMutex mutex; QWaitCondition condition; double centerX; double centerY; double scaleFactor; QSize resultSize; bool restart; bool abort; enum { ColormapSize = 512 }; uint colormap[ColormapSize]; };
The class inherits QThread so that it gains the ability to run in a separate thread. Apart from the constructor and destructor, render()
is the only public function. Whenever the thread is done rendering an image, it emits the renderedImage()
signal.
The protected run()
function is reimplemented from QThread. It is automatically called when the thread is started.
In the private
section, we have a QMutex, a QWaitCondition, and a few other data members. The mutex protects the other data member.
RenderThread Class Implementation
RenderThread::RenderThread(QObject *parent) : QThread(parent) { restart = false; abort = false; for (int i = 0; i < ColormapSize; ++i) colormap[i] = rgbFromWaveLength(380.0 + (i * 400.0 / ColormapSize)); }
In the constructor, we initialize the restart
and abort
variables to false
. These variables control the flow of the run()
function.
We also initialize the colormap
array, which contains a series of RGB colors.
RenderThread::~RenderThread() { mutex.lock(); abort = true; condition.wakeOne(); mutex.unlock(); wait(); }
The destructor can be called at any point while the thread is active. We set abort
to true
to tell run()
to stop running as soon as possible. We also call QWaitCondition::wakeOne() to wake up the thread if it's sleeping. (As we will see when we review run()
, the thread is put to sleep when it has nothing to do.)
The important thing to notice here is that run()
is executed in its own thread (the worker thread), whereas the RenderThread
constructor and destructor (as well as the render()
function) are called by the thread that created the worker thread. Therefore, we need a mutex to protect accesses to the abort
and condition
variables, which might be accessed at any time by run()
.
At the end of the destructor, we call QThread::wait() to wait until run()
has exited before the base class destructor is invoked.
void RenderThread::render(double centerX, double centerY, double scaleFactor, QSize resultSize) { QMutexLocker locker(&mutex); this->centerX = centerX; this->centerY = centerY; this->scaleFactor = scaleFactor; this->resultSize = resultSize; if (!isRunning()) { start(LowPriority); } else { restart = true; condition.wakeOne(); } }
The render()
function is called by the MandelbrotWidget
whenever it needs to generate a new image of the Mandelbrot set. The centerX
, centerY
, and scaleFactor
parameters specify the portion of the fractal to render; resultSize
specifies the size of the resulting QImage.
The function stores the parameters in member variables. If the thread isn't already running, it starts it; otherwise, it sets restart
to true
(telling run()
to stop any unfinished computation and start again with the new parameters) and wakes up the thread, which might be sleeping.
void RenderThread::run() { forever { mutex.lock(); QSize resultSize = this->resultSize; double scaleFactor = this->scaleFactor; double centerX = this->centerX; double centerY = this->centerY; mutex.unlock();
run()
is quite a big function, so we'll break it down into parts.
The function body is an infinite loop which starts by storing the rendering parameters in local variables. As usual, we protect accesses to the member variables using the class's mutex. Storing the member variables in local variables allows us to minimize the amout of code that needs to be protected by a mutex. This ensures that the main thread will never have to block for too long when it needs to access RenderThread
's member variables (e.g., in render()
).
The forever
keyword is, like foreach
, a Qt pseudo-keyword.
int halfWidth = resultSize.width() / 2; int halfHeight = resultSize.height() / 2; QImage image(resultSize, QImage::Format_RGB32); const int NumPasses = 8; int pass = 0; while (pass < NumPasses) { const int MaxIterations = (1 << (2 * pass + 6)) + 32; const int Limit = 4; bool allBlack = true; for (int y = -halfHeight; y < halfHeight; ++y) { if (restart) break; if (abort) return; uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y + halfHeight)); double ay = centerY + (y * scaleFactor); for (int x = -halfWidth; x < halfWidth; ++x) { double ax = centerX + (x * scaleFactor); double a1 = ax; double b1 = ay; int numIterations = 0; do { ++numIterations; double a2 = (a1 * a1) - (b1 * b1) + ax; double b2 = (2 * a1 * b1) + ay; if ((a2 * a2) + (b2 * b2) > Limit) break; ++numIterations; a1 = (a2 * a2) - (b2 * b2) + ax; b1 = (2 * a2 * b2) + ay; if ((a1 * a1) + (b1 * b1) > Limit) break; } while (numIterations < MaxIterations); if (numIterations < MaxIterations) { *scanLine++ = colormap[numIterations % ColormapSize]; allBlack = false; } else { *scanLine++ = qRgb(0, 0, 0); } } } if (allBlack && pass == 0) { pass = 4; } else { if (!restart) emit renderedImage(image, scaleFactor); ++pass; } }
Then comes the core of the algorithm. Instead of trying to create a perfect Mandelbrot set image, we do multiple passes and generate more and more precise (and computationally expensive) approximations of the fractal.
If we discover inside the loop that restart
has been set to true
(by render()
), we break out of the loop immediately, so that the control quickly returns to the very top of the outer loop (the forever
loop) and we fetch the new rendering parameters. Similarly, if we discover that abort
has been set to true
(by the RenderThread
destructor), we return from the function immediately, terminating the thread.
The core algorithm is beyond the scope of this tutorial.
mutex.lock(); if (!restart) condition.wait(&mutex); restart = false; mutex.unlock(); } }
Once we're done with all the iterations, we call QWaitCondition::wait() to put the thread to sleep by calling, unless restart
is true
. There's no use in keeping a worker thread looping indefinitely while there's nothing to do.
uint RenderThread::rgbFromWaveLength(double wave) { double r = 0.0; double g = 0.0; double b = 0.0; if (wave >= 380.0 && wave <= 440.0) { r = -1.0 * (wave - 440.0) / (440.0 - 380.0); b = 1.0; } else if (wave >= 440.0 && wave <= 490.0) { g = (wave - 440.0) / (490.0 - 440.0); b = 1.0; } else if (wave >= 490.0 && wave <= 510.0) { g = 1.0; b = -1.0 * (wave - 510.0) / (510.0 - 490.0); } else if (wave >= 510.0 && wave <= 580.0) { r = (wave - 510.0) / (580.0 - 510.0); g = 1.0; } else if (wave >= 580.0 && wave <= 645.0) { r = 1.0; g = -1.0 * (wave - 645.0) / (645.0 - 580.0); } else if (wave >= 645.0 && wave <= 780.0) { r = 1.0; } double s = 1.0; if (wave > 700.0) s = 0.3 + 0.7 * (780.0 - wave) / (780.0 - 700.0); else if (wave < 420.0) s = 0.3 + 0.7 * (wave - 380.0) / (420.0 - 380.0); r = std::pow(r * s, 0.8); g = std::pow(g * s, 0.8); b = std::pow(b * s, 0.8); return qRgb(int(r * 255), int(g * 255), int(b * 255)); }
The rgbFromWaveLength()
function is a helper function that converts a wave length to a RGB value compatible with 32-bit QImages. It is called from the constructor to initialize the colormap
array with pleasing colors.
MandelbrotWidget Class Definition
The MandelbrotWidget
class uses RenderThread
to draw the Mandelbrot set on screen. Here's the class definition:
class MandelbrotWidget : public QWidget { Q_OBJECT public: MandelbrotWidget(QWidget *parent = 0); protected: void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent *event) override; void keyPressEvent(QKeyEvent *event) override; #ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *event) override; #endif void mousePressEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; private slots: void updatePixmap(const QImage &image, double scaleFactor); void zoom(double zoomFactor); private: void scroll(int deltaX, int deltaY); RenderThread thread; QPixmap pixmap; QPoint pixmapOffset; QPoint lastDragPos; double centerX; double centerY; double pixmapScale; double curScale; };
The widget reimplements many event handlers from QWidget. In addition, it has an updatePixmap()
slot that we'll connect to the worker thread's renderedImage()
signal to update the display whenever we receive new data from the thread.
Among the private variables, we have thread
of type RenderThread
and pixmap
, which contains the last rendered image.
MandelbrotWidget Class Implementation
const double DefaultCenterX = -0.637011f; const double DefaultCenterY = -0.0395159f; const double DefaultScale = 0.00403897f; const double ZoomInFactor = 0.8f; const double ZoomOutFactor = 1 / ZoomInFactor; const int ScrollStep = 20;
The implementation starts with a few contants that we'll need later on.
MandelbrotWidget::MandelbrotWidget(QWidget *parent) : QWidget(parent) { centerX = DefaultCenterX; centerY = DefaultCenterY; pixmapScale = DefaultScale; curScale = DefaultScale; connect(&thread, SIGNAL(renderedImage(QImage,double)), this, SLOT(updatePixmap(QImage,double))); setWindowTitle(tr("Mandelbrot")); #ifndef QT_NO_CURSOR setCursor(Qt::CrossCursor); #endif resize(550, 400); }
The interesting part of the constructor is the qRegisterMetaType() and QObject::connect() calls. Let's start with the connect() call.
Although it looks like a standard signal-slot connection between two QObjects, because the signal is emitted in a different thread than the receiver lives in, the connection is effectively a queued connection. These connections are asynchronous (i.e., non-blocking), meaning that the slot will be called at some point after the emit
statement. What's more, the slot will be invoked in the thread in which the receiver lives. Here, the signal is emitted in the worker thread, and the slot is executed in the GUI thread when control returns to the event loop.
With queued connections, Qt must store a copy of the arguments that were passed to the signal so that it can pass them to the slot later on. Qt knows how to take of copy of many C++ and Qt types, but QImage isn't one of them. We must therefore call the template function qRegisterMetaType() before we can use QImage as parameter in queued connections.
void MandelbrotWidget::paintEvent(QPaintEvent * /* event */) { QPainter painter(this); painter.fillRect(rect(), Qt::black); if (pixmap.isNull()) { painter.setPen(Qt::white); painter.drawText(rect(), Qt::AlignCenter, tr("Rendering initial image, please wait...")); return; }
In paintEvent(), we start by filling the background with black. If we have nothing yet to paint (pixmap
is null), we print a message on the widget asking the user to be patient and return from the function immediately.
if (curScale == pixmapScale) { painter.drawPixmap(pixmapOffset, pixmap); } else { double scaleFactor = pixmapScale / curScale; int newWidth = int(pixmap.width() * scaleFactor); int newHeight = int(pixmap.height() * scaleFactor); int newX = pixmapOffset.x() + (pixmap.width() - newWidth) / 2; int newY = pixmapOffset.y() + (pixmap.height() - newHeight) / 2; painter.save(); painter.translate(newX, newY); painter.scale(scaleFactor, scaleFactor); QRectF exposed = painter.matrix().inverted().mapRect(rect()).adjusted(-1, -1, 1, 1); painter.drawPixmap(exposed, pixmap, exposed); painter.restore(); }
If the pixmap has the right scale factor, we draw the pixmap directly onto the widget. Otherwise, we scale and translate the coordinate system before we draw the pixmap. By reverse mapping the widget's rectangle using the scaled painter matrix, we also make sure that only the exposed areas of the pixmap are drawn. The calls to QPainter::save() and QPainter::restore() make sure that any painting performed afterwards uses the standard coordinate system.
QString text = tr("Use mouse wheel or the '+' and '-' keys to zoom. " "Press and hold left mouse button to scroll."); QFontMetrics metrics = painter.fontMetrics(); int textWidth = metrics.width(text); painter.setPen(Qt::NoPen); painter.setBrush(QColor(0, 0, 0, 127)); painter.drawRect((width() - textWidth) / 2 - 5, 0, textWidth + 10, metrics.lineSpacing() + 5); painter.setPen(Qt::white); painter.drawText((width() - textWidth) / 2, metrics.leading() + metrics.ascent(), text); }
At the end of the paint event handler, we draw a text string and a semi-transparent rectangle on top of the fractal.
void MandelbrotWidget::resizeEvent(QResizeEvent * /* event */) { thread.render(centerX, centerY, curScale, size()); }
Whenever the user resizes the widget, we call render()
to start generating a new image, with the same centerX
, centerY
, and curScale
parameters but with the new widget size.
Notice that we rely on resizeEvent()
being automatically called by Qt when the widget is shown the first time to generate the image the very first time.
void MandelbrotWidget::keyPressEvent(QKeyEvent *event) { switch (event->key()) { case Qt::Key_Plus: zoom(ZoomInFactor); break; case Qt::Key_Minus: zoom(ZoomOutFactor); break; case Qt::Key_Left: scroll(-ScrollStep, 0); break; case Qt::Key_Right: scroll(+ScrollStep, 0); break; case Qt::Key_Down: scroll(0, -ScrollStep); break; case Qt::Key_Up: scroll(0, +ScrollStep); break; default: QWidget::keyPressEvent(event); } }
The key press event handler provides a few keyboard bindings for the benefit of users who don't have a mouse. The zoom()
and scroll()
functions will be covered later.
void MandelbrotWidget::wheelEvent(QWheelEvent *event) { int numDegrees = event->delta() / 8; double numSteps = numDegrees / 15.0f; zoom(pow(ZoomInFactor, numSteps)); }
The wheel event handler is reimplemented to make the mouse wheel control the zoom level. QWheelEvent::delta() returns the angle of the wheel mouse movement, in eights of a degree. For most mice, one wheel step corresponds to 15 degrees. We find out how many mouse steps we have and determine the zoom factor in consequence. For example, if we have two wheel steps in the positive direction (i.e., +30 degrees), the zoom factor becomes ZoomInFactor
to the second power, i.e. 0.8 * 0.8 = 0.64.
void MandelbrotWidget::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) lastDragPos = event->pos(); }
When the user presses the left mouse button, we store the mouse pointer position in lastDragPos
.
void MandelbrotWidget::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton) { pixmapOffset += event->pos() - lastDragPos; lastDragPos = event->pos(); update(); } }
When the user moves the mouse pointer while the left mouse button is pressed, we adjust pixmapOffset
to paint the pixmap at a shifted position and call QWidget::update() to force a repaint.
void MandelbrotWidget::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { pixmapOffset += event->pos() - lastDragPos; lastDragPos = QPoint(); int deltaX = (width() - pixmap.width()) / 2 - pixmapOffset.x(); int deltaY = (height() - pixmap.height()) / 2 - pixmapOffset.y(); scroll(deltaX, deltaY); } }
When the left mouse button is released, we update pixmapOffset
just like we did on a mouse move and we reset lastDragPos
to a default value. Then, we call scroll()
to render a new image for the new position. (Adjusting pixmapOffset
isn't sufficient because areas revealed when dragging the pixmap are drawn in black.)
void MandelbrotWidget::updatePixmap(const QImage &image, double scaleFactor) { if (!lastDragPos.isNull()) return; pixmap = QPixmap::fromImage(image); pixmapOffset = QPoint(); lastDragPos = QPoint(); pixmapScale = scaleFactor; update(); }
The updatePixmap()
slot is invoked when the worker thread has finished rendering an image. We start by checking whether a drag is in effect and do nothing in that case. In the normal case, we store the image in pixmap
and reinitialize some of the other members. At the end, we call QWidget::update() to refresh the display.
At this point, you might wonder why we use a QImage for the parameter and a QPixmap for the data member. Why not stick to one type? The reason is that QImage is the only class that supports direct pixel manipulation, which we need in the worker thread. On the other hand, before an image can be drawn on screen, it must be converted into a pixmap. It's better to do the conversion once and for all here, rather than in paintEvent()
.
void MandelbrotWidget::zoom(double zoomFactor) { curScale *= zoomFactor; update(); thread.render(centerX, centerY, curScale, size()); }
In zoom()
, we recompute curScale
. Then we call QWidget::update() to draw a scaled pixmap, and we ask the worker thread to render a new image corresponding to the new curScale
value.
void MandelbrotWidget::scroll(int deltaX, int deltaY) { centerX += deltaX * curScale; centerY += deltaY * curScale; update(); thread.render(centerX, centerY, curScale, size()); }
scroll()
is similar to zoom()
, except that the affected parameters are centerX
and centerY
.
The main() Function
The application's multithreaded nature has no impact on its main()
function, which is as simple as usual:
int main(int argc, char *argv[]) { QApplication app(argc, argv); MandelbrotWidget widget; widget.show(); return app.exec(); }
Files:


What are they and when do you use them?
June 7, 2015
In the first week of DBC, we focused on the command line; in the second week, HTML and CSS were introduced; this week we started Ruby. Amongst the excitement: arrays and hashes.
What are they are when do you use them?
Great question... Lets start with their similarities. Arrays and Hashes both store stuff, object type elements to be specific. They also both allow elements to be retrieved using a "key". And, they both allow methods to be called on them.
How you retrieve what you've stored differs between arrays and hashes. When retrieving an element of an array, the key you use is an integer because arrays always have consequitive integer index keys. For example, names[0] would get you the first element of the array "names". If that array was names = ["sara", "erykah", "sam"]
then, names[0]
would return "sara".
To retrieve something stored in a hash, the key is a object. For example, in the hash "address", if you used the key "street_address" to store "park" then to access your street address you would type address['street_address']
which would return "park".
How do you choose?
Arrays have the advantage of having easily accessible elements. If you wanted to iterate through the different elements of an array and access each index using an integer. You wouldn't be able to do this the same way on hashes that have non-integer keys. Hashes, although slightly more challenging to access, are useful because of the flexibilty that they provide for storing information. The key-value pair for a hash can have an integer key (ex: '5'), a string key (ex: 'hats'), a floating point key (ex: 5.55) or any other Ruby object as its key. It's common to think of a hash like a dictionary, where the key is the word that allows you to look up the associated definition.
Declaring arrays and hashes looks quite different. To declare an array, literally, you could do this:
array = ["a", "b", "c"]
array = []
or, to declare it using the array object's constructor, array.new, you could do this:
array = Array.new
A hash can be declared literally, like this:
address = {street_address: "park", city: "chicago"}
address = {:street_address=>"park", :city=>"chicago"}
or declaratively, using a new method, like this:
address = Hash.new
address[:street_address] = "park"
address[:city] = "chicago"
In some cases, both arrays and hashes are applicable but one is more advantagous. For example, if you were storing the owners of cars using their 8 digit liscense plate number, or the names of students using their 8 digit ID numbers, you would use a hash. If you used an array for this scenario, you would end up with a 100,000,000 element table to access the names associated with the 8 digit numbers. Not ideal.
For more details, see the Ruby documentation on Hashes and Arrays and this blog about How the Hash Works.


Pirate (ARRR) is a cryptocurrency that solves the issue of financial privacy on the blockchain through forced anonymous transactions. Protect your wallet and transactions with Pirate’s completely anonymous network. With forced private transactions, your privacy cannot be compromised by another users’ activity on the network. If you wish to learn more, please join the official Pirate Discord at https://pirate.black/discord/ or message FishyGuts#5085, who will be happy to help out.
100 messages
Before 05-Dec-19 12:00 AM
kp02-Dec-18 01:17 PM
seems like diff has gone down? when looking at the chart
mrlynch02-Dec-18 01:18 PM
oh yea... 48 now it was close to 60 about 1H ago
ComputerGenie 👴👴👴02-Dec-18 01:19 PM
have another nh order that's not doing as well as the previous one
stop using a public pool and math correctly
mrlynch02-Dec-18 01:19 PM
not sure i want to setup my own stratum at the moment
ComputerGenie 👴👴👴02-Dec-18 01:20 PM
then don't try to blame nethash for why your math is off
mrlynch02-Dec-18 01:21 PM
unless you're willing to let yourself pestered with (most likely silly) questions about setting it up
at current NH prices & relatively low diff. (not average over 24H)
not the math, the results are off, because i did not take into account an average of the net diff over the past 24H
it was just a quick calculation to see roughly how much profit that dude made in the dump
emphasis on estimate / ball park
not actual analysis
ComputerGenie 👴👴👴02-Dec-18 01:24 PM
1) mine is calculated at higher than 48
2) pool making payments can actively slow your finding blocks; because, sprout
3) ya math bad
mrlynch02-Dec-18 01:24 PM
so, your suggestion is to setup a stratum of my own and hit that?
in terms of server would a VPS do?
never built a pool before
ComputerGenie 👴👴👴02-Dec-18 01:30 PM
you can do on a VPS or on your livingroom NAS
mrlynch02-Dec-18 01:32 PM
hmm... tell me more... i actually have a NAS that's not put to use atm. can you point me to some docs? what to look out for?
as i'm pretty sure this is a bit different than setting up any other pool due to sprout (could be wrong)
as i'm pretty sure this is a bit different than setting up any other pool due to sprout (could be wrong)
yes, you're wrong; "sprout" is what we've been using "forever" now
mrlynch02-Dec-18 01:36 PM
and then use webworker's stratum git?
ComputerGenie 👴👴👴02-Dec-18 01:36 PM
1st there's a sprout
then it overwinters
and becomes a sapling
mrlynch02-Dec-18 01:37 PM
thanks for clearing that... as i said, never setup a pool, let alone 1 that needs to handle z-tx
ComputerGenie 👴👴👴02-Dec-18 01:37 PM
and then use webworker's stratum git?
afaik, it does work for current PIRATE
personally, for solo (even most of it still) I use https://github.com/aayanl/equihash-solomining
not sure what the current state of that project is, though, I downloaded my copy like a yr ago and have made many personal edits
mrlynch02-Dec-18 01:40 PM
thank you for that!
learning time
ComputerGenie 👴👴👴02-Dec-18 01:41 PM
Latest commit 38cea0c on Apr 2, 2017
heh, I guess teh current state is the same as when I dled it
Llama02-Dec-18 04:42 PM
Dang I’m gonna have to stock up on some arrr soon
1
jml02-Dec-18 04:54 PM
Anybody have problems sending Arrr to DigitalPrice? I sent some this morning and they are still not there. On DP Pirate "My Balance" page it says that withdrawal are not possible, but deposits are.
ComputerGenie 👴👴👴02-Dec-18 05:17 PM
it's the cosmos telling you not to dump so low
2
Flexatron02-Dec-18 05:30 PM
@Llama long time no see
Llama02-Dec-18 05:34 PM
Yeah
kp02-Dec-18 05:40 PM
Pirate is a scam!! (pls dump on my bids)
burbank02-Dec-18 05:42 PM
I doubt a scare tactic would work here
mrlynch02-Dec-18 05:47 PM
@kp bahaha that was funny
gtf outta here
kp02-Dec-18 05:51 PM
relax man
mrlynch02-Dec-18 05:52 PM
burbank02-Dec-18 05:53 PM
I was wondering if this sapling update should be considered a good thing or a bad thing? I realize it open things up but it just seems a problem that a step is required or your coins burn down.
mrlynch02-Dec-18 05:56 PM
it is a very good thing
burbank02-Dec-18 05:56 PM
Just seems something that scares away mainstream people. I am a noob so it scared me that holdings could be wiped out and since you don’t really have a account you can’t be notified
I get it that we are on the cutting edge
mrlynch02-Dec-18 05:57 PM
so... you need to update the daemon by 15th December
after 15th December and before 15th Feb 2019 if you already have funds in a zc (sprout) address you will need to migrate them to a zs (sapling) address
- you will need to generate a zs (sapling address)
- the migration process will be relatively seamless. there is a dapp for it and you'll need to run one 1 line command and that's it
after 15th December users will not be able to generate zc (sprout) addresses, therefore if there are new users after 15th December they need not worry(edited)
burbank02-Dec-18 06:00 PM
Agreed. I realize that the early folks like us are very likely to be engaged but still
mrlynch02-Dec-18 06:00 PM
instructions will be posted on how to go through the whole process before 15th December
jl777c02-Dec-18 06:01 PM
sprout addresses will work until feb 15th, but it is advised to switch to sapling for all usage as soon as possible
PIRATE is still just several months old. having a 2 months transition period is a significant percentage of its entire lifetime
3
the exchange servers just cannot keep up with the calcs needed from the sprout tx
if we want a running exchange, we cannot be allowing sprout
mrlynch02-Dec-18 06:02 PM
have edited my comment above to avoid confusion in regards to zc addresses
jl777c02-Dec-18 06:03 PM
some transactions are literally taking hours to complete
burbank02-Dec-18 06:04 PM
I am only having an academic thought here. I am sure practically all of us will be fine but the issue is related to forking as well. The idea that what you think a coin is today is subject to change. It’s already difficult to explain crypto. Increases perception of risk.
jl777c02-Dec-18 06:04 PM
pirates just need to make a big noise to make sure all will know to zmigrate
burbank02-Dec-18 06:04 PM
I am thrilled these changes makes the flow much more efficient
mrlynch02-Dec-18 06:04 PM
@jl777c noise shall be made
jl777c02-Dec-18 06:05 PM
ultimately all cryptocoins are based on complex software
that it needs to be updated, well, that should not be any surprise
burbank02-Dec-18 06:05 PM
The idea of using ARRR at POS at a store is an incredible vision.
Just excited to be on the train this early
@jl777c ha even you would get frustrated explaining things to my mother
Heh
Maybe we should create ARRR gift cards and send them around for Christmas
Force crypto on family and friends
Sorry I need more coffee
Or send to crypto journalists
mrlynch02-Dec-18 06:14 PM
not a bad idea
get the qr code from @Cryptofist
burbank02-Dec-18 06:17 PM
Well I guess there is another reason why we need sapling. A web wallet would work better to send a loaded wallet as a gift card.
My family isn’t going to install Agama and Activate Coin and wait for the sync.
Kind of scary that you’d have to send the wallet key along with the gift card unless someone can think of a better way to gift ARRR to someone without a wallet
jl777c02-Dec-18 06:19 PM
lite mode is needed
burbank02-Dec-18 06:20 PM
Doesn’t have to be a Christmas
I have heard of crypto gift cards. How mainstream sounding. Maybe sell them at CVS on the gift card wall.
I haven’t heard I mean
Jump over a huge number of coins in terms of awareness
At least you could give 1000ARRR instead of .00000002 BTC (bad math)
Sounds more substantial
ComputerGenie 👴👴👴02-Dec-18 06:26 PM
Well I guess there is another reason why we need sapling.
because growth and improvements isn't enough of a reason?
Sounds more substantial
I don't always pick the currency with the most whole number of digits per dollar, but when I do I like to spend 190000000 CoinX on Dos Equis(edited)
DmanXX02-Dec-18 06:55 PM
My withdrawals are ARRR disabled in DP how to move my coins to Agama?
KOSIUS02-Dec-18 06:55 PM
u wait, till they re-enable them
DmanXX02-Dec-18 06:56 PM
How about new version of Agama, when do we need to update? Is it ready?
KOSIUS02-Dec-18 06:57 PM
as far as I know the new agama version isn't out yet
SHossain02-Dec-18 06:57 PM
by the end of next week
DmanXX02-Dec-18 06:59 PM
Yeah but end of next week is fork, so we gonna have few hours to update ?
KOSIUS02-Dec-18 06:59 PM
sapling is on 14th
DmanXX02-Dec-18 06:59 PM
Yes and supposed to update Waller before that right?
SHossain02-Dec-18 06:59 PM
sapling activates on 15th. you have about 2 weeks left
Most likely 1 week before the update, you will get Agama
DmanXX02-Dec-18 07:00 PM
I don’t have two weeks , there no updated wallet available yet
KOSIUS02-Dec-18 07:02 PM
u'll get new agama wallet by the end of next week
and sapling is on 15th of December
and today is the 2nd of Dec
ComputerGenie 👴👴👴02-Dec-18 07:02 PM
My withdrawals are ARRR disabled in DP how to move my coins to Agama?
Until they open and process withdraws, they aren't your coins


Warning
Are you sure you want to delete this enquiry?
{{ enquiry.company_name }}
- Date received
- {{ enquiry|get_field_value:"date_received" }}
- Date last updated
- {{ enquiry|get_field_value:"modified" }}
- Enquiry stage
- {{ enquiry|get_field_value:"enquiry_stage" }}
- Owner
- {% if enquiry.owner %}{{ enquiry.owner }} {%else%} {{ "Unassigned" }} {%endif%}


@@include('../analytics-code.html') @@include('../styles.html')
You do not want to stick to a package and have a custom Marketplace in your mind? That's not a problem!
We are happy to discuss and figure out how we can help you.


|
HaHa
|
Asserts related functionality. More...
#include <compiler.h>
Go to the source code of this file.
Macros | |
| #define | ASSERT(condition) ASSERT_IMPL((condition), __FILE__, __LINE__) |
| Assert macro. More... | |
| #define | ASSERT_IMPL(condition, file, line) ((void)0) |
Functions | |
| void | assert (const bool condition, const char *const file, const int line) |
| Assert function. More... | |
Asserts related functionality.
Copyright (C) 2014 Atmel Corporation. All rights reserved.
| #define ASSERT | ( | condition | ) | ASSERT_IMPL((condition), __FILE__, __LINE__) |
Assert macro.
This macro is used to throw asserts. It can be mapped to different function based on debug level.
| [in] | condition | A condition to be checked; assert is thrown if the given condifition is false |
| #define ASSERT_IMPL | ( | condition, | |
| file, | |||
| line | |||
| ) | ((void)0) |
| void assert | ( | const bool | condition, |
| const char *const | file, | ||
| const int | line | ||
| ) |
Assert function.
This function is used to throw asserts.
| [in] | condition | A condition to be checked; assert is thrown if the given condition is false |
| [in] | file | File name |
| [in] | line | Line number |


Co-founder & Software Architect - Chitter (May 2015 - Present)
Chitter is an anonymous messaging application. I am currently implementing a flexible and scalable backend which consists of a RESTful API hosted across multiple Amazon EC2 shards. Much of my time was spent designing a service which was not only scalable but also highly cacheable.
Co-founder & Software Architect - No Lemon (January 2015 - Present)
Starting in 2015, I became a cofounder in a web service startup, No Lemon. I am currently implementing a business-class web service involving video upload and hosting, an extensive vehicle database, and electronic payment.
Open Source Committer - Umple (September 2014 - December 2014)
During my work with Umple, under Professor Timothy Lethbridge of the University of Ottawa, I participated as part of a distributed development team involving students from universities across Canada which primarily relied on weekly video standup meeting for communication. I committed fully functional and tested patches involving changes to the parser, metamodel, and templater of a Java based compiler in addition to modifications to the Eclipse plugin
Applications Intern - Pason Systems Inc. (May 2013 - August 2014)
I did a 16 month internship at Pason Systems as a part of the Industrial Internship Practicum at the University of Alberta. I worked with a team of thirteen fellow software developers and software engineers following Agile Scrum practices.
At Pason, I participated in many different phases of the product development cycle, including design, testing, field trials, and maintenance. My main role at Pason was to maintain the C#/C++ Windows applications which are deployed on drilling rig workstations worldwide. Issues often arose in the field, often not fixable by a simple patch, which taught me the incredible importance of extensive testing before release. Nearing the end of my term with Pason, I participated in the development of an automated testing framework using Ranorex, which would preform GUI testing of applications following many possible flows of execution.
I learned many valuable lessons at Pason, such as how to approach your team with proposals for process changes in order to improve coordination efficiency. For example, I proposed a sweeping change to the process of creating Windows images which improved image creation efficiency and removed conflicting updates. This new process was still used after my internship was over.


“I’m not superstitious, but I am a little stitious.” —Michael Scott
Information Technology junior skilled in working with programming languages and software applications. Skilled in utilizing troubleshooting and problem-solving skills to solve technology issues. Focused on improving performance through effective collaboration. Functions effectively in independent and team assignments. To to know more about me check out my Resume Page and my Fun Fact Page at the top".
I have completed 91 credits out of 130


GENERAL, SPECIAL AND PRIMARY ELECTIONS
Section 8. General elections shall be held on the first Tuesday after the first Monday in November in all even-numbered years. Special and primary elections may be held as provided by law; provided that in no case shall any primary election precede a general election by less than forty-five days. [Am Const Con 1968 and election Nov5, 1968; ren and am Const Con 1978 and election Nov7, 1978]
Attorney General Opinions
Special elections as authorized hereunder require specific legislation. Att. Gen. Op. 70-26.
Case Notes
For special elections to be held, there must be specific legislative authorization. 52 H. 410, 477 P.2d 625.


This row of cards is embedded in an X-Y Block Grid.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
This row of cards is embedded in an X-Y Block Grid.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.
It has an easy to override visual style, and is appropriately subdued.


|
Processor Counter Monitor
|
Main CPU counters header. More...
#include "types.h"
#include "msr.h"
#include "pci.h"
#include "client_bw.h"
#include "width_extender.h"
#include "exceptions/unsupported_processor_exception.hpp"
#include <vector>
#include <array>
#include <limits>
#include <string>
#include <memory>
#include <map>
#include <string.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/syscall.h>
#include <unistd.h>
Go to the source code of this file.
Classes | |
| struct | TopologyEntry |
| class | HWRegister |
| class | PCICFGRegister64 |
| class | PCICFGRegister32 |
| class | MMIORegister64 |
| class | MMIORegister32 |
| class | MSRRegister |
| class | CounterWidthExtenderRegister |
| class | UncorePMU |
| class | ServerPCICFGUncore |
| Object to access uncore counters in a socket/processor with microarchitecture codename SandyBridge-EP (Jaketown) or Ivytown-EP or Ivytown-EX. More... | |
| class | SimpleCounterState |
| class | PCM |
| CPU Performance Monitor. More... | |
| struct | PCM::SimplePCIeDevInfo |
| struct | PCM::CustomCoreEventDescription |
| Custom Core event description. More... | |
| struct | PCM::ExtendedCustomCoreEventDescription |
| Extended custom core event description. More... | |
| struct | PCM::CustomIIOEventDescription |
| class | BasicCounterState |
| Basic core counter state. More... | |
| class | UncoreCounterState |
| Basic uncore counter state. More... | |
| class | ServerUncoreCounterState |
| Server uncore power counter state. More... | |
| class | CoreCounterState |
| (Logical) core-wide counter state More... | |
| class | SocketCounterState |
| Socket-wide counter state. More... | |
| class | SystemCounterState |
| System-wide counter state. More... | |
Macros | |
| #define | PCM_VERSION " ($Format:%ci ID=%h$)" |
| #define | PCM_API |
| #define | NOMINMAX |
| #define | PCM_GENERATE_METRIC_AVAILABLE_FUNCTION(m) bool is##m() const { return m; } |
Typedefs | |
| typedef SimpleCounterState | PCIeCounterState |
| typedef SimpleCounterState | IIOCounterState |
| typedef std::vector< uint64 > | eventGroup_t |
Functions | |
| uint64 | RDTSC () |
| uint64 | RDTSCP () |
| template<class CounterStateType > | |
| uint64 | getQPIClocks (uint32 port, const CounterStateType &before, const CounterStateType &after) |
| Returns QPI LL clock ticks. More... | |
| template<class CounterStateType > | |
| int32 | getThermalHeadroom (const CounterStateType &, const CounterStateType &after) |
| template<class CounterStateType > | |
| uint64 | getQPIL0pTxCycles (uint32 port, const CounterStateType &before, const CounterStateType &after) |
| Returns the number of QPI cycles in power saving half-lane mode. More... | |
| template<class CounterStateType > | |
| uint64 | getQPIL1Cycles (uint32 port, const CounterStateType &before, const CounterStateType &after) |
| Returns the number of QPI cycles in power saving shutdown mode. More... | |
| template<class CounterStateType > | |
| double | getNormalizedQPIL0pTxCycles (uint32 port, const CounterStateType &before, const CounterStateType &after) |
| Returns the ratio of QPI cycles in power saving half-lane mode. More... | |
| template<class CounterStateType > | |
| double | getNormalizedQPIL1Cycles (uint32 port, const CounterStateType &before, const CounterStateType &after) |
| Returns the ratio of QPI cycles in power saving shutdown mode. More... | |
| template<class CounterStateType > | |
| uint64 | getDRAMClocks (uint32 channel, const CounterStateType &before, const CounterStateType &after) |
| Returns DRAM clock ticks. More... | |
| template<class CounterStateType > | |
| uint64 | getMCDRAMClocks (uint32 channel, const CounterStateType &before, const CounterStateType &after) |
| Returns MCDRAM clock ticks. More... | |
| template<class CounterStateType > | |
| uint64 | getMCCounter (uint32 channel, uint32 counter, const CounterStateType &before, const CounterStateType &after) |
| Direct read of memory controller PMU counter (counter meaning depends on the programming: power/performance/etc) More... | |
| template<class CounterStateType > | |
| uint64 | getM2MCounter (uint32 controller, uint32 counter, const CounterStateType &before, const CounterStateType &after) |
| Direct read of Memory2Mesh controller PMU counter (counter meaning depends on the programming: power/performance/etc) More... | |
| template<class CounterStateType > | |
| uint64 | getEDCCounter (uint32 channel, uint32 counter, const CounterStateType &before, const CounterStateType &after) |
| Direct read of embedded DRAM memory controller counter (counter meaning depends on the programming: power/performance/etc) More... | |
| template<class CounterStateType > | |
| uint64 | getPCUCounter (uint32 counter, const CounterStateType &before, const CounterStateType &after) |
| Direct read of power control unit PMU counter (counter meaning depends on the programming: power/performance/etc) More... | |
| template<class CounterStateType > | |
| uint64 | getPCUClocks (const CounterStateType &before, const CounterStateType &after) |
| Returns clock ticks of power control unit. More... | |
| template<class CounterStateType > | |
| uint64 | getConsumedEnergy (const CounterStateType &before, const CounterStateType &after) |
| Returns energy consumed by processor, excluding DRAM (measured in internal units) More... | |
| template<class CounterStateType > | |
| uint64 | getDRAMConsumedEnergy (const CounterStateType &before, const CounterStateType &after) |
| Returns energy consumed by DRAM (measured in internal units) More... | |
| template<class CounterStateType > | |
| double | getConsumedJoules (const CounterStateType &before, const CounterStateType &after) |
| Returns Joules consumed by processor (excluding DRAM) More... | |
| template<class CounterStateType > | |
| double | getDRAMConsumedJoules (const CounterStateType &before, const CounterStateType &after) |
| Returns Joules consumed by DRAM. More... | |
| PCM_API SystemCounterState | getSystemCounterState () |
| Reads the counter state of the system. More... | |
| PCM_API SocketCounterState | getSocketCounterState (uint32 socket) |
| Reads the counter state of a socket. More... | |
| PCM_API CoreCounterState | getCoreCounterState (uint32 core) |
| Reads the counter state of a (logical) core. More... | |
| template<class CounterStateType > | |
| double | getIPC (const CounterStateType &before, const CounterStateType &after) |
| Computes average number of retired instructions per core cycle (IPC) More... | |
| template<class CounterStateType > | |
| uint64 | getInstructionsRetired (const CounterStateType &before, const CounterStateType &after) |
| Computes the number of retired instructions. More... | |
| template<class CounterStateType > | |
| double | getExecUsage (const CounterStateType &before, const CounterStateType &after) |
| Computes average number of retired instructions per time intervall. More... | |
| template<class CounterStateType > | |
| uint64 | getInstructionsRetired (const CounterStateType &now) |
| Computes the number of retired instructions. More... | |
| template<class CounterStateType > | |
| uint64 | getCycles (const CounterStateType &before, const CounterStateType &after) |
| Computes the number core clock cycles when signal on a specific core is running (not halted) More... | |
| template<class CounterStateType > | |
| uint64 | getRefCycles (const CounterStateType &before, const CounterStateType &after) |
| Computes the number of reference clock cycles while clock signal on the core is running. More... | |
| template<class CounterStateType > | |
| uint64 | getCycles (const CounterStateType &now) |
| Computes the number executed core clock cycles. More... | |
| double | getCoreIPC (const SystemCounterState &before, const SystemCounterState &after) |
| Computes average number of retired instructions per core cycle for the entire system combining instruction counts from logical cores to corresponding physical cores. More... | |
| double | getTotalExecUsage (const SystemCounterState &before, const SystemCounterState &after) |
| Computes average number of retired instructions per time intervall for the entire system combining instruction counts from logical cores to corresponding physical cores. More... | |
| template<class CounterStateType > | |
| double | getAverageFrequency (const CounterStateType &before, const CounterStateType &after) |
| Computes average core frequency also taking Intel Turbo Boost technology into account. More... | |
| template<class CounterStateType > | |
| double | getActiveAverageFrequency (const CounterStateType &before, const CounterStateType &after) |
| Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account) More... | |
| template<class CounterStateType > | |
| double | getRelativeFrequency (const CounterStateType &before, const CounterStateType &after) |
| Computes average core frequency also taking Intel Turbo Boost technology into account. More... | |
| template<class CounterStateType > | |
| double | getActiveRelativeFrequency (const CounterStateType &before, const CounterStateType &after) |
| Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account) More... | |
| template<class CounterStateType > | |
| double | getL2CacheHitRatio (const CounterStateType &before, const CounterStateType &after) |
| Computes L2 cache hit ratio. More... | |
| template<class CounterStateType > | |
| double | getL3CacheHitRatio (const CounterStateType &before, const CounterStateType &after) |
| Computes L3 cache hit ratio. More... | |
| template<class CounterStateType > | |
| uint64 | getL3CacheMisses (const CounterStateType &before, const CounterStateType &after) |
| Computes number of L3 cache misses. More... | |
| template<class CounterStateType > | |
| uint64 | getL2CacheMisses (const CounterStateType &before, const CounterStateType &after) |
| Computes number of L2 cache misses. More... | |
| template<class CounterStateType > | |
| uint64 | getL2CacheHits (const CounterStateType &before, const CounterStateType &after) |
| Computes number of L2 cache hits. More... | |
| template<class CounterStateType > | |
| uint64 | getL3CacheOccupancy (const CounterStateType &now) |
| Computes L3 Cache Occupancy. More... | |
| template<class CounterStateType > | |
| uint64 | getLocalMemoryBW (const CounterStateType &before, const CounterStateType &after) |
| Computes Local Memory Bandwidth. More... | |
| template<class CounterStateType > | |
| uint64 | getRemoteMemoryBW (const CounterStateType &before, const CounterStateType &after) |
| Computes Remote Memory Bandwidth. More... | |
| template<class CounterStateType > | |
| uint64 | getL3CacheHitsNoSnoop (const CounterStateType &before, const CounterStateType &after) |
| Computes number of L3 cache hits where no snooping in sibling L2 caches had to be done. More... | |
| template<class CounterStateType > | |
| uint64 | getL3CacheHitsSnoop (const CounterStateType &before, const CounterStateType &after) |
| Computes number of L3 cache hits where snooping in sibling L2 caches had to be done. More... | |
| template<class CounterStateType > | |
| uint64 | getL3CacheHits (const CounterStateType &before, const CounterStateType &after) |
| Computes total number of L3 cache hits. More... | |
| template<class CounterStateType > | |
| uint64 | getInvariantTSC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of invariant time stamp counter ticks. More... | |
| template<class CounterStateType > | |
| double | getCoreCStateResidency (int state, const CounterStateType &before, const CounterStateType &after) |
| Computes residency in the core C-state. More... | |
| template<class CounterStateType > | |
| uint64 | getCoreCStateResidency (int state, const CounterStateType &now) |
| Reads raw residency counter for the core C-state. More... | |
| template<class CounterStateType > | |
| double | getPackageCStateResidency (int state, const CounterStateType &before, const CounterStateType &after) |
| Computes residency in the package C-state. More... | |
| template<class CounterStateType > | |
| uint64 | getPackageCStateResidency (int state, const CounterStateType &now) |
| Reads raw residency counter for the package C-state. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesReadFromMC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes read from DRAM memory controllers. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesWrittenToMC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes written to DRAM memory controllers. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesReadFromPMM (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes read from PMM memory. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesWrittenToPMM (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes written to PMM memory. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesReadFromEDC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes read from MCDRAM memory controllers. More... | |
| template<class CounterStateType > | |
| uint64 | getBytesWrittenToEDC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes written to MCDRAM memory controllers. More... | |
| template<class CounterStateType > | |
| uint64 | getIORequestBytesFromMC (const CounterStateType &before, const CounterStateType &after) |
| Computes number of bytes of read/write requests from all IO sources. More... | |
| template<class CounterStateType > | |
| uint64 | getSMICount (const CounterStateType &before, const CounterStateType &after) |
| Returns the number of occured system management interrupts. More... | |
| template<class CounterStateType > | |
| uint64 | getNumberOfCustomEvents (int32 eventCounterNr, const CounterStateType &before, const CounterStateType &after) |
| Returns the number of occured custom core events. More... | |
| uint64 | getIncomingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after) |
| Get estimation of QPI data traffic per incoming QPI link. More... | |
| double | getIncomingQPILinkUtilization (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after) |
| Get data utilization of incoming QPI link (0..1) More... | |
| double | getOutgoingQPILinkUtilization (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after) |
| Get utilization of outgoing QPI link (0..1) More... | |
| uint64 | getOutgoingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after) |
| Get estimation of QPI (data+nondata) traffic per outgoing QPI link. More... | |
| uint64 | getAllIncomingQPILinkBytes (const SystemCounterState &before, const SystemCounterState &after) |
| Get estimation of total QPI data traffic. More... | |
| uint64 | getAllOutgoingQPILinkBytes (const SystemCounterState &before, const SystemCounterState &after) |
| Get estimation of total QPI data+nondata traffic. More... | |
| uint64 | getIncomingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &now) |
| Return current value of the counter of QPI data traffic per incoming QPI link. More... | |
| uint64 | getSocketIncomingQPILinkBytes (uint32 socketNr, const SystemCounterState &now) |
| Get estimation of total QPI data traffic for this socket. More... | |
| uint64 | getAllIncomingQPILinkBytes (const SystemCounterState &now) |
| Get estimation of Socket QPI data traffic. More... | |
| double | getQPItoMCTrafficRatio (const SystemCounterState &before, const SystemCounterState &after) |
| Get QPI data to Memory Controller traffic ratio. More... | |
| template<class CounterStateType > | |
| double | getLocalMemoryRequestRatio (const CounterStateType &before, const CounterStateType &after) |
| Get local memory access ration measured in home agent. More... | |
| template<class CounterType > | |
| uint64 | getNumberOfEvents (const CounterType &before, const CounterType &after) |
| Returns the raw count of events. More... | |
| template<class CounterStateType > | |
| double | getLLCReadMissLatency (const CounterStateType &before, const CounterStateType &after) |
| Returns average last level cache read+prefetch miss latency in ns. | |
Main CPU counters header.
Include this header file if you want to access CPU counters (core and uncore - including memory controller chips and QPI)
| double getActiveAverageFrequency | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), and PCM::getNominalFrequency().
| double getActiveRelativeFrequency | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
|
inline |
Get estimation of total QPI data traffic.
Returns an estimation of number of data bytes transferred to all sockets over all Intel(r) Quick Path Interconnect links
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance(), and PCM::getNumSockets().
Referenced by getQPItoMCTrafficRatio().
|
inline |
Get estimation of Socket QPI data traffic.
Returns an estimation of number of data bytes transferred to all sockets over all Intel(r) Quick Path Interconnect links
| now | System CPU counter state |
References PCM::getInstance(), PCM::getNumSockets(), and getSocketIncomingQPILinkBytes().
|
inline |
Get estimation of total QPI data+nondata traffic.
Returns an estimation of number of data and non-data bytes transferred from all sockets over all Intel(r) Quick Path Interconnect links
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance(), and PCM::getNumSockets().
| double getAverageFrequency | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average core frequency also taking Intel Turbo Boost technology into account.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), and PCM::getNominalFrequency().
| uint64 getBytesReadFromEDC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes read from MCDRAM memory controllers.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
| uint64 getBytesReadFromMC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes read from DRAM memory controllers.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getQPItoMCTrafficRatio().
| uint64 getBytesReadFromPMM | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes read from PMM memory.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getQPItoMCTrafficRatio().
| uint64 getBytesWrittenToEDC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes written to MCDRAM memory controllers.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
| uint64 getBytesWrittenToMC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes written to DRAM memory controllers.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getQPItoMCTrafficRatio().
| uint64 getBytesWrittenToPMM | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes written to PMM memory.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getQPItoMCTrafficRatio().
| uint64 getConsumedEnergy | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns energy consumed by processor, excluding DRAM (measured in internal units)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getConsumedJoules().
| double getConsumedJoules | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns Joules consumed by processor (excluding DRAM)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References getConsumedEnergy(), PCM::getInstance(), and PCM::getJoulesPerEnergyUnit().
| PCM_API CoreCounterState getCoreCounterState | ( | uint32 | core | ) |
Reads the counter state of a (logical) core.
Helper function. Uses PCM object to access counters.
| core | core id |
References PCM::getCoreCounterState(), and PCM::getInstance().
Referenced by PCM::getErrorMessage().
|
inline |
Computes residency in the core C-state.
| state | C-state |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getInvariantTSC(), getRefCycles(), and PCM::isCoreCStateResidencySupported().
|
inline |
Reads raw residency counter for the core C-state.
| state | C-state # |
| now | CPU counter state |
|
inline |
Computes average number of retired instructions per core cycle for the entire system combining instruction counts from logical cores to corresponding physical cores.
Use this metric to evaluate IPC improvement between SMT(Hyperthreading) on and SMT off.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getIPC(), PCM::getNumCores(), PCM::getNumOnlineCores(), and PCM::getThreadsPerCore().
| uint64 getCycles | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes the number core clock cycles when signal on a specific core is running (not halted)
Returns number of used cycles (halted cyles are not counted). The counter does not advance in the following conditions:
The performance counter for this event counts across performance state transitions using different core clock frequencies
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getCycles | ( | const CounterStateType & | now | ) |
Computes the number executed core clock cycles.
Returns number of used cycles (halted cyles are not counted).
| now | Current CPU counter state |
| uint64 getDRAMClocks | ( | uint32 | channel, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns DRAM clock ticks.
| channel | DRAM channel number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getDRAMConsumedEnergy | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns energy consumed by DRAM (measured in internal units)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getDRAMConsumedJoules().
| double getDRAMConsumedJoules | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns Joules consumed by DRAM.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getCPUModel(), getDRAMConsumedEnergy(), PCM::getInstance(), and PCM::getJoulesPerEnergyUnit().
| uint64 getEDCCounter | ( | uint32 | channel, |
| uint32 | counter, | ||
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Direct read of embedded DRAM memory controller counter (counter meaning depends on the programming: power/performance/etc)
| counter | counter number |
| channel | channel number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
| double getExecUsage | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average number of retired instructions per time intervall.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getTotalExecUsage().
|
inline |
Get estimation of QPI data traffic per incoming QPI link.
Returns an estimation of number of data bytes transferred to a socket over Intel(r) Quick Path Interconnect
| socketNr | socket identifier |
| linkNr | linkNr |
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getIncomingQPILinkUtilization().
|
inline |
Return current value of the counter of QPI data traffic per incoming QPI link.
Returns the number of incoming data bytes to a socket over Intel(r) Quick Path Interconnect
| socketNr | socket identifier |
| linkNr | linkNr |
| now | Current System CPU counter state |
References PCM::getInstance().
|
inline |
Get data utilization of incoming QPI link (0..1)
Returns an estimation of utilization of QPI link by data traffic transferred to a socket over Intel(r) Quick Path Interconnect
| socketNr | socket identifier |
| linkNr | linkNr |
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References getIncomingQPILinkBytes(), PCM::getInstance(), getInvariantTSC(), PCM::getNominalFrequency(), PCM::getNumCores(), and PCM::getQPILinkSpeed().
| uint64 getInstructionsRetired | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes the number of retired instructions.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getInstructionsRetired | ( | const CounterStateType & | now | ) |
Computes the number of retired instructions.
| now | Current CPU counter state |
| uint64 getInvariantTSC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of invariant time stamp counter ticks.
This counter counts irrespectively of C-, P- or T-states
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getCoreCStateResidency(), getIncomingQPILinkUtilization(), getLLCReadMissLatency(), getOutgoingQPILinkBytes(), getOutgoingQPILinkUtilization(), getPackageCStateResidency(), and PCM::getTickCount().
| uint64 getIORequestBytesFromMC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of bytes of read/write requests from all IO sources.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
| double getIPC | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average number of retired instructions per core cycle (IPC)
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getCoreIPC().
| double getL2CacheHitRatio | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes L2 cache hit ratio.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getL2CacheHits(), and getL2CacheMisses().
| uint64 getL2CacheHits | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of L2 cache hits.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getL2CacheHitRatio().
| uint64 getL2CacheMisses | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of L2 cache misses.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getL2CacheHitRatio().
| double getL3CacheHitRatio | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes L3 cache hit ratio.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getL3CacheHits(), and getL3CacheMisses().
| uint64 getL3CacheHits | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes total number of L3 cache hits.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getL3CacheHitsNoSnoop(), and getL3CacheHitsSnoop().
Referenced by getL3CacheHitRatio().
| uint64 getL3CacheHitsNoSnoop | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of L3 cache hits where no snooping in sibling L2 caches had to be done.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getL3CacheHits().
| uint64 getL3CacheHitsSnoop | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of L3 cache hits where snooping in sibling L2 caches had to be done.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getL3CacheHits().
| uint64 getL3CacheMisses | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes number of L3 cache misses.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getL3CacheHitRatio().
| uint64 getL3CacheOccupancy | ( | const CounterStateType & | now | ) |
Computes L3 Cache Occupancy.
References PCM::getInstance(), and PCM::L3CacheOccupancyMetricAvailable().
| uint64 getLocalMemoryBW | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes Local Memory Bandwidth.
References PCM::CoreLocalMemoryBWMetricAvailable(), and PCM::getInstance().
Referenced by getRemoteMemoryBW().
|
inline |
Get local memory access ration measured in home agent.
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance().
| uint64 getM2MCounter | ( | uint32 | controller, |
| uint32 | counter, | ||
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Direct read of Memory2Mesh controller PMU counter (counter meaning depends on the programming: power/performance/etc)
| counter | counter number |
| controller | controller number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getMCCounter | ( | uint32 | channel, |
| uint32 | counter, | ||
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Direct read of memory controller PMU counter (counter meaning depends on the programming: power/performance/etc)
| counter | counter number |
| channel | channel number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getMCDRAMClocks | ( | uint32 | channel, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns MCDRAM clock ticks.
| channel | MCDRAM channel number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| double getNormalizedQPIL0pTxCycles | ( | uint32 | port, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns the ratio of QPI cycles in power saving half-lane mode.
| port | QPI port number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References getQPIClocks(), and getQPIL0pTxCycles().
| double getNormalizedQPIL1Cycles | ( | uint32 | port, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns the ratio of QPI cycles in power saving shutdown mode.
| port | QPI port number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References getQPIClocks(), and getQPIL1Cycles().
| uint64 getNumberOfCustomEvents | ( | int32 | eventCounterNr, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns the number of occured custom core events.
Read number of events programmed with the CUSTOM_CORE_EVENTS
| eventCounterNr | Event/counter number (value from 0 to 3) |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
|
inline |
Returns the raw count of events.
| before | counter state before the experiment |
| after | counter state after the experiment |
|
inline |
Get estimation of QPI (data+nondata) traffic per outgoing QPI link.
Returns an estimation of number of data bytes transferred from a socket over Intel(r) Quick Path Interconnect
| socketNr | socket identifier |
| linkNr | linkNr |
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance(), getInvariantTSC(), PCM::getNominalFrequency(), PCM::getNumCores(), getOutgoingQPILinkUtilization(), and PCM::getQPILinkSpeed().
|
inline |
Get utilization of outgoing QPI link (0..1)
Returns an estimation of utilization of QPI link by (data+nondata) traffic transferred from a socket over Intel(r) Quick Path Interconnect
| socketNr | socket identifier |
| linkNr | linkNr |
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance(), getInvariantTSC(), PCM::getNominalFrequency(), PCM::getNumCores(), and PCM::getQPILinkSpeed().
Referenced by getOutgoingQPILinkBytes().
|
inline |
Computes residency in the package C-state.
| state | C-state |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References PCM::getInstance(), getInvariantTSC(), and PCM::isPackageCStateResidencySupported().
|
inline |
Reads raw residency counter for the package C-state.
| state | C-state # |
| now | CPU counter state |
| uint64 getPCUClocks | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns clock ticks of power control unit.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References getPCUCounter().
| uint64 getPCUCounter | ( | uint32 | counter, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Direct read of power control unit PMU counter (counter meaning depends on the programming: power/performance/etc)
| counter | counter number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getPCUClocks().
| uint64 getQPIClocks | ( | uint32 | port, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns QPI LL clock ticks.
| port | QPI port number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getNormalizedQPIL0pTxCycles(), and getNormalizedQPIL1Cycles().
| uint64 getQPIL0pTxCycles | ( | uint32 | port, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns the number of QPI cycles in power saving half-lane mode.
| port | QPI port number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getNormalizedQPIL0pTxCycles().
| uint64 getQPIL1Cycles | ( | uint32 | port, |
| const CounterStateType & | before, | ||
| const CounterStateType & | after | ||
| ) |
Returns the number of QPI cycles in power saving shutdown mode.
| port | QPI port number |
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getNormalizedQPIL1Cycles().
|
inline |
Get QPI data to Memory Controller traffic ratio.
Ideally for NUMA-optmized programs the ratio should be close to 0.
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References getAllIncomingQPILinkBytes(), getBytesReadFromMC(), getBytesReadFromPMM(), getBytesWrittenToMC(), getBytesWrittenToPMM(), and PCM::getInstance().
| uint64 getRefCycles | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes the number of reference clock cycles while clock signal on the core is running.
The reference clock operates at a fixed frequency, irrespective of core frequency changes due to performance state transitions. See Intel(r) Software Developer's Manual for more details
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
Referenced by getCoreCStateResidency().
| double getRelativeFrequency | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes average core frequency also taking Intel Turbo Boost technology into account.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| uint64 getRemoteMemoryBW | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Computes Remote Memory Bandwidth.
References PCM::CoreRemoteMemoryBWMetricAvailable(), PCM::getInstance(), and getLocalMemoryBW().
| uint64 getSMICount | ( | const CounterStateType & | before, |
| const CounterStateType & | after | ||
| ) |
Returns the number of occured system management interrupts.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
| PCM_API SocketCounterState getSocketCounterState | ( | uint32 | socket | ) |
Reads the counter state of a socket.
Helper function. Uses PCM object to access counters.
| socket | socket id |
References PCM::getInstance(), and PCM::getSocketCounterState().
Referenced by PCM::getErrorMessage().
|
inline |
Get estimation of total QPI data traffic for this socket.
Returns an estimation of number of bytes transferred to this sockets over all Intel(r) Quick Path Interconnect links on this socket
| before | System CPU counter state before the experiment |
| after | System CPU counter state after the experiment |
References PCM::getInstance().
Referenced by getAllIncomingQPILinkBytes().
| PCM_API SystemCounterState getSystemCounterState | ( | ) |
Reads the counter state of the system.
Helper function. Uses PCM object to access counters.
System consists of several sockets (CPUs). Socket has a CPU in it. Socket (CPU) consists of several (logical) cores.
References PCM::getInstance(), and PCM::getSystemCounterState().
Referenced by PCM::getErrorMessage().
|
inline |
Computes average number of retired instructions per time intervall for the entire system combining instruction counts from logical cores to corresponding physical cores.
Use this metric to evaluate cores utilization improvement between SMT(Hyperthreading) on and SMT off.
| before | CPU counter state before the experiment |
| after | CPU counter state after the experiment |
References getExecUsage(), PCM::getInstance(), PCM::getNumCores(), PCM::getNumOnlineCores(), and PCM::getThreadsPerCore().


FITSIO Home
Next: 8.2 Group Member Routines
Up: 8. Hierarchical Grouping Routines
Previous: 8. Hierarchical Grouping Routines
Contents
- 1
- Create (append) a grouping table at the end of the current FITS file
pointed to by fptr. The grpname parameter provides the grouping table
name (GRPNAME keyword value) and may be set to NULL if no group name
is to be specified. The grouptype parameter specifies the desired
structure of the grouping table and may take on the values:
GT_ID_ALL_URI (all columns created), GT_ID_REF (ID by reference columns),
GT_ID_POS (ID by position columns), GT_ID_ALL (ID by reference and
position columns), GT_ID_REF_URI (ID by reference and FITS file URI
columns), and GT_ID_POS_URI (ID by position and FITS file URI columns).
int fits_create_group / ffgtcr
(fitsfile *fptr, char *grpname, int grouptype, > int *status)
- 2
- Create (insert) a grouping table just after the CHDU of the current FITS
file pointed to by fptr. All HDUs below the the insertion point will be
shifted downwards to make room for the new HDU. The grpname parameter
provides the grouping table name (GRPNAME keyword value) and may be set to
NULL if no group name is to be specified. The grouptype parameter specifies
the desired structure of the grouping table and may take on the values:
GT_ID_ALL_URI (all columns created), GT_ID_REF (ID by reference columns),
GT_ID_POS (ID by position columns), GT_ID_ALL (ID by reference and
position columns), GT_ID_REF_URI (ID by reference and FITS file URI
columns), and GT_ID_POS_URI (ID by position and FITS file URI columns) .
int fits_insert_group / ffgtis
(fitsfile *fptr, char *grpname, int grouptype, > int *status)
- 3
- Change the structure of an existing grouping table pointed to by
gfptr. The grouptype parameter (see fits_create_group() for valid
parameter values) specifies the new structure of the grouping table. This
function only adds or removes grouping table columns, it does not add
or delete group members (i.e., table rows). If the grouping table already
has the desired structure then no operations are performed and function
simply returns with a (0) success status code. If the requested structure
change creates new grouping table columns, then the column values for all
existing members will be filled with the null values appropriate to the
column type.
int fits_change_group / ffgtch
(fitsfile *gfptr, int grouptype, > int *status)
- 4
- Remove the group defined by the grouping table pointed to by gfptr, and
optionally all the group member HDUs. The rmopt parameter specifies the
action to be taken for
all members of the group defined by the grouping table. Valid values are:
OPT_RM_GPT (delete only the grouping table) and OPT_RM_ALL (recursively
delete all HDUs that belong to the group). Any groups containing the
grouping table gfptr as a member are updated, and if rmopt == OPT_RM_GPT
all members have their GRPIDn and GRPLCn keywords updated accordingly.
If rmopt == OPT_RM_ALL, then other groups that contain the deleted members
of gfptr are updated to reflect the deletion accordingly.
int fits_remove_group / ffgtrm
(fitsfile *gfptr, int rmopt, > int *status)
- 5
- Copy (append) the group defined by the grouping table pointed to by infptr,
and optionally all group member HDUs, to the FITS file pointed to by
outfptr. The cpopt parameter specifies the action to be taken for all
members of the group infptr. Valid values are: OPT_GCP_GPT (copy only
the grouping table) and OPT_GCP_ALL (recursively copy ALL the HDUs that
belong to the group defined by infptr). If the cpopt == OPT_GCP_GPT then
the members of infptr have their GRPIDn and GRPLCn keywords updated to
reflect the existence of the new grouping table outfptr, since they now
belong to the new group. If cpopt == OPT_GCP_ALL then the new
grouping table outfptr only contains pointers to the copied member HDUs
and not the original member HDUs of infptr. Note that, when
cpopt == OPT_GCP_ALL, all members of the group defined by infptr will be
copied to a single FITS file pointed to by outfptr regardless of their
file distribution in the original group.
int fits_copy_group / ffgtcp
(fitsfile *infptr, fitsfile *outfptr, int cpopt, > int *status)
- 6
- Merge the two groups defined by the grouping table HDUs infptr and outfptr
by combining their members into a single grouping table. All member HDUs
(rows) are copied from infptr to outfptr. If mgopt == OPT_MRG_COPY then
infptr continues to exist unaltered after the merge. If the mgopt ==
OPT_MRG_MOV then infptr is deleted after the merge. In both cases,
the GRPIDn and GRPLCn keywords of the member HDUs are updated accordingly.
int fits_merge_groups / ffgtmg
(fitsfile *infptr, fitsfile *outfptr, int mgopt, > int *status)
- 7
- "Compact" the group defined by grouping table pointed to by gfptr. The
compaction is achieved by merging (via fits_merge_groups()) all direct
member HDUs of gfptr that are themselves grouping tables. The cmopt
parameter defines whether the merged grouping table HDUs remain after
merging (cmopt == OPT_CMT_MBR) or if they are deleted after merging
(cmopt == OPT_CMT_MBR_DEL). If the grouping table contains no direct
member HDUs that are themselves grouping tables then this function
does nothing. Note that this function is not recursive, i.e., only the
direct member HDUs of gfptr are considered for merging.
int fits_compact_group / ffgtcm
(fitsfile *gfptr, int cmopt, > int *status)
- 8
- Verify the integrity of the grouping table pointed to by gfptr to make
sure that all group members are accessible and that all links to other
grouping tables are valid. The firstfailed parameter returns the member
ID (row number) of the first member HDU to fail verification (if positive
value) or the first group link to fail (if negative value). If gfptr is
successfully verified then firstfailed contains a return value of 0.
int fits_verify_group / ffgtvf
(fitsfile *gfptr, > long *firstfailed, int *status)
- 9
- Open a grouping table that contains the member HDU pointed to by mfptr.
The grouping table to open is defined by the grpid parameter, which
contains the keyword index value of the GRPIDn/GRPLCn keyword(s) that
link the member HDU mfptr to the grouping table. If the grouping table
resides in a file other than the member HDUs file then an attempt is
first made to open the file readwrite, and failing that readonly. A
pointer to the opened grouping table HDU is returned in gfptr.
Note that it is possible, although unlikely and undesirable, for the
GRPIDn/GRPLCn keywords in a member HDU header to be non-continuous, e.g.,
GRPID1, GRPID2, GRPID5, GRPID6. In such cases, the grpid index value
specified in the function call shall identify the (grpid)th GRPID value.
In the above example, if grpid == 3, then the group specified by GRPID5
would be opened.
int fits_open_group / ffgtop
(fitsfile *mfptr, int group, > fitsfile **gfptr, int *status)
- 10
- Add a member HDU to an existing grouping table pointed to by gfptr.
The member HDU may either be pointed to mfptr (which must be positioned
to the member HDU) or, if mfptr == NULL, identified by the hdupos parameter
(the HDU position number, Primary array == 1) if both the grouping table
and the member HDU reside in the same FITS file. The new member HDU shall
have the appropriate GRPIDn and GRPLCn keywords created in its header.
Note that if the member HDU is already a member of the group then it will
not be added a second time.
int fits_add_group_member / ffgtam
(fitsfile *gfptr, fitsfile *mfptr, int hdupos, > int *status)
FITSIO Home
Next: 8.2 Group Member Routines
Up: 8. Hierarchical Grouping Routines
Previous: 8. Hierarchical Grouping Routines
Contents


The latest stories from around the U.S.
While the debate over mandated "vaccine passports" rages on, a growing number of employers, businesses and venues are demanding proof of vaccination. Here are some suggestions to ensure that vaccinated people are always covered.
Serious coronavirus infections among vaccinated people have been relatively rare since the start of the vaccination campaign, a New York Times analysis of data from 40 states and Washington, D.C., shows.
The Justice Department and New Jersey have reached an agreement to implement a series of reforms to better protect inmates from sexual abuse by staff at a notorious women's prison, officials announced Tuesday.


I was introduced to the drug during the last semester of my senior year in high school--to tell the truth, I wish I had discovered the drug months before during SAT season. The AP tests were bearing down on all of us at the time, and one friend allowed me to partake in his prescription for 30 mg extended-release capsules. That was an extremely high dose for me: after kicking in, the drug had me jittery with sweating palms for nearly nine hours straight.
I used the same dosage for six separate AP tests that year, and managed perfect or near-perfect scores on all of them. I did not study on the drug--rather, I took the pills for the actual exam. In a moment of brilliance (uncharacteristic of me at that age) I chose the last two AP tests of the year to be a drug-free control group. Of course, I scored much lower on these tests (though I honestly felt I was the most prepared in those subjects). The drug had allowed me to remain focussed, process information faster, and above all, think in the structured fashion that is required for most standardized or semi-standardized tests.
Three years later, and I was buckling under the pressure of the LSATs. By then I had had other experiences with Adderall since high school, but with only mixed results: often I found that I was able to complete long essays or study an impossible amount of material in short periods of time, but seemed to fare only slightly, if at all, better grade-wise than I would have with the proper preparation/adequate sleep. I had taken the LSATs once before and done decently (within the third quartile), however, seeking more in my choices for law school, I opted for a second try.
Of course I revived the old Adderall hookup for this go-around, so on the morning of the test I was set to go (sweaty palms and all). As expected, the portions of the exam which had previously tried my concentration now seemed routine, and I managed to breeze through the exam on two 30 mg extended release capsules. When my score came back, I was shocked: I had improved my score substantially more than two friends who had taken prep courses since their last attempt. I was thankful for the drug's 'boost' on this and previous tests, but vowed to abstain for the duration of law school. I haven't broken that vow and have since only become firmer in my opposition to the drug's use.
These experiences confirmed what I had heard all along, from friends who abandoned their prescriptions in childhood: Adderall is a stimulant for structured thinking only. It is not a recipe for brilliance. Brilliance involves a degree of originality or creativity. With this drug, I think linearly. I become calculating and conservative. In the words of one friend, I think 'inside the box'.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


LoggerCreates and dispatches LogEvents |
|
|---|---|
Loggers |
|
|
|
Print a Logger Object |
Demote an Exception to a Warning |
|
Manage Log Levels |
|
|
|
Simple Logging |
Get/Create a Logger |
|
Logger Configuration Objects |
|
AppendersOutput LogEvents to a destination |
|
Log to the Console |
|
Log to an In-Memory Data.Table |
|
Log to Databases via DBI |
|
Log to a File |
|
Log to a JSON File |
|
Log to Databases via RJDBC |
|
Log to a Memory Buffer |
|
Send Log Emails via gmailr |
|
Send Log Emails via sendmailR |
|
Send Push-Notifications via RPushbullet |
|
LayoutsFormat LogEvents before output |
|
Format Log Events for Output to Databases |
|
Format Log Events as Text |
|
Format Log Events as Text via glue |
|
Format LogEvents as JSON |
|
LogEventContains the Data that is beeing logged |
|
Events - The Atomic Unit of Logging |
|
|
|
Coerce LogEvents to Data Frames |
Print or Format Logging Data |
|
FiltersFilter events passed to Appenders or Loggers |
|
Event Filters |
|
Check if an R Object is a Filter |
|
Utilities |
|
|
|
Suspend All Logging |
Inject Values into Logging Calls |
|
Information About the System |
|
Read a JSON logfile |
|
Setup a Simple Logger for a Package |
|
Label/Unlabel Log Levels |
|
Colorize Levels |
|
Pad Character Vectors |
|
Select Appropriate Database Table Layout |
|
Abstract ClassesFor Package developers that want to build new Appenders, Layouts or Loggers |
|
Appenders |
|
Abstract Class for Layouts |
|
Abstract Class for Filterables |
|
Abstract Class for Logging to Tabular Structures |
|
Abstract Class for Logging to Memory Buffers |
|
Abstract Class for Digests |


Podcasts
10 Sep 2013
Podcasting seems to be in a phase of growth. Suddenly there are dozens of good shows about the web and creative industries. It's not a new medium so maybe the growth has been more steady and I hadn't noticed until now but I'm loving the results. I grew up with talk radio on around the house which I think gave me a special interest in listening to a good conversation. I love good music but I seem to crave podcasts more than tunes these days; call me weird. I love being able to learn something new about a design legend or discovering how the creators of a hot new app built an idea from scratch, all while driving my short commute. I end up educated, inspired, and entertained. It's a great way to bookend the workday. So without further adieu, here are my current favorites:
99% Invisible
I love this show so much that each episode seems too short. Where else am I going to learn about the guy who created the area code, an otherworldly pavilion that attract teenagers at night, or where jay walkers got their name. If all public radio was this good, we wouldn't be debating budgets, people would gladly pay to hear it.
99percentinvisible.org |
iTunes
Happy Monday
There is no better way to start your Monday than with a short burst of inspiration from Josh Long and Sarah Parmenter and their guests.
happymondaypodcast.com |
iTunes
Execute
Jealous of those people who think of a product idea and then just make it happen? It doesn't take special powers, just read
Execute and then listen to the Execute podcast and you'll be that person in no time. Maybe I should execute my own podcast.
Execute theindustry.cc |
iTunes
The Big Web Show
As the Godfather of the Web, Jeffery Zeldman can get an interview with anyone. I met "Mr Ziggy" once and although his stature is small, his knowledge is larger than life. I took a picture if you want to see it. :)
The Big Web Show |
Archives on 5by5 |
iTunes
Design Matters
Debbie Milman has been interviewing influencers in art and design for years. Check the archives for a design education by ear.
observermedia.designobserver.com |
iTunes
Foundation
I keep up with hat's hot in the startup culture that surrounds me here in Silicon Valley via Kevin Rose.
foundation.kr |
iTunes
The Gently Mad
Another quality design interview show that is new to my list. Adam Clark brings a fresh approach to the interview format.
thegentlymad.com |
iTunes
Origin Story
This is different take on the interview format, asking the guest to start from childhood and work toward the present. The lesson is you can overcome anything with passion.
unitedpixelworkers.com |
iTunes
The Businessology Show
Dan Mall and Jason Blumer get into the nitty gritty of running a creative business. Don't miss
episode 4 on value pricing, it changed my mindset on client work completely. That topic deserves it's own blog post. In the meantime,
read this.
businessologyshow.biz | iTunes
RadioLab
This ones not design specific but it's a great source for learning something new.
radiolab.org | iTunes
Pixel Recess
I don't know what's going on here but I'm hooked. Just try a little bit.
pixelrecess.com |
iTunes
Start Listening
So start listening. I will update this as I find new favorites. Let me know what you discover in the comments.
Updates:
9/24/13
The Big Web Show has moved to Mule Radio.