Tuesday, December 3, 2019

Digest for comp.programming.threads@googlegroups.com - 6 updates in 5 topics

aminer68@gmail.com: Dec 02 02:37PM -0800

Hello,
 
 
More explanation so that you understand me more..
 
You have to understand me more, as you have noticed my opensource software projects are not just opensource projects, because i am taking care of explaining how to use them inside the README file or inside
an HTML file when they are too complex, and you can for example notice it with my following software project of my Parallel C++ Conjugate Gradient Linear System Solver Library that scales very well that is very interesting, because i am simplifying the complex mathematics behind it by presenting it to you with my easy C++ interface, the Conjugate Gradient Method is the most prominent iterative method for solving sparse systems of linear equations. Unfortunately, many textbook treatments of the topic are written with neither illustrations nor intuition, and their victims can be found to this day babbling senselessly in the corners of dusty libraries. For this reason, a deep, geometric understanding of the method has been reserved for the elite brilliant few who have painstakingly decoded the mumblings of their forebears. Conjugate gradient is the most popular iterative method for solving large systems of linear equations. CG is effective for systems of the form A.x = b where x is an unknown vector, b is a known vector, A is a known square, symmetric, positive-definite (or positive-indefinite) matrix. These systems arise in many important settings, such as finite difference and finite element methods for solving partial differential equations, structural analysis, circuit analysis, and math homework
 
The Conjugate gradient method can also be applied to non-linear problems, but with much less success since the non-linear functions have multiple minimums. The Conjugate gradient method will indeed find a minimum of such a nonlinear function, but it is in no way guaranteed to be a global minimum, or the minimum that is desired.
But the conjugate gradient method is great iterative method for solving large, sparse linear systems with a symmetric, positive, definite matrix.
 
In the method of conjugate gradients the residuals are not used as search directions, as in the steepest decent method, cause searching can require a large number of iterations as the residuals zig zag towards the minimum value for ill-conditioned matrices. But instead conjugate gradient method uses the residuals as a basis to form conjugate search directions . In this manner, the conjugated gradients (residuals) form a
basis of search directions to minimize the quadratic function f(x)=1/2*Transpose(x)*A*x + Transpose(b)*x and to achieve faster speed and result of dim(N) convergence.
 
 
And here is My Parallel C++ Conjugate Gradient Linear System Solver Library that scales very well version 1.76:
 
Author: Amine Moulay Ramdane
 
Description:
 
This library contains a Parallel implementation of Conjugate Gradient Dense Linear System Solver library that is NUMA-aware and cache-aware that scales very well, and it contains also a Parallel implementation of Conjugate Gradient Sparse Linear System Solver library that is cache-aware that scales very well.
 
Sparse linear system solvers are ubiquitous in high performance computing (HPC) and often are the most computational intensive parts in scientific computing codes. A few of the many applications relying on sparse linear solvers include fusion energy simulation, space weather simulation, climate modeling, and environmental modeling, and finite element method, and large-scale reservoir simulations to enhance oil recovery by the oil and gas industry.
 
Conjugate Gradient is known to converge to the exact solution in n steps for a matrix of size n, and was historically first seen as a direct method because of this. However, after a while people figured out that it works really well if you just stop the iteration much earlier - often you will get a very good approximation after much fewer than n steps. In fact, we can analyze how fast Conjugate gradient converges. The end result is that Conjugate gradient is used as an iterative method for large linear systems today.
 
Please download the zip file and read the readme file inside the zip to know how to use it.
 
 
You can download it from:
 
https://sites.google.com/site/scalable68/scalable-parallel-c-conjugate-gradient-linear-system-solver-library
 
 
Language: GNU C++ and Visual C++ and C++Builder
 
Operating Systems: Windows, Linux, Unix and Mac OS X on (x86)
 
 
 

 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Dec 02 01:33PM -0800

Hello,
 
 
About Locks..
 
I have just read the following article that appeared in C/C++ Users Journal, 23(3), March 2005
 
The Trouble With Locks
 
http://gotw.ca/publications/mill36.htm
 
 
But i don't agree with him about composability of lock-based systems,
read the following to understand:
 
About composability of lock-based systems now:
 
Design your systems to be composable. Among the more galling claims of the detractors of lock-based systems is the notion that they are somehow uncomposable:
 
"Locks and condition variables do not support modular programming," reads one typically brazen claim, "building large programs by gluing together smaller programs[:] locks make this impossible."9 The claim, of course, is incorrect. For evidence one need only point at the composition of lock-based systems such as databases and operating systems into larger systems that remain entirely unaware of lower-level locking.
 
There are two ways to make lock-based systems completely composable, and each has its own place. First (and most obviously), one can make locking entirely internal to the subsystem. For example, in concurrent operating systems, control never returns to user level with in-kernel locks held; the locks used to implement the system itself are entirely behind the system call interface that constitutes the interface to the system. More generally, this model can work whenever a crisp interface exists between software components: as long as control flow is never returned to the caller with locks held, the subsystem will remain composable.
 
Second (and perhaps counterintuitively), one can achieve concurrency and
composability by having no locks whatsoever. In this case, there must be
no global subsystem state—subsystem state must be captured in per-instance state, and it must be up to consumers of the subsystem to assure that they do not access their instance in parallel. By leaving locking up to the client of the subsystem, the subsystem itself can be used concurrently by different subsystems and in different contexts. A concrete example of this is the AVL tree implementation used extensively in the Solaris kernel. As with any balanced binary tree, the implementation is sufficiently complex to merit componentization, but by not having any global state, the implementation may be used concurrently by disjoint subsystems—the only constraint is that manipulation of a single AVL tree instance must be serialized.
 
Read more here:
 
https://queue.acm.org/detail.cfm?id=1454462
 
 
 
Thank you,
Amine Moulat Ramdane.
aminer68@gmail.com: Dec 02 01:19PM -0800

Hello,
 
 
I have implemented this C++ MemPool for real-time systems, you can
take a look at it:
 
 
C++ MemPool for real-time systems version 1.09
 
Author: Amine Moulay Ramdane
 
Description:
 
Real-Time Memory Management
 
In C++, memory management is normally performed using new,delete etc. The run-time system's heap offers great flexibility and efficiency, but it cannot fulfil real-time requirements. The run-time requirements are non-deterministic. In addition, they may require blocking task switches, which makes them unusable for interrupt handlers.
 
MemPool uses templates and offers memory management with real-time capabilities through Memory Pools. A Memory Pool is an isolated heap with data buffers as objects of equal size. Any number of memory pools can exist simultaneously. A pool is initialized once and allocated a certain number of buffers as objects. Thereafter, buffers as objects can be allocated and deallocated from the pool under real-time conditions.
 
How to use it?
 
The parameters of the constructor are:
 
The first parameter is the number of items and the second parameter is a boolean parameter that will tell MemPool to grow or not, if it is set to true it will grow, set it to false for real-time systems, if you don't pass any parameter, the number of items will be set to 100 and the MemPool will not grow and thus it will be set for real-time systems.
 
The New() method returns a reference to the object, it's in O(1) time complexity.
 
The Return() method returns the reference to the object to the stack, it's in O(1) time complexity.
 
Please look at the test.cpp example to learn how to use MemPool.
 
Language: GNU C++ and Visual C++ and C++Builder
 
 
 
You can download it from:
 
https://sites.google.com/site/scalable68/c-mempool-for-real-time-systems
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Dec 02 01:00PM -0800

Hello,
 
 
 
I have implemented the following two good random number generator:
 
 
Good random number generators version 1.02
 
Author: Amine Moulay Ramdane that has enhanced
both random number generators.
 
Description:
 
This is an enhanced versions of both Mersenne Twister that is a good random number generator and Splitmix64 that is a fast random number generator, both have passed the "BigCrush" tests.
 
 
You can download the zip file from:
 
https://sites.google.com/site/scalable68/good-random-number-generators
 
 
Look into defines.inc file, there is many options:
 
{$DEFINE CPU32} and {$DEFINE Windows32} for 32 bit systems
 
{$DEFINE CPU64} and {$DEFINE Windows64} for 64 bit systems
 
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Dec 02 10:43AM -0800

Hello,
 
 
Understanding page faults and memory swap-in/outs: when should you worry?
 
Read more here:
 
https://scoutapm.com/blog/understanding-page-faults-and-memory-swap-in-outs-when-should-you-worry
 
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Dec 02 08:05PM +0100

The writer of this article seems a bit confused:
1. Copy on write isn't made on any memory that is allocated.
Memory that is allocated is simply overcommited, that has
nothing to do with copy on write.
2. It's not generally a problem if the virtual address-space
of all processes is larger than the pyhsical memory. It may
be that there are a lot of not written pages which haven't
been associated with individual pyhsical pages. In this case
there's a large overcommit-space.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: