Parallelization with MPI and OpenMPI
Contents
9. Parallelization with MPI and OpenMPI¶
9.1. How much is parallelizable¶
If any non-parallel code slips into the application, the parallel performance is limited.
In many simulations, however, the fraction of non-parallelizable work is \(10^{-6}\) or less due to large arrays or objects that are perfectly parallelizable.
9.2. Today’s situation of parallel computing¶
Distributed memory is the dominant hardware configuration. There is a large diversity in these machines, from MPP (massively parallel processing) systems to clusters of off-the-shelf PCs, which are very cost-effective.
Message-passing is a mature programming paradigm and widely accepted. It often provides an efficient match to the hardware. It is primarily used for the distributed memory systems, but can also be used on shared memory systems.
Modern nodes have nowadays several cores, which makes it interesting to use both shared memory (the given node) and distributed memory (several nodes with communication). This leads often to codes which use both MPI and OpenMP.
Our lectures will focus on both MPI and OpenMP.
9.3. Overhead present in parallel computing¶
Uneven load balance: not all the processors can perform useful work at all time.
Overhead of synchronization
Overhead of communication
Extra computation due to parallelization
Due to the above overhead and that certain parts of a sequential algorithm cannot be parallelized we may not achieve an optimal parallelization.
9.4. Parallelizing a sequential algorithm¶
Identify the part(s) of a sequential algorithm that can be executed in parallel. This is the difficult part,
Distribute the global work and data among \(P\) processors.
9.5. Strategies¶
Develop codes locally, run with some few processes and test your codes. Do benchmarking, timing and so forth on local nodes, for example your laptop or PC.
When you are convinced that your codes run correctly, you can start your production runs on available supercomputers.
9.6. How do I run MPI on a PC/Laptop? MPI¶
To install MPI is rather easy on hardware running unix/linux as operating systems, follow simply the instructions from the OpenMPI website. See also subsequent slides. When you have made sure you have installed MPI on your PC/laptop,
Compile with mpicxx/mpic++ or mpif90
# Compile and link
mpic++ -O3 -o nameofprog.x nameofprog.cpp
# run code with for example 8 processes using mpirun/mpiexec
mpiexec -n 8 ./nameofprog.x
9.7. Can I do it on my own PC/laptop? OpenMP installation¶
If you wish to install MPI and OpenMP on your laptop/PC, we recommend the following:
For OpenMP, the compile option -fopenmp is included automatically in recent versions of the C++ compiler and Fortran compilers. For users of different Linux distributions, simply use the available C++ or Fortran compilers and add the above compiler instructions, see also code examples below.
For OS X users however, install libomp
brew install libomp
and compile and link as
c++ -o <name executable> <name program.cpp> -lomp
9.8. Installing MPI¶
For linux/ubuntu users, you need to install two packages (alternatively use the synaptic package manager)
sudo apt-get install libopenmpi-dev
sudo apt-get install openmpi-bin
For OS X users, install brew (after having installed xcode and gcc, needed for the gfortran compiler of openmpi) and then install with brew
brew install openmpi
When running an executable (code.x), run as
mpirun -n 10 ./code.x
where we indicate that we want the number of processes to be 10.
9.9. Installing MPI and using Qt¶
With openmpi installed, when using Qt, add to your .pro file the instructions here
You may need to tell Qt where openmpi is stored.
9.10. What is Message Passing Interface (MPI)?¶
MPI is a library, not a language. It specifies the names, calling sequences and results of functions or subroutines to be called from C/C++ or Fortran programs, and the classes and methods that make up the MPI C++ library. The programs that users write in Fortran, C or C++ are compiled with ordinary compilers and linked with the MPI library.
MPI programs should be able to run on all possible machines and run all MPI implementetations without change.
An MPI computation is a collection of processes communicating with messages.
9.11. Going Parallel with MPI¶
Task parallelism: the work of a global problem can be divided into a number of independent tasks, which rarely need to synchronize. Monte Carlo simulations or numerical integration are examples of this.
MPI is a message-passing library where all the routines have corresponding C/C++-binding
MPI_Command_name
and Fortran-binding (routine names are in uppercase, but can also be in lower case)
MPI_COMMAND_NAME
9.12. MPI is a library¶
MPI is a library specification for the message passing interface, proposed as a standard.
independent of hardware;
not a language or compiler specification;
not a specific implementation or product.
A message passing standard for portability and ease-of-use. Designed for high performance.
Insert communication and synchronization functions where necessary.
9.13. Bindings to MPI routines¶
MPI is a message-passing library where all the routines have corresponding C/C++-binding
MPI_Command_name
and Fortran-binding (routine names are in uppercase, but can also be in lower case)
MPI_COMMAND_NAME
The discussion in these slides focuses on the C++ binding.
9.14. Communicator¶
A group of MPI processes with a name (context).
Any process is identified by its rank. The rank is only meaningful within a particular communicator.
By default the communicator contains all the MPI processes.
MPI_COMM_WORLD
Mechanism to identify subset of processes.
Promotes modular design of parallel libraries.
9.15. Some of the most important MPI functions¶
\(MPI\_Init\) - initiate an MPI computation
\(MPI\_Finalize\) - terminate the MPI computation and clean up
\(MPI\_Comm\_size\) - how many processes participate in a given MPI communicator?
\(MPI\_Comm\_rank\) - which one am I? (A number between 0 and size-1.)
\(MPI\_Send\) - send a message to a particular process within an MPI communicator
\(MPI\_Recv\) - receive a message from a particular process within an MPI communicator
\(MPI\_reduce\) or \(MPI\_Allreduce\), send and receive messages
9.16. The first MPI C/C++ program¶
Let every process write “Hello world” (oh not this program again!!) on the standard output.
using namespace std;
#include <mpi.h>
#include <iostream>
int main (int nargs, char* args[])
{
int numprocs, my_rank;
// MPI initializations
MPI_Init (&nargs, &args);
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank (MPI_COMM_WORLD, &my_rank);
cout << "Hello world, I have rank " << my_rank << " out of "
<< numprocs << endl;
// End MPI
MPI_Finalize ();
9.17.  Note 1¶
The output to screen is not ordered since all processes are trying to write to screen simultaneously.
It is the operating system which opts for an ordering.
If we wish to have an organized output, starting from the first process, we may rewrite our program as in the next example.
9.19. Ordered output with MPIBarrier¶
int main (int nargs, char* args[])
{
int numprocs, my_rank, i;
MPI_Init (&nargs, &args);
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank (MPI_COMM_WORLD, &my_rank);
for (i = 0; i < numprocs; i++) {}
MPI_Barrier (MPI_COMM_WORLD);
if (i == my_rank) {
cout << "Hello world, I have rank " << my_rank <<
" out of " << numprocs << endl;}
MPI_Finalize ();
9.20. Note 2¶
Here we have used the \(MPI\_Barrier\) function to ensure that that every process has completed its set of instructions in a particular order.
A barrier is a special collective operation that does not allow the processes to continue until all processes in the communicator (here \(MPI\_COMM\_WORLD\)) have called \(MPI\_Barrier\).
The barriers make sure that all processes have reached the same point in the code. Many of the collective operations like \(MPI\_ALLREDUCE\) to be discussed later, have the same property; that is, no process can exit the operation until all processes have started.
However, this is slightly more time-consuming since the processes synchronize between themselves as many times as there are processes. In the next Hello world example we use the send and receive functions in order to a have a synchronized action.
9.21. Ordered output¶
.....
int numprocs, my_rank, flag;
MPI_Status status;
MPI_Init (&nargs, &args);
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank (MPI_COMM_WORLD, &my_rank);
if (my_rank > 0)
MPI_Recv (&flag, 1, MPI_INT, my_rank-1, 100,
MPI_COMM_WORLD, &status);
cout << "Hello world, I have rank " << my_rank << " out of "
<< numprocs << endl;
if (my_rank < numprocs-1)
MPI_Send (&my_rank, 1, MPI_INT, my_rank+1,
100, MPI_COMM_WORLD);
MPI_Finalize ();
9.22. Note 3¶
The basic sending of messages is given by the function \(MPI\_SEND\), which in C/C++ is defined as
int MPI_Send(void *buf, int count,
MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm)}
This single command allows the passing of any kind of variable, even a large array, to any group of tasks. The variable buf is the variable we wish to send while count is the number of variables we are passing. If we are passing only a single value, this should be 1.
If we transfer an array, it is the overall size of the array. For example, if we want to send a 10 by 10 array, count would be \(10\times 10=100\) since we are actually passing 100 values.
9.23. Note 4¶
Once you have sent a message, you must receive it on another task. The function \(MPI\_RECV\) is similar to the send call.
int MPI_Recv( void *buf, int count, MPI_Datatype datatype,
int source,
int tag, MPI_Comm comm, MPI_Status *status )
The arguments that are different from those in MPI_SEND are buf which is the name of the variable where you will be storing the received data, source which replaces the destination in the send command. This is the return ID of the sender.
Finally, we have used \(MPI\_Status\_status\),
where one can check if the receive was completed.
The output of this code is the same as the previous example, but now process 0 sends a message to process 1, which forwards it further to process 2, and so forth.
9.24. Numerical integration in parallel¶
Integrating \(\pi\).
The code example computes \(\pi\) using the trapezoidal rules.
The trapezoidal rule
Click on this link for the full program.
9.25. Dissection of trapezoidal rule with \(MPI\_reduce\)¶
// Trapezoidal rule and numerical integration usign MPI
using namespace std;
#include <mpi.h>
#include <iostream>
// Here we define various functions called by the main program
double int_function(double );
double trapezoidal_rule(double , double , int , double (*)(double));
// Main function begins here
int main (int nargs, char* args[])
{
int n, local_n, numprocs, my_rank;
double a, b, h, local_a, local_b, total_sum, local_sum;
double time_start, time_end, total_time;
9.26. Dissection of trapezoidal rule¶
// MPI initializations
MPI_Init (&nargs, &args);
MPI_Comm_size (MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank (MPI_COMM_WORLD, &my_rank);
time_start = MPI_Wtime();
// Fixed values for a, b and n
a = 0.0 ; b = 1.0; n = 1000;
h = (b-a)/n; // h is the same for all processes
local_n = n/numprocs;
// make sure n > numprocs, else integer division gives zero
// Length of each process' interval of
// integration = local_n*h.
local_a = a + my_rank*local_n*h;
local_b = local_a + local_n*h;
9.27. Integrating with MPI¶
total_sum = 0.0;
local_sum = trapezoidal_rule(local_a, local_b, local_n,
&int_function);
MPI_Reduce(&local_sum, &total_sum, 1, MPI_DOUBLE,
MPI_SUM, 0, MPI_COMM_WORLD);
time_end = MPI_Wtime();
total_time = time_end-time_start;
if ( my_rank == 0) {
cout << "Trapezoidal rule = " << total_sum << endl;
cout << "Time = " << total_time
<< " on number of processors: " << numprocs << endl;
}
// End MPI
MPI_Finalize ();
return 0;
} // end of main program
9.28. How do I use \(MPI\_reduce\)?¶
Here we have used
MPI_reduce( void *senddata, void* resultdata, int count,
MPI_Datatype datatype, MPI_Op, int root, MPI_Comm comm)
The two variables \(senddata\) and \(resultdata\) are obvious, besides the fact that one sends the address of the variable or the first element of an array. If they are arrays they need to have the same size. The variable \(count\) represents the total dimensionality, 1 in case of just one variable, while \(MPI\_Datatype\) defines the type of variable which is sent and received.
The new feature is \(MPI\_Op\). It defines the type of operation we want to do.
9.29. More on \(MPI\_Reduce\)¶
In our case, since we are summing the rectangle contributions from every process we define \(MPI\_Op = MPI\_SUM\). If we have an array or matrix we can search for the largest og smallest element by sending either \(MPI\_MAX\) or \(MPI\_MIN\). If we want the location as well (which array element) we simply transfer \(MPI\_MAXLOC\) or \(MPI\_MINOC\). If we want the product we write \(MPI\_PROD\).
\(MPI\_Allreduce\) is defined as
MPI_Allreduce( void *senddata, void* resultdata, int count,
MPI_Datatype datatype, MPI_Op, MPI_Comm comm)
9.30. Dissection of trapezoidal rule¶
We use \(MPI\_reduce\) to collect data from each process. Note also the use of the function \(MPI\_Wtime\).
// this function defines the function to integrate
double int_function(double x)
{
double value = 4./(1.+x*x);
return value;
} // end of function to evaluate
9.31. Dissection of trapezoidal rule¶
// this function defines the trapezoidal rule
double trapezoidal_rule(double a, double b, int n,
double (*func)(double))
{
double trapez_sum;
double fa, fb, x, step;
int j;
step=(b-a)/((double) n);
fa=(*func)(a)/2. ;
fb=(*func)(b)/2. ;
trapez_sum=0.;
for (j=1; j <= n-1; j++){
x=j*step+a;
trapez_sum+=(*func)(x);
}
trapez_sum=(trapez_sum+fb+fa)*step;
return trapez_sum;
} // end trapezoidal_rule
9.32. The quantum dot program for two electrons¶
// Variational Monte Carlo for atoms with importance sampling, slater det
// Test case for 2-electron quantum dot, no classes using Mersenne-Twister RNG
#include "mpi.h"
#include <cmath>
#include <random>
#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "vectormatrixclass.h"
using namespace std;
// output file as global variable
ofstream ofile;
// the step length and its squared inverse for the second derivative
// Here we define global variables used in various functions
// These can be changed by using classes
int Dimension = 2;
int NumberParticles = 2; // we fix also the number of electrons to be 2
// declaration of functions
// The Mc sampling for the variational Monte Carlo
void MonteCarloSampling(int, double &, double &, Vector &);
// The variational wave function
double WaveFunction(Matrix &, Vector &);
// The local energy
double LocalEnergy(Matrix &, Vector &);
// The quantum force
void QuantumForce(Matrix &, Matrix &, Vector &);
// inline function for single-particle wave function
inline double SPwavefunction(double r, double alpha) {
return exp(-alpha*r*0.5);
}
// inline function for derivative of single-particle wave function
inline double DerivativeSPwavefunction(double r, double alpha) {
return -r*alpha;
}
// function for absolute value of relative distance
double RelativeDistance(Matrix &r, int i, int j) {
double r_ij = 0;
for (int k = 0; k < Dimension; k++) {
r_ij += (r(i,k)-r(j,k))*(r(i,k)-r(j,k));
}
return sqrt(r_ij);
}
// inline function for derivative of Jastrow factor
inline double JastrowDerivative(Matrix &r, double beta, int i, int j, int k){
return (r(i,k)-r(j,k))/(RelativeDistance(r, i, j)*pow(1.0+beta*RelativeDistance(r, i, j),2));
}
// function for square of position of single particle
double singleparticle_pos2(Matrix &r, int i) {
double r_single_particle = 0;
for (int j = 0; j < Dimension; j++) {
r_single_particle += r(i,j)*r(i,j);
}
return r_single_particle;
}
void lnsrch(int n, Vector &xold, double fold, Vector &g, Vector &p, Vector &x,
double *f, double stpmax, int *check, double (*func)(Vector &p));
void dfpmin(Vector &p, int n, double gtol, int *iter, double *fret,
double(*func)(Vector &p), void (*dfunc)(Vector &p, Vector &g));
static double sqrarg;
#define SQR(a) ((sqrarg=(a)) == 0.0 ? 0.0 : sqrarg*sqrarg)
static double maxarg1,maxarg2;
#define FMAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
(maxarg1) : (maxarg2))
// Begin of main program
int main(int argc, char* argv[])
{
// MPI initializations
int NumberProcesses, MyRank, NumberMCsamples;
MPI_Init (&argc, &argv);
MPI_Comm_size (MPI_COMM_WORLD, &NumberProcesses);
MPI_Comm_rank (MPI_COMM_WORLD, &MyRank);
double StartTime = MPI_Wtime();
if (MyRank == 0 && argc <= 1) {
cout << "Bad Usage: " << argv[0] <<
" Read also output file on same line and number of Monte Carlo cycles" << endl;
}
// Read filename and number of Monte Carlo cycles from the command line
if (MyRank == 0 && argc > 2) {
string filename = argv[1]; // first command line argument after name of program
NumberMCsamples = atoi(argv[2]);
string fileout = filename;
string argument = to_string(NumberMCsamples);
// Final filename as filename+NumberMCsamples
fileout.append(argument);
ofile.open(fileout);
}
// broadcast the number of Monte Carlo samples
MPI_Bcast (&NumberMCsamples, 1, MPI_INT, 0, MPI_COMM_WORLD);
// Two variational parameters only
Vector VariationalParameters(2);
int TotalNumberMCsamples = NumberMCsamples*NumberProcesses;
// Loop over variational parameters
for (double alpha = 0.5; alpha <= 1.5; alpha +=0.1){
for (double beta = 0.1; beta <= 0.5; beta +=0.05){
VariationalParameters(0) = alpha; // value of alpha
VariationalParameters(1) = beta; // value of beta
// Do the mc sampling and accumulate data with MPI_Reduce
double TotalEnergy, TotalEnergySquared, LocalProcessEnergy, LocalProcessEnergy2;
LocalProcessEnergy = LocalProcessEnergy2 = 0.0;
MonteCarloSampling(NumberMCsamples, LocalProcessEnergy, LocalProcessEnergy2, VariationalParameters);
// Collect data in total averages
MPI_Reduce(&LocalProcessEnergy, &TotalEnergy, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(&LocalProcessEnergy2, &TotalEnergySquared, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
// Print out results in case of Master node, set to MyRank = 0
if ( MyRank == 0) {
double Energy = TotalEnergy/( (double)NumberProcesses);
double Variance = TotalEnergySquared/( (double)NumberProcesses)-Energy*Energy;
double StandardDeviation = sqrt(Variance/((double)TotalNumberMCsamples)); // over optimistic error
ofile << setiosflags(ios::showpoint | ios::uppercase);
ofile << setw(15) << setprecision(8) << VariationalParameters(0);
ofile << setw(15) << setprecision(8) << VariationalParameters(1);
ofile << setw(15) << setprecision(8) << Energy;
ofile << setw(15) << setprecision(8) << Variance;
ofile << setw(15) << setprecision(8) << StandardDeviation << endl;
}
}
}
double EndTime = MPI_Wtime();
double TotalTime = EndTime-StartTime;
if ( MyRank == 0 ) cout << "Time = " << TotalTime << " on number of processors: " << NumberProcesses << endl;
if (MyRank == 0) ofile.close(); // close output file
// End MPI
MPI_Finalize ();
return 0;
} // end of main function
// Monte Carlo sampling with the Metropolis algorithm
void MonteCarloSampling(int NumberMCsamples, double &cumulative_e, double &cumulative_e2, Vector &VariationalParameters)
{
// Initialize the seed and call the Mersienne algo
std::random_device rd;
std::mt19937_64 gen(rd());
// Set up the uniform distribution for x \in [[0, 1]
std::uniform_real_distribution<double> UniformNumberGenerator(0.0,1.0);
std::normal_distribution<double> Normaldistribution(0.0,1.0);
// diffusion constant from Schroedinger equation
double D = 0.5;
double timestep = 0.05; // we fix the time step for the gaussian deviate
// allocate matrices which contain the position of the particles
Matrix OldPosition( NumberParticles, Dimension), NewPosition( NumberParticles, Dimension);
Matrix OldQuantumForce(NumberParticles, Dimension), NewQuantumForce(NumberParticles, Dimension);
double Energy = 0.0; double EnergySquared = 0.0; double DeltaE = 0.0;
// initial trial positions
for (int i = 0; i < NumberParticles; i++) {
for (int j = 0; j < Dimension; j++) {
OldPosition(i,j) = Normaldistribution(gen)*sqrt(timestep);
}
}
double OldWaveFunction = WaveFunction(OldPosition, VariationalParameters);
QuantumForce(OldPosition, OldQuantumForce, VariationalParameters);
// loop over monte carlo cycles
for (int cycles = 1; cycles <= NumberMCsamples; cycles++){
// new position
for (int i = 0; i < NumberParticles; i++) {
for (int j = 0; j < Dimension; j++) {
// gaussian deviate to compute new positions using a given timestep
NewPosition(i,j) = OldPosition(i,j) + Normaldistribution(gen)*sqrt(timestep)+OldQuantumForce(i,j)*timestep*D;
// NewPosition(i,j) = OldPosition(i,j) + gaussian_deviate(&idum)*sqrt(timestep)+OldQuantumForce(i,j)*timestep*D;
}
// for the other particles we need to set the position to the old position since
// we move only one particle at the time
for (int k = 0; k < NumberParticles; k++) {
if ( k != i) {
for (int j = 0; j < Dimension; j++) {
NewPosition(k,j) = OldPosition(k,j);
}
}
}
double NewWaveFunction = WaveFunction(NewPosition, VariationalParameters);
QuantumForce(NewPosition, NewQuantumForce, VariationalParameters);
// we compute the log of the ratio of the greens functions to be used in the
// Metropolis-Hastings algorithm
double GreensFunction = 0.0;
for (int j = 0; j < Dimension; j++) {
GreensFunction += 0.5*(OldQuantumForce(i,j)+NewQuantumForce(i,j))*
(D*timestep*0.5*(OldQuantumForce(i,j)-NewQuantumForce(i,j))-NewPosition(i,j)+OldPosition(i,j));
}
GreensFunction = exp(GreensFunction);
// The Metropolis test is performed by moving one particle at the time
if(UniformNumberGenerator(gen) <= GreensFunction*NewWaveFunction*NewWaveFunction/OldWaveFunction/OldWaveFunction ) {
for (int j = 0; j < Dimension; j++) {
OldPosition(i,j) = NewPosition(i,j);
OldQuantumForce(i,j) = NewQuantumForce(i,j);
}
OldWaveFunction = NewWaveFunction;
}
} // end of loop over particles
// compute local energy
double DeltaE = LocalEnergy(OldPosition, VariationalParameters);
// update energies
Energy += DeltaE;
EnergySquared += DeltaE*DeltaE;
} // end of loop over MC trials
// update the energy average and its squared
cumulative_e = Energy/NumberMCsamples;
cumulative_e2 = EnergySquared/NumberMCsamples;
} // end MonteCarloSampling function
// Function to compute the squared wave function and the quantum force
double WaveFunction(Matrix &r, Vector &VariationalParameters)
{
double wf = 0.0;
// full Slater determinant for two particles, replace with Slater det for more particles
wf = SPwavefunction(singleparticle_pos2(r, 0), VariationalParameters(0))*SPwavefunction(singleparticle_pos2(r, 1),VariationalParameters(0));
// contribution from Jastrow factor
for (int i = 0; i < NumberParticles-1; i++) {
for (int j = i+1; j < NumberParticles; j++) {
wf *= exp(RelativeDistance(r, i, j)/((1.0+VariationalParameters(1)*RelativeDistance(r, i, j))));
}
}
return wf;
}
// Function to calculate the local energy without numerical derivation of kinetic energy
double LocalEnergy(Matrix &r, Vector &VariationalParameters)
{
// compute the kinetic and potential energy from the single-particle part
// for a many-electron system this has to be replaced by a Slater determinant
// The absolute value of the interparticle length
Matrix length( NumberParticles, NumberParticles);
// Set up interparticle distance
for (int i = 0; i < NumberParticles-1; i++) {
for(int j = i+1; j < NumberParticles; j++){
length(i,j) = RelativeDistance(r, i, j);
length(j,i) = length(i,j);
}
}
double KineticEnergy = 0.0;
// Set up kinetic energy from Slater and Jastrow terms
for (int i = 0; i < NumberParticles; i++) {
for (int k = 0; k < Dimension; k++) {
double sum1 = 0.0;
for(int j = 0; j < NumberParticles; j++){
if ( j != i) {
sum1 += JastrowDerivative(r, VariationalParameters(1), i, j, k);
}
}
KineticEnergy += (sum1+DerivativeSPwavefunction(r(i,k),VariationalParameters(0)))*(sum1+DerivativeSPwavefunction(r(i,k),VariationalParameters(0)));
}
}
KineticEnergy += -2*VariationalParameters(0)*NumberParticles;
for (int i = 0; i < NumberParticles-1; i++) {
for (int j = i+1; j < NumberParticles; j++) {
KineticEnergy += 2.0/(pow(1.0 + VariationalParameters(1)*length(i,j),2))*(1.0/length(i,j)-2*VariationalParameters(1)/(1+VariationalParameters(1)*length(i,j)) );
}
}
KineticEnergy *= -0.5;
// Set up potential energy, external potential + eventual electron-electron repulsion
double PotentialEnergy = 0;
for (int i = 0; i < NumberParticles; i++) {
double DistanceSquared = singleparticle_pos2(r, i);
PotentialEnergy += 0.5*DistanceSquared; // sp energy HO part, note it has the oscillator frequency set to 1!
}
// Add the electron-electron repulsion
for (int i = 0; i < NumberParticles-1; i++) {
for (int j = i+1; j < NumberParticles; j++) {
PotentialEnergy += 1.0/length(i,j);
}
}
double LocalE = KineticEnergy+PotentialEnergy;
return LocalE;
}
// Compute the analytical expression for the quantum force
void QuantumForce(Matrix &r, Matrix &qforce, Vector &VariationalParameters)
{
// compute the first derivative
for (int i = 0; i < NumberParticles; i++) {
for (int k = 0; k < Dimension; k++) {
// single-particle part, replace with Slater det for larger systems
double sppart = DerivativeSPwavefunction(r(i,k),VariationalParameters(0));
// Jastrow factor contribution
double Jsum = 0.0;
for (int j = 0; j < NumberParticles; j++) {
if ( j != i) {
Jsum += JastrowDerivative(r, VariationalParameters(1), i, j, k);
}
}
qforce(i,k) = 2.0*(Jsum+sppart);
}
}
} // end of QuantumForce function
#define ITMAX 200
#define EPS 3.0e-8
#define TOLX (4*EPS)
#define STPMX 100.0
void dfpmin(Vector &p, int n, double gtol, int *iter, double *fret,
double(*func)(Vector &p), void (*dfunc)(Vector &p, Vector &g))
{
int check,i,its,j;
double den,fac,fad,fae,fp,stpmax,sum=0.0,sumdg,sumxi,temp,test;
Vector dg(n), g(n), hdg(n), pnew(n), xi(n);
Matrix hessian(n,n);
fp=(*func)(p);
(*dfunc)(p,g);
for (i = 0;i < n;i++) {
for (j = 0; j< n;j++) hessian(i,j)=0.0;
hessian(i,i)=1.0;
xi(i) = -g(i);
sum += p(i)*p(i);
}
stpmax=STPMX*FMAX(sqrt(sum),(double)n);
for (its=1;its<=ITMAX;its++) {
*iter=its;
lnsrch(n,p,fp,g,xi,pnew,fret,stpmax,&check,func);
fp = *fret;
for (i = 0; i< n;i++) {
xi(i)=pnew(i)-p(i);
p(i)=pnew(i);
}
test=0.0;
for (i = 0;i< n;i++) {
temp=fabs(xi(i))/FMAX(fabs(p(i)),1.0);
if (temp > test) test=temp;
}
if (test < TOLX) {
return;
}
for (i=0;i<n;i++) dg(i)=g(i);
(*dfunc)(p,g);
test=0.0;
den=FMAX(*fret,1.0);
for (i=0;i<n;i++) {
temp=fabs(g(i))*FMAX(fabs(p(i)),1.0)/den;
if (temp > test) test=temp;
}
if (test < gtol) {
return;
}
for (i=0;i<n;i++) dg(i)=g(i)-dg(i);
for (i=0;i<n;i++) {
hdg(i)=0.0;
for (j=0;j<n;j++) hdg(i) += hessian(i,j)*dg(j);
}
fac=fae=sumdg=sumxi=0.0;
for (i=0;i<n;i++) {
fac += dg(i)*xi(i);
fae += dg(i)*hdg(i);
sumdg += SQR(dg(i));
sumxi += SQR(xi(i));
}
if (fac*fac > EPS*sumdg*sumxi) {
fac=1.0/fac;
fad=1.0/fae;
for (i=0;i<n;i++) dg(i)=fac*xi(i)-fad*hdg(i);
for (i=0;i<n;i++) {
for (j=0;j<n;j++) {
hessian(i,j) += fac*xi(i)*xi(j)
-fad*hdg(i)*hdg(j)+fae*dg(i)*dg(j);
}
}
}
for (i=0;i<n;i++) {
xi(i)=0.0;
for (j=0;j<n;j++) xi(i) -= hessian(i,j)*g(j);
}
}
cout << "too many iterations in dfpmin" << endl;
}
#undef ITMAX
#undef EPS
#undef TOLX
#undef STPMX
#define ALF 1.0e-4
#define TOLX 1.0e-7
void lnsrch(int n, Vector &xold, double fold, Vector &g, Vector &p, Vector &x,
double *f, double stpmax, int *check, double (*func)(Vector &p))
{
int i;
double a,alam,alam2,alamin,b,disc,f2,fold2,rhs1,rhs2,slope,sum,temp,
test,tmplam;
*check=0;
for (sum=0.0,i=0;i<n;i++) sum += p(i)*p(i);
sum=sqrt(sum);
if (sum > stpmax)
for (i=0;i<n;i++) p(i) *= stpmax/sum;
for (slope=0.0,i=0;i<n;i++)
slope += g(i)*p(i);
test=0.0;
for (i=0;i<n;i++) {
temp=fabs(p(i))/FMAX(fabs(xold(i)),1.0);
if (temp > test) test=temp;
}
alamin=TOLX/test;
alam=1.0;
for (;;) {
for (i=0;i<n;i++) x(i)=xold(i)+alam*p(i);
*f=(*func)(x);
if (alam < alamin) {
for (i=0;i<n;i++) x(i)=xold(i);
*check=1;
return;
} else if (*f <= fold+ALF*alam*slope) return;
else {
if (alam == 1.0)
tmplam = -slope/(2.0*(*f-fold-slope));
else {
rhs1 = *f-fold-alam*slope;
rhs2=f2-fold2-alam2*slope;
a=(rhs1/(alam*alam)-rhs2/(alam2*alam2))/(alam-alam2);
b=(-alam2*rhs1/(alam*alam)+alam*rhs2/(alam2*alam2))/(alam-alam2);
if (a == 0.0) tmplam = -slope/(2.0*b);
else {
disc=b*b-3.0*a*slope;
if (disc<0.0) cout << "Roundoff problem in lnsrch." << endl;
else tmplam=(-b+sqrt(disc))/(3.0*a);
}
if (tmplam>0.5*alam)
tmplam=0.5*alam;
}
}
alam2=alam;
f2 = *f;
fold2=fold;
alam=FMAX(tmplam,0.1*alam);
}
}
#undef ALF
#undef TOLX
9.33. What is OpenMP¶
OpenMP provides high-level thread programming
Multiple cooperating threads are allowed to run simultaneously
Threads are created and destroyed dynamically in a fork-join pattern
An OpenMP program consists of a number of parallel regions
Between two parallel regions there is only one master thread
In the beginning of a parallel region, a team of new threads is spawned
The newly spawned threads work simultaneously with the master thread
At the end of a parallel region, the new threads are destroyed
Many good tutorials online and excellent textbook
Many tutorials online like OpenMP official site
9.34. Getting started, things to remember¶
Remember the header file
#include <omp.h>
Insert compiler directives in C++ syntax as
#pragma omp...
Compile with for example c++ -fopenmp code.cpp
Execute
Remember to assign the environment variable OMP NUM THREADS
It specifies the total number of threads inside a parallel region, if not otherwise overwritten
9.35. OpenMP syntax¶
Mostly directives
#pragma omp construct [ clause ...]
Some functions and types
#include <omp.h>
Most apply to a block of code
Specifically, a structured block
Enter at top, exit at bottom only, exit(), abort() permitted
9.36. Different OpenMP styles of parallelism¶
OpenMP supports several different ways to specify thread parallelism
General parallel regions: All threads execute the code, roughly as if you made a routine of that region and created a thread to run that code
Parallel loops: Special case for loops, simplifies data parallel code
Task parallelism, new in OpenMP 3
Several ways to manage thread coordination, including Master regions and Locks
Memory model for shared data
9.37. General code structure¶
#include <omp.h>
main ()
{
int var1, var2, var3;
/* serial code */
/* ... */
/* start of a parallel region */
#pragma omp parallel private(var1, var2) shared(var3)
{
/* ... */
}
/* more serial code */
/* ... */
/* another parallel region */
#pragma omp parallel
{
/* ... */
}
}
9.38. Parallel region¶
A parallel region is a block of code that is executed by a team of threads
The following compiler directive creates a parallel region
#pragma omp parallel { ... }
Clauses can be added at the end of the directive
Most often used clauses:
default(shared) or default(none)
public(list of variables)
private(list of variables)
9.39. Hello world, not again, please!¶
#include <omp.h>
#include <cstdio>
int main (int argc, char *argv[])
{
int th_id, nthreads;
#pragma omp parallel private(th_id) shared(nthreads)
{
th_id = omp_get_thread_num();
printf("Hello World from thread %d\n", th_id);
#pragma omp barrier
if ( th_id == 0 ) {
nthreads = omp_get_num_threads();
printf("There are %d threads\n",nthreads);
}
}
return 0;
}
9.40. Hello world, yet another variant¶
#include <cstdio>
#include <omp.h>
int main(int argc, char *argv[])
{
omp_set_num_threads(4);
#pragma omp parallel
{
int id = omp_get_thread_num();
int nproc = omp_get_num_threads();
cout << "Hello world with id number and processes " << id << nproc << endl;
}
return 0;
}
Variables declared outside of the parallel region are shared by all threads If a variable like id is declared outside of the
#pragma omp parallel,
it would have been shared by various the threads, possibly causing erroneous output
Why? What would go wrong? Why do we add possibly?
9.41. Important OpenMP library routines¶
int omp get num threads (), returns the number of threads inside a parallel region
int omp get thread num (), returns the a thread for each thread inside a parallel region
void omp set num threads (int), sets the number of threads to be used
void omp set nested (int), turns nested parallelism on/off
9.42. Private variables¶
Private clause can be used to make thread- private versions of such variables:
#pragma omp parallel private(id)
{
int id = omp_get_thread_num();
cout << "My thread num" << id << endl;
}
What is their value on entry? Exit?
OpenMP provides ways to control that
Can use default(none) to require the sharing of each variable to be described
9.43. Master region¶
It is often useful to have only one thread execute some of the code in a parallel region. I/O statements are a common example
#pragma omp parallel
{
#pragma omp master
{
int id = omp_get_thread_num();
cout << "My thread num" << id << endl;
}
}
9.44. Parallel for loop¶
Inside a parallel region, the following compiler directive can be used to parallelize a for-loop:
#pragma omp for
Clauses can be added, such as
schedule(static, chunk size)
schedule(dynamic, chunk size)
schedule(guided, chunk size) (non-deterministic allocation)
schedule(runtime)
private(list of variables)
reduction(operator:variable)
nowait
9.45. Parallel computations and loops¶
OpenMP provides an easy way to parallelize a loop
#pragma omp parallel for
for (i=0; i<n; i++) c[i] = a[i];
OpenMP handles index variable (no need to declare in for loop or make private)
Which thread does which values? Several options.
9.46. Scheduling of loop computations¶
We can let the OpenMP runtime decide. The decision is about how the loop iterates are scheduled and OpenMP defines three choices of loop scheduling:
Static: Predefined at compile time. Lowest overhead, predictable
Dynamic: Selection made at runtime
Guided: Special case of dynamic; attempts to reduce overhead
9.47. Example code for loop scheduling¶
#include <omp.h>
#define CHUNKSIZE 100
#define N 1000
int main (int argc, char *argv[])
{
int i, chunk;
float a[N], b[N], c[N];
for (i=0; i < N; i++) a[i] = b[i] = i * 1.0;
chunk = CHUNKSIZE;
#pragma omp parallel shared(a,b,c,chunk) private(i)
{
#pragma omp for schedule(dynamic,chunk)
for (i=0; i < N; i++) c[i] = a[i] + b[i];
} /* end of parallel region */
}
9.48. Example code for loop scheduling, guided instead of dynamic¶
#include <omp.h>
#define CHUNKSIZE 100
#define N 1000
int main (int argc, char *argv[])
{
int i, chunk;
float a[N], b[N], c[N];
for (i=0; i < N; i++) a[i] = b[i] = i * 1.0;
chunk = CHUNKSIZE;
#pragma omp parallel shared(a,b,c,chunk) private(i)
{
#pragma omp for schedule(guided,chunk)
for (i=0; i < N; i++) c[i] = a[i] + b[i];
} /* end of parallel region */
}
9.49. More on Parallel for loop¶
The number of loop iterations cannot be non-deterministic; break, return, exit, goto not allowed inside the for-loop
The loop index is private to each thread
A reduction variable is special
During the for-loop there is a local private copy in each thread
At the end of the for-loop, all the local copies are combined together by the reduction operation
Unless the nowait clause is used, an implicit barrier synchronization will be added at the end by the compiler
// #pragma omp parallel and #pragma omp for
can be combined into
#pragma omp parallel for
9.50. What can happen with this loop?¶
What happens with code like this
#pragma omp parallel for
for (i=0; i<n; i++) sum += a[i]*a[i];
All threads can access the sum variable, but the addition is not atomic! It is important to avoid race between threads. So-called reductions in OpenMP are thus important for performance and for obtaining correct results. OpenMP lets us indicate that a variable is used for a reduction with a particular operator. The above code becomes
sum = 0.0;
#pragma omp parallel for reduction(+:sum)
for (i=0; i<n; i++) sum += a[i]*a[i];
9.51. Inner product¶
1
< < < ! ! M A T H _ B L O C K
int i;
double sum = 0.;
/* allocating and initializing arrays */
/* ... */
#pragma omp parallel for default(shared) private(i) reduction(+:sum)
for (i=0; i<N; i++) sum += a[i]*b[i];
}
9.52. Different threads do different tasks¶
Different threads do different tasks independently, each section is executed by one thread.
#pragma omp parallel
{
#pragma omp sections
{
#pragma omp section
funcA ();
#pragma omp section
funcB ();
#pragma omp section
funcC ();
}
}
9.53. Single execution¶
#pragma omp single { ... }
The code is executed by one thread only, no guarantee which thread
Can introduce an implicit barrier at the end
#pragma omp master { ... }
Code executed by the master thread, guaranteed and no implicit barrier at the end.
9.54. Coordination and synchronization¶
#pragma omp barrier
Synchronization, must be encountered by all threads in a team (or none)
#pragma omp ordered { a block of codes }
is another form of synchronization (in sequential order). The form
#pragma omp critical { a block of codes }
and
#pragma omp atomic { single assignment statement }
is more efficient than
#pragma omp critical
9.55. Data scope¶
OpenMP data scope attribute clauses:
shared
private
firstprivate
lastprivate
reduction
What are the purposes of these attributes
define how and which variables are transferred to a parallel region (and back)
define which variables are visible to all threads in a parallel region, and which variables are privately allocated to each thread
9.56. Some remarks¶
When entering a parallel region, the private clause ensures each thread having its own new variable instances. The new variables are assumed to be uninitialized.
A shared variable exists in only one memory location and all threads can read and write to that address. It is the programmer’s responsibility to ensure that multiple threads properly access a shared variable.
The firstprivate clause combines the behavior of the private clause with automatic initialization.
The lastprivate clause combines the behavior of the private clause with a copy back (from the last loop iteration or section) to the original variable outside the parallel region.
9.57. Parallelizing nested for-loops¶
Serial code
for (i=0; i<100; i++)
for (j=0; j<100; j++)
a[i][j] = b[i][j] + c[i][j];
}
}
Parallelization
#pragma omp parallel for private(j)
for (i=0; i<100; i++)
for (j=0; j<100; j++)
a[i][j] = b[i][j] + c[i][j];
}
}
Why not parallelize the inner loop? to save overhead of repeated thread forks-joins
Why must j be private? To avoid race condition among the threads
9.58. Nested parallelism¶
When a thread in a parallel region encounters another parallel construct, it may create a new team of threads and become the master of the new team.
#pragma omp parallel num_threads(4)
{
/* .... */
#pragma omp parallel num_threads(2)
{
//
}
}
9.59. Parallel tasks¶
#pragma omp task
#pragma omp parallel shared(p_vec) private(i)
{
#pragma omp single
{
for (i=0; i<N; i++) {
double r = random_number();
if (p_vec[i] > r) {
#pragma omp task
do_work (p_vec[i]);
9.60. Common mistakes¶
Race condition
int nthreads;
#pragma omp parallel shared(nthreads)
{
nthreads = omp_get_num_threads();
}
Deadlock
#pragma omp parallel
{
...
#pragma omp critical
{
...
#pragma omp barrier
}
}
9.61. Not all computations are simple¶
Not all computations are simple loops where the data can be evenly divided among threads without any dependencies between threads
An example is finding the location and value of the largest element in an array
for (i=0; i<n; i++) {
if (x[i] > maxval) {
maxval = x[i];
maxloc = i;
}
}
9.62. Not all computations are simple, competing threads¶
All threads are potentially accessing and changing the same values, maxloc and maxval.
OpenMP provides several ways to coordinate access to shared values
#pragma omp atomic
Only one thread at a time can execute the following statement (not block). We can use the critical option
#pragma omp critical
Only one thread at a time can execute the following block
Atomic may be faster than critical but depends on hardware
9.63. How to find the max value using OpenMP¶
Write down the simplest algorithm and look carefully for race conditions. How would you handle them? The first step would be to parallelize as
#pragma omp parallel for
for (i=0; i<n; i++) {
if (x[i] > maxval) {
maxval = x[i];
maxloc = i;
}
}
9.64. Then deal with the race conditions¶
Write down the simplest algorithm and look carefully for race conditions. How would you handle them? The first step would be to parallelize as
#pragma omp parallel for
for (i=0; i<n; i++) {
#pragma omp critical
{
if (x[i] > maxval) {
maxval = x[i];
maxloc = i;
}
}
}
Exercise: write a code which implements this and give an estimate on performance. Perform several runs, with a serial code only with and without vectorization and compare the serial code with the one that uses OpenMP. Run on different archictectures if you can.
9.65. What can slow down OpenMP performance?¶
Give it a thought!
9.66. What can slow down OpenMP performance?¶
Performance poor because we insisted on keeping track of the maxval and location during the execution of the loop.
We do not care about the value during the execution of the loop, just the value at the end.
This is a common source of performance issues, namely the description of the method used to compute a value imposes additional, unnecessary requirements or properties
Idea: Have each thread find the maxloc in its own data, then combine and use temporary arrays indexed by thread number to hold the values found by each thread
9.67. Find the max location for each thread¶
int maxloc[MAX_THREADS], mloc;
double maxval[MAX_THREADS], mval;
#pragma omp parallel shared(maxval,maxloc)
{
int id = omp_get_thread_num();
maxval[id] = -1.0e30;
#pragma omp for
for (int i=0; i<n; i++) {
if (x[i] > maxval[id]) {
maxloc[id] = i;
maxval[id] = x[i];
}
}
}
9.68. Combine the values from each thread¶
#pragma omp flush (maxloc,maxval)
#pragma omp master
{
int nt = omp_get_num_threads();
mloc = maxloc[0];
mval = maxval[0];
for (int i=1; i<nt; i++) {
if (maxval[i] > mval) {
mval = maxval[i];
mloc = maxloc[i];
}
}
}
Note that we let the master process perform the last operation.
9.69. Matrix-matrix multiplication¶
This code computes the norm of a vector using OpenMp
// OpenMP program to compute vector norm by adding two other vectors
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <omp.h>
# include <ctime>
using namespace std; // note use of namespace
int main (int argc, char* argv[])
{
// read in dimension of vector
int n = atoi(argv[1]);
double *a, *b, *c;
int i;
int thread_num;
double wtime, Norm2, s, angle;
cout << " Perform addition of two vectors and compute the norm-2." << endl;
omp_set_num_threads(4);
thread_num = omp_get_max_threads ();
cout << " The number of processors available = " << omp_get_num_procs () << endl ;
cout << " The number of threads available = " << thread_num << endl;
cout << " The matrix order n = " << n << endl;
s = 1.0/sqrt( (double) n);
wtime = omp_get_wtime ( );
// Allocate space for the vectors to be used
a = new double [n]; b = new double [n]; c = new double [n];
// Define parallel region
# pragma omp parallel for default(shared) private (angle, i) reduction(+:Norm2)
// Set up values for vectors a and b
for (i = 0; i < n; i++){
angle = 2.0*M_PI*i/ (( double ) n);
a[i] = s*(sin(angle) + cos(angle));
b[i] = s*sin(2.0*angle);
c[i] = 0.0;
}
// Then perform the vector addition
for (i = 0; i < n; i++){
c[i] += a[i]+b[i];
}
// Compute now the norm-2
Norm2 = 0.0;
for (i = 0; i < n; i++){
Norm2 += c[i]*c[i];
}
// end parallel region
wtime = omp_get_wtime ( ) - wtime;
cout << setiosflags(ios::showpoint | ios::uppercase);
cout << setprecision(10) << setw(20) << "Time used for norm-2 computation=" << wtime << endl;
cout << " Norm-2 = " << Norm2 << endl;
// Free up space
delete[] a;
delete[] b;
delete[] c;
return 0;
}
9.70. Matrix-matrix multiplication¶
This the matrix-matrix multiplication code with plain c++ memory allocation using OpenMP
// Matrix-matrix multiplication and Frobenius norm of a matrix with OpenMP
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <omp.h>
# include <ctime>
using namespace std; // note use of namespace
int main (int argc, char* argv[])
{
// read in dimension of square matrix
int n = atoi(argv[1]);
double **A, **B, **C;
int i, j, k;
int thread_num;
double wtime, Fsum, s, angle;
cout << " Compute matrix product C = A * B and Frobenius norm." << endl;
omp_set_num_threads(4);
thread_num = omp_get_max_threads ();
cout << " The number of processors available = " << omp_get_num_procs () << endl ;
cout << " The number of threads available = " << thread_num << endl;
cout << " The matrix order n = " << n << endl;
s = 1.0/sqrt( (double) n);
wtime = omp_get_wtime ( );
// Allocate space for the two matrices
A = new double*[n]; B = new double*[n]; C = new double*[n];
for (i = 0; i < n; i++){
A[i] = new double[n];
B[i] = new double[n];
C[i] = new double[n];
}
// Define parallel region
# pragma omp parallel for default(shared) private (angle, i, j, k) reduction(+:Fsum)
// Set up values for matrix A and B and zero matrix C
for (i = 0; i < n; i++){
for (j = 0; j < n; j++) {
angle = 2.0*M_PI*i*j/ (( double ) n);
A[i][j] = s * ( sin ( angle ) + cos ( angle ) );
B[j][i] = A[i][j];
}
}
// Then perform the matrix-matrix multiplication
for (i = 0; i < n; i++){
for (j = 0; j < n; j++) {
C[i][j] = 0.0;
for (k = 0; k < n; k++) {
C[i][j] += A[i][k]*B[k][j];
}
}
}
// Compute now the Frobenius norm
Fsum = 0.0;
for (i = 0; i < n; i++){
for (j = 0; j < n; j++) {
Fsum += C[i][j]*C[i][j];
}
}
Fsum = sqrt(Fsum);
// end parallel region and letting only one thread perform I/O
wtime = omp_get_wtime ( ) - wtime;
cout << setiosflags(ios::showpoint | ios::uppercase);
cout << setprecision(10) << setw(20) << "Time used for matrix-matrix multiplication=" << wtime << endl;
cout << " Frobenius norm = " << Fsum << endl;
// Free up space
for (int i = 0; i < n; i++){
delete[] A[i];
delete[] B[i];
delete[] C[i];
}
delete[] A;
delete[] B;
delete[] C;
return 0;
}


Monsanto admits to illegal use of pesticides on Maui | Honolulu Star-Advertiser
Monsanto Co. has agreed to plead guilty to using a banned pesticide on corn seed and research crops at its Valley Farm facility in Kihei, Maui. Read more
Mahalo for reading the Honolulu Star-Advertiser!
You're reading a premium story. Read the full story with our Print & Digital Subscription.
Already a subscriber? Log in now to continue reading this story.
Print subscriber but without online access? Activate your Digital Account now.


{% extends 'base.html' %} {% load crispy_forms_tags %} {% load static %} {% block content %}
{{post.description}}
BY: {{ user.username }}
| Username | Design | Usability | Creativity | Content | Overall Score |
|---|---|---|---|---|---|
| {{rating.user.username}} | {{rating.design}} | {{rating.usability}} | {{rating.creativity}} | {{rating.content}} | {{rating.overall_score}} |


Dec claims Ian Wright is sure to 'crack' on I'm A Celebrity within hours
The former England and Arsenal footballer won't take well to having to go without food as the stars are already concerned about the lack of meals served up at Snake Rock
by Irishmirror.ieHe quickly predicted Ian Wright could be this year's most bad tempered I'm A Celebrity camp-mate.
Now Declan Donnelly thinks we could be just hours away from Ian Wright losing his cool.
The 44-year-old said after the opening show that "he might blow, he might just go" as soon as Ian gets hungry.
Now after chatting on Extra Camp, Dec thinks we're already nearing the former footballer's breaking point.
"I feel sorry for him as we're all waiting for it to happen," teased Emily Atack.
Dec replied: "It's the food situation that is going to get him I think.
"So let's see how they do in the trial, I think it could be a really fun trial actually.
"But I think he might just crack today."
The co-hosts then broke into a chorus of 'he's gonna snap, he's gonna snap!'
The with the 2018 contestant yards away, the Geordie joked: "We were all sat here saying the same thing about John Barrowman last year!"
Dec said on Sunday that's the ex-Arsenal player is one to keep an eye out for.
"I think there could be one or two spiky characters," he said.
"If he gets hungry..... He's also got quite a short attention span."
Do you have a story to sell? Get in touch with us at<EMAIL_ADDRESS>or call us direct 0207 29 33033


- ACL - Class in com.sun.mail.imap
-
An access control list entry for a particular authentication identifier
(user or group).
- ACL(String) - Constructor for class com.sun.mail.imap.ACL
-
Construct an ACL entry for the given identifier and with no rights.
- ACL(String, Rights) - Constructor for class com.sun.mail.imap.ACL
-
Construct an ACL entry for the given identifier with the given rights.
- add(Rights.Right) - Method in class com.sun.mail.imap.Rights
-
Add the specified right to this Rights object.
- add(Rights) - Method in class com.sun.mail.imap.Rights
-
Add all the rights in the given Rights object to this
Rights object.
- add(FetchProfile.Item) - Method in class javax.mail.FetchProfile
-
Add the given special item as one of the attributes to
be prefetched.
- add(String) - Method in class javax.mail.FetchProfile
-
Add the specified header-field to the list of attributes
to be prefetched.
- add(Flags.Flag) - Method in class javax.mail.Flags
-
Add the specified system flag to this Flags object.
- add(String) - Method in class javax.mail.Flags
-
Add the specified user flag to this Flags object.
- add(Flags) - Method in class javax.mail.Flags
-
Add all the flags in the given Flags object to this
Flags object.
- addACL(ACL) - Method in class com.sun.mail.imap.IMAPFolder
-
Add an access control list entry to the access control list
for this folder.
- addBodyPart(BodyPart) - Method in class com.sun.mail.dsn.MultipartReport
-
Adds a Part to the multipart.
- addBodyPart(BodyPart, int) - Method in class com.sun.mail.dsn.MultipartReport
-
Adds a BodyPart at position index
.
- addBodyPart(BodyPart) - Method in class javax.mail.internet.MimeMultipart
-
Adds a Part to the multipart.
- addBodyPart(BodyPart, int) - Method in class javax.mail.internet.MimeMultipart
-
Adds a BodyPart at position index
.
- addBodyPart(BodyPart) - Method in class javax.mail.Multipart
-
Adds a Part to the multipart.
- addBodyPart(BodyPart, int) - Method in class javax.mail.Multipart
-
Adds a BodyPart at position index
.
- addConnectionListener(ConnectionListener) - Method in class javax.mail.Folder
-
Add a listener for Connection events on this Folder.
- addConnectionListener(ConnectionListener) - Method in class javax.mail.Service
-
Add a listener for Connection events on this service.
- ADDED - Static variable in class javax.mail.event.MessageCountEvent
-
The messages were added to their folder
- addFolderListener(FolderListener) - Method in class javax.mail.Folder
-
Add a listener for Folder events on this Folder.
- addFolderListener(FolderListener) - Method in class javax.mail.Store
-
Add a listener for Folder events on any Folder object
obtained from this Store.
- addFrom(Address[]) - Method in class com.sun.mail.imap.IMAPMessage
-
- addFrom(Address[]) - Method in class javax.mail.internet.MimeMessage
-
Add the specified addresses to the existing "From" field.
- addFrom(Address[]) - Method in class javax.mail.Message
-
Add these addresses to the existing "From" attribute
- addHeader(String, String) - Method in class com.sun.mail.imap.IMAPMessage
-
- addHeader(String, String) - Method in class com.sun.mail.pop3.POP3Message
-
Add this value to the existing values for this header_name.
- addHeader(String, String) - Method in class javax.mail.internet.InternetHeaders
-
Add a header with the specified name and value to the header list.
- addHeader(String, String) - Method in class javax.mail.internet.MimeBodyPart
-
Add this value to the existing values for this header_name.
- addHeader(String, String) - Method in class javax.mail.internet.MimeMessage
-
Add this value to the existing values for this header_name.
- addHeader(String, String) - Method in interface javax.mail.Part
-
Add this value to the existing values for this header_name.
- addHeaderLine(String) - Method in class com.sun.mail.imap.IMAPMessage
-
- addHeaderLine(String) - Method in class com.sun.mail.pop3.POP3Message
-
Add a raw RFC822 header-line.
- addHeaderLine(String) - Method in class javax.mail.internet.InternetHeaders
-
Add an RFC822 header line to the header store.
- addHeaderLine(String) - Method in class javax.mail.internet.MimeBodyPart
-
Add a header line to this body part
- addHeaderLine(String) - Method in class javax.mail.internet.MimeMessage
-
Add a raw RFC 822 header-line.
- addHeaderLine(String) - Method in interface javax.mail.internet.MimePart
-
Add a raw RFC822 header-line.
- addMessageChangedListener(MessageChangedListener) - Method in class javax.mail.Folder
-
Add a listener for MessageChanged events on this Folder.
- addMessageCountListener(MessageCountListener) - Method in class com.sun.mail.imap.IMAPFolder
-
- addMessageCountListener(MessageCountListener) - Method in class javax.mail.Folder
-
Add a listener for MessageCount events on this Folder.
- addMessages(Message[]) - Method in class com.sun.mail.imap.IMAPFolder
-
Append the given messages into this folder.
- addProvider(Provider) - Method in class javax.mail.Session
-
Add a provider to the session.
- addr - Variable in exception com.sun.mail.smtp.SMTPAddressFailedException
-
- addr - Variable in exception com.sun.mail.smtp.SMTPAddressSucceededException
-
- addr - Variable in exception com.sun.mail.smtp.SMTPSenderFailedException
-
- addr - Variable in exception com.sun.mail.smtp.SMTPSendFailedException
-
- addRecipient(Message.RecipientType, Address) - Method in class javax.mail.Message
-
Add this recipient address to the existing ones of the given type.
- addRecipientDSN(InternetHeaders) - Method in class com.sun.mail.dsn.DeliveryStatus
-
Add deliver status notification information for another
recipient.
- addRecipients(Message.RecipientType, Address[]) - Method in class com.sun.mail.imap.IMAPMessage
-
- addRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.internet.MimeMessage
-
Add the given addresses to the specified recipient type.
- addRecipients(Message.RecipientType, String) - Method in class javax.mail.internet.MimeMessage
-
Add the given addresses to the specified recipient type.
- addRecipients(Message.RecipientType, Address[]) - Method in class javax.mail.Message
-
Add these recipient addresses to the existing ones of the given type.
- Address - Class in javax.mail
-
This abstract class models the addresses in a message.
- Address() - Constructor for class javax.mail.Address
-
- address - Variable in class javax.mail.internet.InternetAddress
-
- address - Variable in class javax.mail.search.AddressTerm
-
The address.
- AddressException - Exception in javax.mail.internet
-
The exception thrown when a wrongly formatted address is encountered.
- AddressException() - Constructor for exception javax.mail.internet.AddressException
-
Constructs an AddressException with no detail message.
- AddressException(String) - Constructor for exception javax.mail.internet.AddressException
-
Constructs an AddressException with the specified detail message.
- AddressException(String, String) - Constructor for exception javax.mail.internet.AddressException
-
Constructs an AddressException with the specified detail message
and reference info.
- AddressException(String, String, int) - Constructor for exception javax.mail.internet.AddressException
-
Constructs an AddressException with the specified detail message
and reference info.
- AddressStringTerm - Class in javax.mail.search
-
This abstract class implements string comparisons for Message
addresses.
- AddressStringTerm(String) - Constructor for class javax.mail.search.AddressStringTerm
-
Constructor.
- AddressTerm - Class in javax.mail.search
-
This class implements Message Address comparisons.
- AddressTerm(Address) - Constructor for class javax.mail.search.AddressTerm
-
- addRights(ACL) - Method in class com.sun.mail.imap.IMAPFolder
-
Add the rights specified in the ACL to the entry for the
identifier specified in the ACL.
- addStoreListener(StoreListener) - Method in class javax.mail.Store
-
Add a listener for StoreEvents on this Store.
- addTransportListener(TransportListener) - Method in class javax.mail.Transport
-
Add a listener for Transport events.
- ADMINISTER - Static variable in class com.sun.mail.imap.Rights.Right
-
Administer - perform SETACL.
- ALERT - Static variable in class javax.mail.event.StoreEvent
-
Indicates that this message is an ALERT.
- ALL - Static variable in class javax.mail.internet.MimeUtility
-
- AndTerm - Class in javax.mail.search
-
This class implements the logical AND operator on individual
SearchTerms.
- AndTerm(SearchTerm, SearchTerm) - Constructor for class javax.mail.search.AndTerm
-
Constructor that takes two terms.
- AndTerm(SearchTerm[]) - Constructor for class javax.mail.search.AndTerm
-
Constructor that takes an array of SearchTerms.
- ANSWERED - Static variable in class javax.mail.Flags.Flag
-
This message has been answered.
- appendMessages(Message[]) - Method in class com.sun.mail.imap.IMAPFolder
-
Append the given messages into this folder.
- appendMessages(Message[]) - Method in class com.sun.mail.pop3.POP3Folder
-
Always throws MethodNotSupportedException
because the POP3 protocol doesn't support appending messages.
- appendMessages(Message[]) - Method in class javax.mail.Folder
-
Append given Messages to this folder.
- appendUIDMessages(Message[]) - Method in class com.sun.mail.imap.IMAPFolder
-
Append the given messages into this folder.
- ARRIVAL - Static variable in class com.sun.mail.imap.SortTerm
-
Sort by message arrival date and time.
- ATOM - Static variable in class javax.mail.internet.HeaderTokenizer.Token
-
Token type indicating an ATOM.
- attachFile(File) - Method in class javax.mail.internet.MimeBodyPart
-
Use the specified file to provide the data for this part.
- attachFile(String) - Method in class javax.mail.internet.MimeBodyPart
-
Use the specified file to provide the data for this part.
- ATTACHMENT - Static variable in interface javax.mail.Part
-
This part should be presented as an attachment.
- attributes - Variable in class com.sun.mail.imap.IMAPFolder
-
- AuthenticationFailedException - Exception in javax.mail
-
This exception is thrown when the connect method on a Store or
Transport object fails due to an authentication failure (e.g.,
bad user name or password).
- AuthenticationFailedException() - Constructor for exception javax.mail.AuthenticationFailedException
-
Constructor
- AuthenticationFailedException(String) - Constructor for exception javax.mail.AuthenticationFailedException
-
Constructor
- Authenticator - Class in javax.mail
-
The class Authenticator represents an object that knows how to obtain
authentication for a network connection.
- Authenticator() - Constructor for class javax.mail.Authenticator
-
- authorizationID - Variable in class com.sun.mail.imap.IMAPStore
-
- available() - Method in class javax.mail.util.SharedFileInputStream
-
Returns the number of bytes that can be read from this input
stream without blocking.
- availableFlags - Variable in class com.sun.mail.imap.IMAPFolder
-


Police arrest fan after Wycombe goalkeeper complains of homophobic abuse at Tranmere game
Two more individuals are being investigated following the incident at Prenton Park on Sunday afternoon as Wycombe beat Tranmere in League One
by Ian WhittellThe FA are investigating after Wycombe goalkeeper Ryan Allsop made a complaint about the use of homophobic language from supporters at Tranmere Rovers.
Police are believed to have made one arrest and are investigating two other individuals after the incident at Prenton Park.
Allsop made the complaint at half-time to match referee John Busby who involved Merseyside Police during a game that was screened live on television.
Wycombe boss Gareth Ainsworth only discovered the incident had taken place at full time but praised his players for their response.
Ainsworth said: “That’s the first I’ve heard of it.
“You’ve got to credit the players for taking it seriously and reporting it.”
The FA confirmed they are investigating the incident and awaiting a report from referee Busby before deciding what course to take.
A spokesperson said: “We are awaiting the report and will be seeking observations from all the parties involved.”
But Tranmere have promised an investigation and confirmed they will take action against supporters found guilty of any wrong doing.
Boss Micky Mellon said: “Obviously it is being dealt with properly. At the moment, we feel everything is being done that is necessary.
“It will play out the way people have to deal with it and I am sure they will deal with it because Tranmere is a good football club.
“I don’t know what’s been said, I wasn’t there. I can’t comment on something I haven’t heard or seen but the club will deal with it.”
While racism at football matches has come under an increasing spotlight in recent months, reported cases of homophobic abuse are far less common.
But the FA has made tackling homophobia a priority, as part of its inclusion and anti-discrimination policies.
Earlier this year, police and the FA investigated claims that then Macclesfield boss Sol Campbell was the subject of homophobic abuse during his team’s game at Cheltenham although no further action was taken.


CRIDEditModal
app.CRIDs
Controller for modal View to add USPS CRID to a given Mail Owner
lbServices
(Loopback API service)
CRIDEditModal($q:, $scope:, $modalInstance:, logger:, data:, CRID:, MailOwner:);
| Param | Type | Details |
|---|---|---|
| $q: | object | Angular asychronous process object |
| $scope: | object | Angular Scope object |
| $modalInstance: | object | Angular Bootsrap modal instance object |
| logger: | object | Internal Logging Service |
| data: | array | Genertic data (button text) |
| CRID: | object | Selected CRID |
| MailOwner: | object | Selected Mail Owner |
perform 'CANCEL' processing (dismiss the Modal)
collect selected CRID and asociated Mail Owner from database to display in edit form
collect all available Mail Owners, to select which is to be associated with the new CRID
perform 'UPDATE' processing (update the CRID in the database, then close the dialog)


39+ Log Cabin Builders In Wisconsin Background. Waterfront log homes for sale wi. We make it easier with our complete package.
Anyone in wisconsin who make all or part of. Orange county young republicans (ocyr). Let cozy cabins create your new home away from home!
These garden log cabins are specially designed to fit into the corner of your garden.
We specialize in homes from $400,000 to $4. We manufacture different log cabin styles and work closely with our customers in designing a cabin that meets their ideas and individual needs. Our keops interlock log cabins are made from the finest northern scandinavian pine and have a 10 year warranty. Click here to see videos and episodes of log cabin kings on the great american country channel.


public abstract class TTFDataStream
extends java.lang.Object
| Constructor and Description |
|---|
TTFDataStream() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Close the underlying resources.
|
abstract long |
getCurrentPosition()
Get the current position in the stream.
|
abstract java.io.InputStream |
getOriginalData()
This will get the original data file that was used for this stream.
|
abstract int |
read()
Read an unsigned byte.
|
abstract int |
read(byte[] b,
int off,
int len) |
byte[] |
read(int numberOfBytes)
Read a specific number of bytes from the stream.
|
float |
read32Fixed()
Read a 16.16 fixed value, where the first 16 bits are the decimal and the last 16 bits are the fraction.
|
long |
readInternationalDate()
Read an eight byte international date.
|
abstract long |
readLong()
Read an unsigned byte.
|
int |
readSignedByte()
Read a signed byte.
|
abstract short |
readSignedShort()
Read an signed short.
|
java.lang.String |
readString(int length)
Read a fixed length ascii string.
|
java.lang.String |
readString(int length,
java.lang.String charset)
Read a fixed length ascii string.
|
int |
readUnsignedByte()
Read a unsigned byte.
|
int[] |
readUnsignedByteArray(int length)
Read an unsigned byte array.
|
long |
readUnsignedInt()
Read an unsigned integer.
|
abstract int |
readUnsignedShort()
Read an unsigned short.
|
int[] |
readUnsignedShortArray(int length)
Read an unsigned short array.
|
abstract void |
seek(long pos)
Seek into the datasource.
|
public float read32Fixed() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public java.lang.String readString(int length) throws java.io.IOException
length
- The length of the string to read.java.io.IOException
- If there is an error reading the data.public java.lang.String readString(int length, java.lang.String charset) throws java.io.IOException
length
- The length of the string to read in bytes.charset
- The expected character set of the string.java.io.IOException
- If there is an error reading the data.public abstract int read() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public abstract long readLong() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public int readSignedByte() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public int readUnsignedByte() throws java.io.IOException
read()
, but throws an exception if EOF is unexpectedly reached.java.io.IOException
- If there is an error reading the data.public long readUnsignedInt() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public abstract int readUnsignedShort() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public int[] readUnsignedByteArray(int length) throws java.io.IOException
length
- the length of the array to be readjava.io.IOException
- If there is an error reading the data.public int[] readUnsignedShortArray(int length) throws java.io.IOException
length
- The length of the array to read.java.io.IOException
- If there is an error reading the data.public abstract short readSignedShort() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public long readInternationalDate() throws java.io.IOException
java.io.IOException
- If there is an error reading the data.public abstract void close() throws java.io.IOException
java.io.IOException
- If there is an error closing the resources.public abstract void seek(long pos) throws java.io.IOException
pos
- The position to seek to.java.io.IOException
- If there is an error seeking to that position.public byte[] read(int numberOfBytes) throws java.io.IOException
numberOfBytes
- The number of bytes to read.java.io.IOException
- If there is an error while reading.public abstract int read(byte[] b, int off, int len) throws java.io.IOException
b
- The buffer to write to.off
- The offset into the buffer.len
- The length into the buffer.java.io.IOException
- If there is an error reading from the stream.InputStream.read(byte[], int, int )
public abstract long getCurrentPosition() throws java.io.IOException
java.io.IOException
- If an error occurs while reading the stream.public abstract java.io.InputStream getOriginalData() throws java.io.IOException
java.io.IOException
- If there is an issue reading the data.


Yousra Elsarnagawy
An insight to my creative self
I am a creative and passionate spirit, on a mission of capturing the beauty of the world in my art.
In the city of Cairo I reside, while my mind wanders the streets of cities I have not yet visited.
Currently, I study Applied Arts at The German University Of Cairo.
Art in all its forms intrigues me but I am particularly attached to my camera which brings my photography to life
Ambition
Student looking out at what life holds.
Indoor blossom
Don't let being confined stop you from blossoming.
Raging delicacy
The beach waves are soothing even when they are raging.
Traped in love
flowrs can bloom in the cages of marriage.
Secret Garden
A stranger's garden is a home of stories and secrets.
Outcast
Uniquness is a crime for the social norm and thus it must be punished.
Tales of the past
Antique objects have their sentimental value taken away from them at the shop.
Safety net
Catches you when your heading to the darkest pit, you climb back from there, it is that one thing that keeps you sane.
Trap the sun
Theres beauty in light, but thats never enough, we always have to make it "better".
| Tweets by kulturtava |


Random Number God
`Prev `__
R
`Next `__
--------------
**Random Number God**
[rec.games.roguelike.angband; often abbreviated ‘RNG’] The malign force
which lurks behind the random number generator in
`*Angband* <../A/Angband.html>`__ (and by extension elsewhere). A dark
god that demands sacrifices and toys with its victims. “I just found a
really great item; I suppose the RNG is about to punish me...”
Apparently, Angband's random number generator occasionally gets locked
in a repetition, so you get something with a 3% chance happening 8 times
in a row. Improbable, but far too common to be pure chance. Compare
`*Shub-Internet* <../S/Shub-Internet.html>`__.
--------------
+---------------------------+----------------------------+-----------------------------------+
| `Prev `__ | `Up <../R.html>`__ | `Next `__ |
+---------------------------+----------------------------+-----------------------------------+
| random | `Home <../index.html>`__ | random numbers |
+---------------------------+----------------------------+-----------------------------------+


{% extends "layout.html" %} {% block page_title %} Hackney - Maintain My Home {% endblock %} {% block content %} Maintain My Home Request a repair Who should we contact about this repair? We will contact you within one working day to book an appointment for your repair. Full name Telephone number Choose what time is best to call you Choose a time slot fo a call morning, 8am - 12pm afternoon, 12pm - 5pm Back to describe what needs to be fixed {% endblock %} {% block scripts %} {% include "includes/scripts.html" %} {% block page_scripts %} {% endblock %} {% endblock %}
We will contact you within one working day to book an appointment for your repair.
Back to describe what needs to be fixed


src/Connector.js:7
A Connector on a box.
Connector
Defined in src/Connector.js:7
clone
Defined in src/Connector.js:90
src/Connector.js:90
Clone this object
getPosition
Defined in src/Connector.js:34
src/Connector.js:34
Get the diagram position of this Connector
spawnLine
Defined in src/Connector.js:76
src/Connector.js:76
Creates a Line connected to this Connector and to a point. The point is initially the same position as the connector.


§431:7-311 Not subject to levy. No judgment creditor or other claimant of an insurer shall levy upon any deposit held pursuant to this article or upon any part hereof. [L 1987, c 347, pt of §2]


The WHO was founded in 1948.
Can I get this ASAP?
The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbreviation.


 I never ever even received an email about why. This made me so angry that I tried for 3 months to contact anyone at Flickr and Yahoo to no avail. I sent emails, I tried every single means in every single channel after digging and digging – Nada, nothing. Not a peep as to why. No response.
So I guess I will try this… Pretty neat for free.
RB
blog comments powered by
Disqus


laudantium unde ea quasi esse excepturi ipsum atque veniam quam laboriosam hic!
Retro listicle vegan 3 wolf moon next level, Bushwick Echo Park. Irony four loko Wes Anderson, sartorial tofu mlkshk pork belly crucifix Pitchfork bespoke distillery cred actually. Intelligentsia mixtape lumbersexual High Life YOLO, craft beer beard. Pickled tote bag twee scenester mumblecore pop-up craft beer Austin Neutra 8-bit. Cronut normcore blog post-ironic, church-key keytar pop-up Bushwick farm-to-table meggings butcher.
Marfa health goth Brooklyn literally, mustache mlkshk try-hard farm-to-table. Cold-pressed swag four loko heirloom, bitters Wes Anderson vinyl Williamsburg Bushwick squid stumptown Pitchfork salvia. Paleo Shoreditch Kickstarter tousled farm-to-table. Distillery chambray tofu, keffiyeh 3 wolf moon Blue Bottle narwhal Etsy craft beer stumptown Portland cornhole jean shorts blog. Crucifix squid photo booth, American Apparel disrupt fap fanny pack.
Post-ironic fanny pack sartorial, occupy vinyl Echo Park four loko umami yr single-origin coffee Truffaut PBR organic kale chips. Ennui single-origin coffee seitan, bespoke DIY photo booth cronut pour-over leggings. Banksy 3 wolf moon ethical, Bushwick ennui lo-fi quinoa banjo Vice aesthetic chambray Schlitz sustainable XOXO. Hella fanny pack locavore, Pitchfork cornhole banh mi gentrify cliche. Fanny pack synth scenester trust fund.


{{profile.followers}} Followers {{profile.following}} Following {{profile.public_gists}} Public gists {{profile.public_repos}} Public repos
View profile on github
{{repo.name}} View this project on github
{{repo.description}}


A Github Table of Contents Hack
This was originally a StackOverflow question. And it was also turned into a Github Gist.
For large pieces of documentation, it's pretty much typical to create a
Table of Contents (TOC) in Markdown — usually in the
README.md
file itself. This is usually automated through IDE extensions and the
result ends up being a nested bulleted (

) or
numbered list (

). It usually looks like this:
That's really not ideal, because the bullet points are just unnecessary
noise, boilerplate. With CSS, you could add a
list-style-type: none;
and have the problem disappear.
However, Github tries its best to cleanse the user's custom styling,
lest they could completely distort Github's content and UI/UX, which
completely reasonable. In the second item of
Github Markup's process for each repository:
(...) aggressively removing things that could harm you and your kin—such as script tags, inline-styles, and class or id attributes.
Thanks to the Waylan StackOverflow user for pointing out Github Markup's existence and relevance to this specific problem.
However, they aren't doing that aggressively enough. After about half an
hour trying to bypass these restrictions and trying every HTML/CSS way I
knew to style this list, I stumbled upon a that almost did the trick.
The only problem was that Github was leaving the style tag in-line on
the final document as text — something like this:

.
After insisting that there should be a hack somewhere, I tried examining
the HTML code with the browser inspector. And there I found the hack,
the user-content-toc
ID. Maybe Github wanted to release
this feature at some point for their Markdown "compiler" but couldn't
for some reason. At any rate, the final hack/solution is to wrap your
list with a

and then add the
user-content-toc
ID:

...

Keep in mind that this will surely not be ideal. Because Github might
change the id
at any point in time, which would break your
styling. Nevertheless, in the case this id
disappears, at
the worst, things will simply default to

—
which is not as bad as the case where they completely distort the

's behavior, so watch out!


When you work with us ,you are part of a team of collaborators.All aspects of our software development process are interated,interactive and agile.
Our approach unifies designs,development and product management to create exceptional products.
We start each project by understanding our business goals,the user's needs and the product requirements.Then we help translate them into effective and elegant solutions


The most recent temperature value that the channel has reported.
MinTemperature
and MaxTemperature
.|
Device In Device # Identification |
|
error in (no error) error in can accept error information wired from VIs previously called. |
|
status status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred. Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error. |
|
code code is the error or warning code. Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error. |
|
source source describes the origin of the error or warning. Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error. |
|
Device Out Same as Device In |
|
error out error out passes error or warning information out of a VI to be used by other VIs. |
|
status status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred. Right-click the error out control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error. |
|
code code is the error or warning code. Right-click the error out control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error. |
|
source source describes the origin of the error or warning.


--- layout: post status: publish published: true title: BizTalk 2004 Transactions author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 744 wordpress_url: http://winterdom.com/2004/04/biztalk2004transactions date: '2004-04-26 19:15:29 +0000' date_gmt: '2004-04-26 19:15:29 +0000' categories: - BizTalk tags: [] comments: [] ---
Definitely a good read. Raises quite a few interesting questions!


Symbol Index for "Classification System"
Symbol Index for diagram
"Classification System"
Agent (Class)
basis (Association)
Classification Element (Class)
Classification System (Class)
Classification System Version (Class)
Guideline (Class)
KC/Essential Type (Generalization Node)
Knowledge Concept (Class)
responsible for (Association)


When text-align is justify, the last line would be affected by the value of text-align-last.
This test checks that text-align-last property works properly.
start last
end last
left last
right last
center last
justify last
start end
end start
left right
right left
center left


A unique solution for designer and developers working on code sooner
A shoot-from-the-hip styleguide as you start your web or moblie project.
Why?
StyleGun allows Designers fine tuned control over styles for the lifetime of the project.
For Developers it creates a set of consistent variable names for colors and fonts. Keeping everyone in step and moving forward fast-like, while giving Clients a living styleguide.
Workflow?
Designers
Clone It
Code It
Push It
Developers
Push It
Client
Smoke It
How's it work?
Leveraging technology while building co-dependency


The latest mobile theme launched
This is a modern HTML5 mobile template that will help you create a mobile website, a mobile web app, or a native app integrated with solutions like phonegap and Cordova. We think about our buyers' needs and have created a variety of elements pre-developed and designed; a very modern and stylish
design and, on top of that, is using a flexible layout that will adapt to any mobile resolution.
Multiple pages and design elements are included which will help you create anything you want on your
website or app. Offering two different menu
sidebars, a clean, high-quality design and 730+ icons to help you create an awesome app and web mobile.
The Mobile Elements incorporated allow you to easily create the app or mobile web of your dreams.
Includes styled buttons, radio buttons, check box, input fields, toggles and many, many more.
It is modern and stylish
With more than 23 page templates, this is the perfect web app and the only one you will ever need!
includes a wide variety of elements pre-developed and designed; a very modern and stylish design and, on top of that, is using a flexible layout that will adapt to any mobile resolution.
Multiple pages and design elements are included which will help you create anything you want on your
website or app. Offering two different menu
sidebars, a clean, high-quality design and 730+ icons to help you create an awesome app and web mobile.
The Mobile Elements incorporated allow you to easily create the app or mobile web of your dreams.
Includes styled buttons, radio buttons, check box, input fields, toggles and many, many more.


Prayed for a happy Telangana, says Governor
Tamilisai Sounderarajan accorded a ‘purnakumbh’ welcome by Yadadri temple priests
by Staff ReporterGovernor Tamilisai Sounderarajan along with her husband P. Souderarajan visited the Sri Lakshmi Narasimha Swamy temple here on Monday.
She was received by Energy Minister G. Jagadish Reddy, Aler legislator G. Sunitha and District Collector Anita Ramachandran. The Governor couple were offered a purnakumbh welcome by the temple priests, who offered special prayers and performed other honours.
Speaking to the media briefly, the Governor expressed happiness at visiting the temple, a first since her appointment to the State, and taking darshan with her family. Her prayers were for a more happy and developed Telangana, she said.
Ms. Sounderarajan later left for Hanamkonda, where her two-day schedule is fixed.


MURDER IN THE FIRST A film review by Scott Tobias Copyright 1995 Scott Tobias
There's a good, and timely, story trapped deep within the excess of MURDER IN THE FIRST, a new movie about the abuses of our prison system. With a country wrapped up in feverish debate over the crime issue and the rights of the accused and the incarcerated in jeopardy, this expose would offer something rare to recent American movies--a point of view.
But director Marc Rocco makes it clear from the beginning that pretentious, often nauseating, camera movements and slick, MTV- style lighting and editing are far more important. There's not a moment in the picture where he surrenders technique for pure storytelling. And everything suffers.
Christian Slater and Kevin Bacon star as defense attorney and Alcatraz inmate, respectively. After spending an unprecedented amount of time in an isolated cell for attempting to escape, Bacon murders another prisoner and faces trial. His young lawyer (Slater) is fresh out of law school but determined to "put Alcatraz on trial" for the abuses of it warden (Gary Oldman). The result is the usual courtroom theatrics- imagine a Stanley Kramer production shot by hyperactive film school students.
There's very little to praise here outside of Kevin Bacon's earnest overacting and the appropriate story. There's a lot of overacting from everyone--you know you're in trouble right away when R. Lee Ermey (the drill sergeant in FULL METAL JACKET) is cast as a judge, the center of reason and moderation. Slater has never been convincing and certainly isn't here and Oldman is on a bad streak of hammy performances.
But the worst feeling you get while watching MURDER IN THE FIRST is that the man behind the camera could care less about telling a good story. There are long exchanges of dialogue where the camera is not even moving near the characters, let alone with them. How frustrating it must be for actors to work under these conditions.
If there's anything that has alway distinguished American films over the rest of the world, it is our ability to tell a good story. Have we forgotten?
*1/2 (out of four)
Written by Scott Tobias
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Web Server Quest is a Google Chrome extension that record and count up your activities on requesting web pages. It can summarize the count of web server types and technologies used by each page request.
You can also use existed or setup your own Cube server that helps you record each request and deriving metrics. With the help of Cube, you can make richer analysis in post-hoc manner, such as quantiles and histograms of arbitrary event sets.
For the future work, we are going to provide a mini roll playing game that makes it more fun for end users.
In recent years, researches and web analytic tools help web developers get to know their user. Such as the popularity of the browsers and OSs. However, there are few tools for us to understand how these excellent web sites built on and how the web get composited.
To get to know the web, we have to collect server properties from all popular web servers that distributed all over the world. Instead of setting up dozens of crawlers walking through the web, we adopt crowd-sourced computing model for user orientated statistics.
serverType
)serverTech
)serverType
)serverTech
)
#
part,
which meant to be an anchor. We can now get the domain name and
"some" detail about each request.serverType
)serverTech
)Play the game, unveil the web.
That is, Gamification!
We are going to provide a mini RPG game in the future.
localhost
by default,
you can change it to other trusted servers.For detailed parameters, please take a look in Makefile
.
Copyright (c) 2013 Asser Chiu, released under the MIT license.


Router
public class Router
| Field Summary | |
|---|---|
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed |
| Constructor Summary | |
|---|---|
| void | __construct(mixed default_app, mixed baseUrl) |
| Method Summary | |
|---|---|
| void | |
| void | map(mixed rule, mixed target) |
| void | execute() |
| void | |
| void | loadAppRoutes(mixed app) |
public mixed $action
public mixed $app
public mixed $controller
public mixed $default_action
public mixed $default_app
public mixed $default_controller
public mixed $ext = '.(html|json)'
public mixed $params
public mixed $request_uri
public mixed $routes = array()
public void __construct(mixed default_app, mixed baseUrl)
public void defaultRoutes()
public void map(mixed rule, mixed target)
public void execute()
public void loadRoutes()
public void loadAppRoutes(mixed app)
Thanks to http://blog.sosedoff.com/2009/09/20/rails-like-php-url-router


State Pension Activation
We will let you know your state pension entitlement and guide you through the process to start claiming your pension.
In order to process your claim for State Pension, you will need:
- Unique Number Code on your Pension Activation Letter
- Your National Insurance Number
- Your Date of Birth
- Bank Account / Building Society Account Details


{% extends "base.html" %} {% block body_styles %} id="error-page"{% endblock %} {% block content %}
Servers have bad days. So do rabid rats.  Tell Nick.


Promises and Streams in Javascript
Let's explore this topic in a practical way! I want a function that reads a file and another that writes a file. But files can be small or big, text or binary, so we want to allow them to read the whole file at once with a promise, or pipe it to another file in chunks. The API should look like:
// demo.js
import { read, write } from "./simplefs.js";
// Works with Promises
const data = await read("./readme.md");
await write("./readme2.md", data);
// Works with traditional Node.js Streams
read("./readme.md").pipe(write("./readme3.md"));
// Works with the new Web Streams
read("./readme.md").pipeTo(write("./readme4.md"));
I am also not sure what to expect here, while I'm very familiar with the inner workings of Promises, I'm only at the user-level familiar with Node.js Streams, and totally unfamiliar with WebStreams, the new Node.js abstraction. But let's try to make that work anyway!
It all starts with a Promise
Let's start first with Promises, we want to make an API that allows us to simply do:
// demo.js
import { read, write } from "./simplefs.js";
// Works with Promises
const data = await read("./readme.md");
await write("./readme2.md", data);
Promises is the one I'm most familiar with and the default one for small files. This should look like a thin wrapper since we have a very similar API in fs/promises
already:
import { readFile, writeFile } from "node:fs/promises";
// simplefs.js
export const read = (path) => {
return readFile(path, "utf-8");
};
export const write = (path, data) => {
// Returning a promise is the same as making the whole file async
return writeFile(path, data);
};
🚂 Let's test it! We write a minimal package.json
and run node demo.js
, and we see that our demo.js correctly writes the file readme2.md
with the same content as this file!
But we only want the read()
to use promises when calling it with await
or .then()
, and the write()
when it receives some data, so let's modify our functions to reflect that:
Note: calling
await fn()
is practically the same as callingfn().then()
, with some minor differences that are not relevant for this article.
export const read = (path) => {
return {
// A promise is abstracted just like this! It's just a function that
// receives a CB and passing the resolution value into it
then: async (cb) => cb(await readFile(path, "utf-8")),
};
};
export const write = (path, data) => {
// Returning a promise is the same as making the whole file async
if (typeof data !== 'undefined') {
return writeFile(path, data);
}
};
Now we have the promise behaviour occurring only when we are using promises. An empty file will return ""
, and so the file is created even with empty files. So promises to promises condition is fulfilled! 🎉
Note: we are simplifying and this is not Promise-compliant, or "Promises A+" as it's called.
Node.js streams
Now let's try to work with the streams, starting with the traditional Node.js pipes. We want to achieve the ability of doing this, without hampering the previous promises workflow:
// demo.js
import { read, write } from "./simplefs.js";
// Works with traditional pipes
read("./readme.md").pipe(write("./readme3.md"));
For that, we'll import and use it only when ".pipe()" is called:
// simplefs.js
import { readFile, writeFile } from "node:fs/promises";
import { createReadStream, createWriteStream } from "node:fs";
export const read = (path) => ({
then: async (cb) => cb(await readFile(path, "utf-8")),
// Our .pipe(writable) receives the writable stream, so create and pipe it
pipe: (writable) => createReadStream(path).pipe(writable),
});
export const write = (path, data) => {
if (typeof data !== "undefined") {
return writeFile(path, data);
}
// Create the writable stream if there's no data, assuming it's going to
// receive a pipe
return createWriteStream(path);
};
🚂 Let's test it again with node demo.js
and we see that once more, readme3.md
is created with the correct data! Node.js streams seem to work properly 🎉
Note: we are also simplifying A LOT here and this is not fully Node Stream-compliant.
Web Streams
Finally we want the ability of doing the following:
// demo.js
import { read, write } from "./simplefs.js";
// Works with the new Web Streams
read("./readme.md").pipeTo(write("./readme4.md"));
This is probably going to be the tricky one, specially in the write()
since we don't have much room there for mistakes, but let's try anyway! First thing is to modify read()
to add the pipeTo()
characteristic of Web Streams. We're going to transform the Node.js stream to Web stream:
import { Readable, Writable } from "node:stream";
export const read = (path) => ({
// A promise is abstracted just like this! It's just a function that
// receives a CB and passing the resolution value into it
then: async (cb) => cb(await readFile(path, "utf-8")),
// Our .pipe(writable) receives the writable stream, so create and pipe it
pipe: (writable) => createReadStream(path).pipe(writable),
// When pipeTo, it's a webstream so convert it from Node to Web:
pipeTo: (writable) => {
return Readable.toWeb(createReadStream(path)).pipeTo(writable);
}
});
However if we try to run this, it won't work since that writable
is still a Node.js Stream and pipeTo()
expects a Writable WebStream.
Since we have control over both read()
and write()
, let's do a couple of modifications to pick only the right write type depending on the piping method:
export const write = (path, data) => {
...
// Depending on whether we are pipe()-ing or pipeTo()-ing, we'll call one
// method or the other. This is not ideal since it doesn't interact properly
// with native streams, but it's better than nothing
return {
node: () => createWriteStream(path),
web: () => Writable.toWeb(createWriteStream(path)),
};
};
While we could do that and then on write differentiate with writeable.node()
, then we have a big problem: this is not a write stream anymore, it's a custom API that just happens to have the same name AND uses pipes deep down. You cannot work with the write()
as you would normally work with a pipe in other cases. That's pretty bad, we want pipes to just be pipes, so let's try a different way:
export const write = (path, data) => {
// Returning a promise is the same as making the whole file async
if (typeof data !== "undefined") {
return writeFile(path, data);
}
// Create the Node.js stream and overload it with the methods of WebStreams
const stream = createWriteStream(path);
const webStream = Writable.toWeb(createWriteStream(path));
return Object.assign(stream, webStream);
};
What we are doing here is similar to how we fake the promise, but better. We are defining the output as a Node.js stream, and then overloading all of the methods of WebStream. We are not sure whether this will work or not, so let's try.
🚂 Let's remove the duplicate files and run node demo.js
and we can see that the files readme2.md
, readme3.md
and readme4.md
are created successfully. This is... surprising, and I'm not sure how I feel about doing it this way since there's a chance of method collision, but it seems to work so far so kudos! 🎉
Putting it all together
This is our final file 🎉:
// simplefs.js
import { readFile, writeFile } from "node:fs/promises";
import { createReadStream, createWriteStream } from "node:fs";
import { Readable, Writable } from "node:stream";
export const read = (path) => ({
// A promise is abstracted just like this! It's just a function that
// receives a CB and passing the resolution value into it
then: async (cb) => cb(await readFile(path, "utf-8")),
// Our .pipe(writable) receives the writable stream, so create and pipe it
pipe: (writable) => createReadStream(path).pipe(writable),
// When pipeTo, it's a webstream so convert it from Node to Web:
pipeTo: (writable) => {
return Readable.toWeb(createReadStream(path)).pipeTo(writable);
},
});
export const write = (path, data) => {
// Returning a promise is the same as making the whole file async
if (typeof data !== "undefined") {
return writeFile(path, data);
}
// Create the Node.js stream and overload it with the methods of WebStreams
const stream = createWriteStream(path);
const webStream = Writable.toWeb(stream);
return Object.assign(stream, webStream);
};
We purposefully only followed the happy simplified path here. However, there's a lot of details that we skipped, like:
- Promises also have
.catch()
and.finally()
. - Node.js Streams have A LOT of other methods, like
.close()
,.push()
,.read()
, etc. - Web Streams ALSO have other methods.
- We are ignoring all of the options that both the promises and streams can accept.
We would need to make all of those to work properly if we want to call this a Promise or a Node/Web Stream properly. One possible hack/fix, at least on the read()
side, is to make it all a ReadableStream that has the promise methods attached, like:
export const read = (path) => {
const stream = createReadStream(path);
stream.then = async cb => cb(await readFile(path, "utf-8"));
stream.catch = // ...
stream.finally = // ...
const webStream = // ...
return Object.assign(stream, webStream);
};
This allows us to make it be a stream by default and not need to worry about those methods and details, and only add the promise interface on top of it. However, I don't know enough of the internals of createReadStream to know if this would result in a double read, or even in potentially a memory leak, so I won't set that as "the solution".
Maybe a better solution is not to try to overload a single method, but instead to keep it into separated helpers like this:
// demo.js
import { read, write } from "./simplefs.js";
const data = await read("./readme.md");
await write("./readme2.md", data);
read.nodeStream("./readme.md").pipe(write.nodeStream("./readme3.md"));
read.stream("./readme.md").pipeTo(write.stream("./readme4.md"));
I'm the author of the library files
and I'll continue exploring this topic and adding this functionality to the library itself when I'm confident enough! So make sure to star and watch the library:


This spell grants up to ten w illing creatures you can see within range the ability to breathe underwater until the spell ends. Affected creatures also retain their normal mode of respiration.
This spell grants up to ten w illing creatures you can see within range the ability to breathe underwater until the spell ends. Affected creatures also retain their normal mode of respiration.


This is EventLite. See the list of events for more information.
| Upcoming Event | Venue | Date | Time |
|---|---|---|---|
| My Event | Event venue | Event date | Event time |
This is EventLite. See the list of venues for more information.
| Most Popular Venues | Number of Events |
|---|---|
| Venue | Total events |