Last update May 13, 2013
Welcome !
Hope you will enjoy my parallel libraries and my other libraries. Your comments , suggestions and feedback are welcome.
Sincerely,
Amine Moulay Ramdane
aminer@videotron.ca![]()
Modules/Authors |
Files |
|
A web page that i wrote on how to analyze parallel applications with Petri Nets: Petri Nets. A web page that i wrote about a Jackson network problem: Jackson network You need to download the following DLL that will be needed by my libraries: msvcr110.dll |
||
PArchiver 1.84 (stable version)
Author: Amine Moulay Ramdane -
Wide range of compression Parallel algorithms: Parallel LZ4,
Parallel LZO, Parallel ZLib, Parallel BZip and Parallel LZMA
with different compression levels
- Compiles into exe - no dll/ocx required.
- Now my Parallel Zlib gives 5% better performance than
Pigz. - Supports in-memory archives
- You can use it as a hashtable from the hardisk or from the memory - Fastest compression levels are extremely fast - Good balanced compression levels provide both good compression ratio and high speed - Maximum compression levels provide much better compression ratio than Zip, RAR and BZIP and the same as 7Zip with 8 megabytes dictionary.
- It supports both compression and decompression rate
indicator
Please look at test_pzlib.pas , test_plzo.pas , test_plz4.pas , test_pbzip.pas and test_plzma.pas demos
inside the zip file, compile and execute them.. -
When you want to delete files inside the archive you have
to call the DeleteFiles() method , the DeleteFiles()
method will not delete the files, it will mark the files
as deleted , when you want to delete completly the files
, you have to call the DeletedItems() method to see how
many files are marked deleted and after that you use the
Clean() method to delete completly the files from the
archive. I have implemented it like that, cause it's
better in my opinion.. Question: I have just played with 7Zip , and i have compressed 3 files into the archive and after than i have opened the archive with an editor and i have deleted some bytes and i have saved the file and after that when i have tried to open the archive, 7zip responded that the file is corrupted, so 7Zip is not fault tolerant, i think that with WinZip it's the same, but i have done the same test with my Parallel archiver, and it's recovering from the file damage, so it's fault tolerant to this kind of damages, such as power failures and when also the disk is full and you get a file corruption etc. I have implemented this kind of fault tolerancy into my Parallel archiver. I have updated my Parallel
archiver and i have added the Update() method, it's
overloaded now in the first version you pass a key name
and a TStream, and in the second version you pass a key
name and a filename. Please look at the test_pzlib.pas
demo inside the zip file to see how to use those
methods. Parallel archiver supports the storing and
restoring of the following file attributes:
If you want to use an in-memory archive, pass an empty string to the file name in the constructor, like this: pzr :=TPLZ4Archiver.Create('',1000,4); And if you want to read your in-memory archive , read from the Stream property that is exposed(a TStream) like this: pzr.stream.position:=0; A_Memory_Stream.copyfrom(pzr.stream,pzr.stream.size) You can also load your archive from a file or memory stream just by assigning your file or memory stream to the Stream property (a TStream). I have overloaded the GetKeys() method , now you can use wildcards, you can pass the wildcard in the first argument and the TStringList in the second argument like this: pzr.getkeys('*.pas',st); and after that call the ExtractFiles() method and pass it the TStringList. As you have noticed, the programming interface of my Parallel archiver is very easy to use. And read this: "We're a video sharing site located in China. We rewrote the PHP memcached client extension by replacing zlib with QuickLZ. Then our server loads were dramatically reduced by up to 50%, the page response time was also boosted. Thanks for your great work! Jiang Hong" http://www.quicklz.com/testimonials.html http://www.quicklz.com/ So as you have noticed , like QuickLZ or Qpress, i have implemented Parallel archiver to be very fast also. By using my Parallel Zlib or my Parallel LZ4 or my Parallel LZO compression algorithms my Parallel archiver will be very very fast and as i have wrote in my webpage: "So now you have all the methods to use my Parallel archiver as a Hashtable from the hardisk with direct access to the compressed and/or encrypted data with O(1) very fast acces to the data , the DeleteFiles() has a O(1) complexity the ExtractFiles() and Extract() have also O(1) complexity and GetInfo() is also O(1) and of course the AddFiles() is also O(1), the Test() method is also O(1). So now it's extremely fast. " You can even use my Parallel archiver as a hash table database from the Harddisk to lower more the load on your server (from internet or intranet) and boost the response time..... I have used solid compression like with the tar.lzma format and i have found that my Parallel archiver, with maximum level compression that is clLZMAMax, compresses to the same size as 7Zip with maximum level compression and with a dictionary size of 8 MB and it compresses 13% better than WinRar with maximum level compression and it is muh better than WinZip on compression ratio . How to use solid compression with my Parallel archiver ? Just archive your files with clLZMANone and after that compress your archive with clLZMAMax, Parallel archiver will then compress to the same size as 7Zip with maximum level compression and with a dictionary size of 8 MB and it will compress 13% better than WinRar with maximum level compression and it will compress muh better than WinZip with maximum level compression . I have updated my Parallel archiver to a new version and i have decided to include Parallel LZ4 compression algorithm (one of the fastest in the world) into my Parallel archiver, so to compress bigger data such us Terabytes data you can use my Parallel LZO or my Parallel LZ4 compression algorithms with my Parallel archiver, i have also added the high compression mode to Parallel LZ4 compression algorithm, now for a fast mode use clLZ4Fast and for the high compression mode use clLZ4Max. The Parallel LZ4 high compression mode is interresting also, it compresses much better than LZO and it is very very fast on decompression, faster than Parallel LZO. I have included a test_plz4.pas demo inside my Parallel archiver zip file to show you how to use Parallel LZ4 algorithm with my Parallel archiver. Here is the LZ4 website if you want to read about it: http://code.google.com/p/lz4/ I have downloaded also the IHCA compression algorithm from the following website: http://objectegypt.com/ And i have wrote a Parallel IHCA and begin testing it against my Parallel LZO and my Parallel LZ4 , they say on the IHCA website that it has the same performance as the LZO algorithm , but i have noticed on my benchmarks that Parallel IHCA(that i wrote) is much more slower than my Parallel LZO and my Parallel LZ4 , so i think the IHCA compressoin algorithm is a poor quality software that you must avoid, so please use my Parallel archiver and Parallel compression library cause with my Parallel LZO and my Parallel LZ4 they are now one of the fastest in the world. I have also downloaded the following QuickLZ algorithm from: http://www.quicklz.com/ and i have wrote a Parallel QuickLZ and i have tested it against my Parallel LZO and Parallel LZ4 , and i have noticed that Parallel QuickLZ is slower than my Parallel LZ4 algorithm, other than that with QuickLZ you have to pay for a commercial license , but with my Parallel archiver and my Parallel compression library you have to pay 0$ for a commercial license. My Parallel archiver was updated to version 1.65, i have ported the Parallel LZ4 compression algorithm(one of the fastest in the world) to the Windows 64 bit system, now Parallel LZ4 compression algorithm is working perfectly with Windows 32 bit and 64 bit, if you want to use Parallel LZ4 with Windows 64 bit just copy the lz4_2.dll inside the LZ4_64 directory (that you find inside the zip file) to your current directory or to the c:\windows\system32 directory, and if you want to use the Parallel LZ4 with Windows 32 bit use the lz4_2.dll inside the LZ4_32 directory. Here is more information about my Parallel archiver: Parallel LZO supports Windows 32 bit and 64 bit Parallel Zlib supports Windows 32 bit and 64 bit Parallel LZ4 supports Windows 32 bit and 64 bit Parallel Bzip is Windows 32 bit only Parallel LZMA is Windows 32 bit only But even if Parallel LZMA and Parallel Bzip are windows 32 bit only , my Parallel archiver supports Terabytes files and your archive can grow to Terabytes size even with 32 bit windows executables, and that's good. And Look also at the prices of the XCEED products: XCEED Streaming compression library: http://xceed.com/Streaming_ActiveX_Intro.html and the XCEED Zip compression library: http://xceed.com/Zip_ActiveX_Intro.html http://xceed.com/pages/TopMenu/Products/ProductSearch.aspx?Lang=EN-CA I don't think the XCEED products supports parallel compression as does my Parallel archiver and my Parallel compression library.. And just look also at the Easy compression library for example, if you have noticed also it's not a parallel compression library. http://www.componentace.com/ecl_features.htm And look at its pricing: http://www.componentace.com/order/order_product.php?id=4 My Parallel archiver and parallel compression library costs you 0$ and they are parallel compression libraries, and they are very fast and very easy to use, and they supports Parallel LZ , Parallel LZ4, Parallel LZO, Parallel Zlib, Parallel Bzip and Parallel LZMA and they come with the source codes and much more... Hope you will enjoy my Parallel archiver. Here is the public methods that i have implemented: Constructor
Create(file1:string,size:integer;nbrprocs:integer); function Erase; Operating Systems: Win32 and Win64 (will be ported soon to Linux and Mac (x86)). And inside defines.inc you can use the following defines: {$DEFINE CPU32} and {$DEFINE Win32} for 32 bits systems {$DEFINE CPU64} and {$DEFINE Win64} for 64 bits systems Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi |
Zip | |
Parallel Compression Library 2.4 (stable version)
Author: Amine Moulay Ramdane Parallel Compression Library implements Parallel Gzip , Parallel Bzip , Parallel LZMA and Parallel LZ and Parallel LZO algorithms using my Thread Pool Engine. - Now my ParallelGzip gives
5% better performance than Pigz.
Please look at test_pgzip.pas , test_pbzip.pas , test_plzma.pas , test_plz.pas and test_plzo.pas demos inside the zip file, compile and execute them... -
Note: Parallel Gzip , Parallel Bzip, Paralle LZ and Parallel LZO work with both FreePascal and Delphi , but Parallel LZMA works only with Delphi 7 and up. Operating Systems: Win , Linux and Mac (x86). Note: to be able to port to Linux and Mac OSX you have to compile the dynamic libraries... Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... -dUnix for Linux,MacOSX etc. Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi |
Zip | |
ParallelVarFiler 1.16 Authors: Amine Moulay Ramdane and Peter Johansson Click here to download the zip file: Zip Parallel Variable filer and streamer for Delphi and Freepascal that can be used also as a parallel hashtable and that uses ParallelHashList (Parallel Hashtable) with O(1) best case and O(log(n)) worst case access that uses lock striping and lightweight MREWs(multiple-readers-exclusive-writer) , this allows multiple threads to write and read concurently. also ParallelHashList maintains an independant counter , that counts the number of entries , for each segment of the hashtable and uses a lock for each counter, this is also for better scalability. Description: Collect different types of variables and save them into one file or stream. TParallelVarFiler reads and writes on files, streams and Strings. You can collect Strings, Integers and Dates, in fact everything that can be stored in a variant. In addition you can collect Streams. You can use also ParallelVarFiler to send parameters over network. It can be used for example to share data by any IPC mechanism. And please look at test.pas
and test1.pas a parallel variable filer examples -
compile and execute them... Now you can use ParallelVarFiler as a small to medium database, i have added a Clean() and DeletedItems() methods and i have changed the constructor, now you can pass a file name to the constructor where the data will be wrote and updated and deleted... if you pass and empty file name the data will be updated and wrote and deleted only in memory. When you use a file name in the constructor, many readers and one writer can proceed concurrently. But when you pass an empty file name to the constructor, many writers and many readers can proceed concurrently in memory. and when you read a data item it only use the parallel hashtable in memory, hardisk is not used.
How can you store mutiple
data inside a database row and map it to a key ? As you know
ParallelVarFiler is using ParallelHashList (a parallel
hashtable that scales on multicores), so when you are
using the GetKeys() method , and you want to get the data
of those keys don't forget to test if the variant is not
empty by using the VarIsEmpty() function, and when you
are using GetStream() you can test if the data exists by
testing the return boolean value from GetStream(). Now ParallelVarFiler is Fault tolerant to power failures etc. i have done a simulation of power failures and data file damages and ParallelVarFiller is recovering from power failure and damages of the data file ... And when there is a power failure or the program has crached and you want to recover from a damage to your data file you have only to call the LoadData() method. As you know
ParallelVarFiler is using ParallelHashList (a parallel
hashtable), but as you know ParallelHashList is cache
unfriendly since it's using a hash mechanism etc. and as
you know ParallelVarFiler and ParallelHashlist are
memory bound, so since ParallelHashList is cache
unfriendly and it's memory bound so i don't think
ParallelVarFiler or ParallelHahsList will scale very
well, to avoid this problem you have to use something
like replication across computers using TCP/IP and using
your database in each computer and load balance between
computers, but even if you are using replication and load
balancing this can make the memory and hardisk truly
parallel but this will not avoid the problem with the
network bandwidth limitation. But ParallelVarFiler and
ParallelHashlist are scaling to a certain point and they
are fast and they are still usefull. please look at the test.pas
and test1.pas example inside the zip file to see how to
use ParallelVarFiler... PUBLIC METHODS: constructor Create(file1:string,size,mrews:integer;casesensitive:boolean); - Creates a new VarFiler ready to use, with size and with mrews number of mrewa and casesensitive for case sensitive keys,the number of MREWS(multiple-readers-exclusive-writer) must be less or equal to the Hashtable size and file1 is the the file to write to, if file1 is an empty string the data will be wrote only to memory and use SaveToFile() to write to a file. destructor Destroy; - Destroys the ParallelVarFiler object and cleans up. procedure Clear; - Deletes all contents. function Clean:boolean - Clean the deleted items from the file. function DeletedItems:integer - Return the number of items marked deleted. function LoadData:boolean - Load the data from the file passed to the constructor. function Delete(Name : String):boolean; - Deletes the variable with Name. function Exists(Name : String) : Boolean; - Returns True if a variable with Name exists procedure GetKeys(Strings : TstringList); - Fills up a TStringList descendant with all the keys. function Count : Integer; - Returns the number of variables function Add(Name : String; Value : Variant ):boolean; - Adds a new variable , given the Name function AddStream( Name : String;Stream : TStream ):boolean; - Adds a new Stream, given the Name function Update(Name : String; Value : Variant):boolean; - Update the new variable , given the Name function UpdateStream(Name : String; Stream : TStream ):boolean; - Updated a new Stream , given the Name function GetStream(Name : String;Stream : TStream):boolean; - Fills up the stream with data procedure SaveToStream(Stream : TStream); - Saves all variables, streams and Graphics to a stream. procedure SaveToFile(FileName : String); - Saves all variables, streams and Graphics to a file. procedure SaveToString(out S : String); - Saves all variables, streams and Graphics to a string. function LoadFromStream(Stream : TStream):boolean; - Loads all variables, streams and Graphics from a stream. function LoadFromFile(FileName : String):boolean; - Loads all variables, streams and Graphics from a File. function LoadFromString(S : String):boolean; - Loads all variables, streams and Graphics from a string. function Stream2String(Stream1: TStream;var Mystring:string): boolean; procedure String2Stream(var String2BeSaved:string; Stream1: TStream); procedure
Variant2Stream(var VR:variant; Stream1: TStream);
Items : Variant - Get the value (indexed).
Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi |
Zip | |
MREW 1.0 Authors: Primoz Gabrijelcic and Amine Moulay Ramdane Click here to download the zip file: Zip Description: MREW lock(multiple-readers-exclusive-writer lock) that works across processes and threads.
Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi |
Zip | |
Parallel Sort Library 3.04
Author: Amine Moulay Ramdane Description: Parallel Sort Library that supports Parallel Quicksort, Parallel HeapSort and Parallel MergeSort on Multicores systems. Parallel Sort Library uses
my Thread Pool Engine and sort many array parts - of your
array - in parallel using Quicksort or HeapSort or
MergeSort and after that it finally merge them - with the
merge() procedure - I have implemented a Parallel hybrid divide-and-conquer merge algorithm that performs 0.9-5.8 times better than sequential merge, on a quad-core processor, with larger arrays outperforming by over 5 times. Parallel processing combined with a hybrid algorithm approach provides a powerful high performance result. The best case complexity of
ParallelSort using mergesort is: p: is the number of cores So, why it scales to 3.8x
with strings and only 3x with integers on a quad cores ? The reccurence equation of the complexity of mergesort is: T(n) = 2 * T(n/2) + n cause it take O(n) for the merging part. It gives: T(n) = 2 * T(n/2) + n = 2 (2T(n/4) +n/2) + n =4T(n/4)+n+n =4T(n/4)+2*n =4 (2T(n/8) +n/4) + 2*n =8T(n/8)+n+2n =8T(n/8)+3*n =2k T(n/2^k) + k*n We want: n/2^k = 1 n = 2^k log n = k so the reccurence equation gives: = n*T(1) +n*log(n) = n+ (n * log(n)) So the mergesort complexity in the best case and in the worst case is: n * log(n) But the complexity of the quicksort in the worst case is: T(n)= n + T(n-1) it gives: T(n) = n + (n-1) + T(n-2) T(n) = n + (n-1) + (n-2)+ T(n-3) T(n) = 1 + 2+ 3+.+N .T(n) = O(n^2) And Quicksort in best case
performance is: Parallelizing the Sorts One way to parallelize the sorts is:
Note that the merge operation is a reduction operation ! I have done some
scalability tests on my parallelsort library and i have
come to the conclusion that parallel heapsort is better
on scalability than parallel quicksort cause the P part
(of the Amdahl equation) is bigger in parallel heapsort And please look at test.pas a parallel quicksort on many cores - compile and execute it...
Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi |
Zip | |
Distributed Reader-Writer Mutex 1.13
Click
here to download the zip file: Zip I have provided you with the source code, please take a look at the source code to understand better.The Object Pascal Distributed Reader-Writer Mutex is based on the following C++ Distributed Reader-Writer Mutex by Dmitry Vyukov, read more here: You have four methods: procedure wlock; // same as
EnterWriteLock of TOmniMREW Here is some scalability
numbers:
Operating Systems: Win and Linux (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi And inside defines.inc you can use the following defines: {$DEFINE CPU32} for 32 bits systems {$DEFINE CPU64} for 64 bits systems {$DEFINE TOmniMREW} to use
Omnithread MREW |
Zip | |
Parallel BucketSort 1.05
Author: Amine Moulay Ramdane Parallel BucketSort. Bucket sort is not a sorting algorithm itself, rather it is a procedure for partitioning data to be sorted using some given sorting algorithm—a ”meta-algorithm” so to speak. Bucket sort will be better, when elements are uniformly distributed over an interval [a, b] and buckets have not significantly different number of elements. bucketsort sequential best
case computational complexity using quicksort is = p ×
(n/p) log(n/p) = n log(n/p) And please look at test.pas a parallel bucketsort on many cores - compile and execute it...
Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi |
Zip | |
Parallel Quicksort 1.09
Author: Amine Moulay Ramdane Parallel Quicksort using the median-of-three.. In this new version i have changed the partition() function and also i have used the median of three method so that it avoids the worst case performance. Parallel Quicksort is an
implementation of the median-of-three that gives almost
10% better speed.
Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi use -DDelphi |
Zip | |
Parallel implementation of Conjugate Gradient Linear System Solver 1.02
Author: Amine Moulay Ramdane The Parallel implementation of Conjugate Gradient Linear System Solver that i programmed here is designed to be used to solve large sparse systems of linear equations where the direct methods can exceed available machine memory and/or be extremely time-consuming. for example the direct method of the Gauss algorithm takes O(n^2) in the back substitution process and is dominated by the O(n^3) forward elimination process, that means, if for example an operation takes 10^-9 second and we have 1000 equations , the elimination process in the Gauss algorithm will takes 0.7 second, but if we have 10000 equations in the system , the elimination process in the Gauss algorithm will take 11 minutes !. This is why i have develloped for you the Parallel implementation of Conjugate Gradient Linear System Solver in Object Pascal, that is very fast. You have only one method to
use that is Solve() In the method of conjugate
gradients the residuals are not used as search
directions, as in the steepest decent method, cause
searching can require a large number of iterations as the
residuals zig zag towards the minimum value for
ill-conditioned matrices. But instead conjugate gradient
method uses the residuals as a basis to form conjugate
search directions . In this manner, the conjugated
gradients (residuals) form a Jacobi serial complexity is O(N^2) and Conjugate gradient serial complexity is O(N^3/2). Please look at the test.pas
example inside the zip file, compile and execute it... Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freepascal.org/ Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... -dUnix for Linux,MacOSX etc. Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi And inside defines.inc you have two defines: {$DEFINE CPU32} for 32 bits systems {$DEFINE CPU64} for 64 bits systems |
Zip | |
|
Zip | |
ParallelZlb Compression library 1.1
Author: Amine Moulay Ramdane Parallel Compression library using the Zlib algorithm and my Thread Pool Engine. - Now my ParallelZlb gives
5% better performance than Pigz.
Operating Systems: Win , Linux and Mac (x86). Note: to be able to port to Linux and Mac OSX you have to compile the dynamic libraries... Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... -dUnix for Linux,MacOSX etc. Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi |
Zip | |
Parallel Hashlist 1.48
Authors: Amine Moulay Ramdane(Parallel
parts) and Barry Kelly (HashList). Operating Systems: Win , Linux and Mac (x86). Description: A parallel HashList with O(1) best case and O(log(n)) worst case access that uses lock striping and lightweight MREWs(multiple-readers-exclusive-writer) , this allows multiple threads to write and read concurently. also parallelhashlist maintains an independant counter , that counts the number of entries , for each segment of the hashtable and uses a lock for each counter, this is also for better scalability. I have tested ParallelHashlist with four threads on a quad core and it's giving a perfect scaling on both reads and writes. Note: When i have done those benchmarks , there was not enough/much items organized as a self-balancing tree in the individual chains of the hashtable, so , almost all the items was found and inserted in O(1) , so the parallel part in the Amdahl equation was not much bigger compared to to the serial part. But you will notice in pratice that as soon as you will have more items on the chains of the Hash table , organized as self-balancing tree, with a worst case log(n) , the parallel part will become bigger in the Amdahl equation and you will have better scalability. Parallel Hashlist was
updated to version 1.44 , In the previous version i have
set the number of lightweight
MREWs(multiple-readers-exclusive-writer) to 128 but i
have decided to change that in version 1.44 so that
you can give a variable number of MREWS, this will scale
better and now the constructor will look like this: and please pass a hashsize and the number of mrews in power of 2 to the constructor by using the shl operation for example like this
Required FPC switches: -O3 -Sd -dFPC -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005 |
Zip | |
Linear programming modeling examples in Object Pascal Click here to
download the zip file: Zip Operating Systems: Win , (x86). Description: Linear programming modeling examples in Object Pascal. Please look inside the zip at the example SP.pas (shortest-path problem) in Object Pascal, i have provided you with the LPSolve library, but the examples that i have included do generate and MPS file , so you can use a faster software than LPSolve , example SCIP or CLP from COIN-OR , and just pass them the MPS ouput file that the LPSolve library does generate and they will execute them without any problem... Please look more information here: Linear Programming.
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi |
Zip | |
Lockfree MPMC and SPMC fifo queues version 1.13 Click
here to download the zip file: Zip Operating Systems: Win , Linux and Mac (x86). Description: Lock-free SPMC algorithm to
handle queue FIFO proposed by Amine Moulay Ramdane, use
only single CAS on pop and no CAS on push. You can use it
in a work-stealing manner with a local queue for each
server thread to optimize for more throuput and minimize
contention. I have done some
acalability tests and it's not scaling cause when you are
using a single thread some variable are updated on the
L1 cache but using multiple threads those variables
are loaded from the L2 cache and it's more expensive to
load them from the L2 cache. But even though
lockfree_mpmc is not scalable, you can
increase the P (parallel) part by doing more of the same:
Increase the volume of data processed by the P part (and
therefore the percentage p of time spent in computing).
This is Gustafson's Law and you will get more
scalability. Please look more information here: Lock-free MPMC.
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ -DDelphi |
Zip | |
Lockfree MPMC and SPMC priority FIFO queues version 1.1
Author: Amine Moulay Ramdane Operating Systems: Win , Linux and Mac (x86). Description: Lock-free MPMC and SPMC priority FIFO queues. They use 0(1) on enqueue and 0(3) worst case on dequeue
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ |
Zip | |
FIFO MPMC Queue Click
here to download the zip file: Zip Operating Systems: Win , Linux and Mac (x86). Description: Parallel FIFO MPMC queue
algorithm that uses a spinlock and an exponential
backoff. Please look at the benchmarks against lockfree fifo queues: FIFO MPMC queue.
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
|
Zip | |
An M/M/n queuing model simulation with Object Pascal and my Thread Pool Engine - version 1.02
Author: Amine
Moulay Ramdane It's harder and sometimes impossible to get analytical results about waiting times and queue length for general interarrival and service distributions; so, it's important to be able to estimate these quantities by observing the results of simulation. It's very easy in Object Pascal to simulate a sequence of arrival times with a given interarrival distribution. Look at the examples MM1.pas( M/M/1 queuing model) and MMn.pas(M/M/n - n: number of servers -) inside the zip file: --------------------------- InterArrivals:=TExponentialDistribution.Create(420623,1.0/3.0); ServiceTimes:=TExponentialDistribution.Create(220623,1.0/4.0); currtime:=0.0; for i:=1 to simnumber do begin obj:=TJob.create; obj.simnumber:=simnumber; obj.number:=i; currtime:=currtime+InterArrivals.Sample; obj.ArrivalTime:=currtime; obj.Servicetime:= ServiceTimes.sample; TP.execute(myobj.myproc1,pointer(obj),NORMAL_PRIORITY); end; ------------------------------------------- Here we have the InterArrivals object and ServiceTimes object and we are calling InterArrivals.Sample to get our samples from the Exponential Distribution. After that we are calling myobj.myproc1 to simulate our M/M/1 queuing model... If you look at MMn.pas , you will see that the arrival rate is: 3 and the service rate is 4 , so, this will give us a theoretical value of 1/(4-3) = 1 for one server, and the Object Pascal simulation gave me 1.02 for one server. Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freepascal.org/ Operating Systems: Win , Linux and Mac (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ |
Zip | |
WinMenus version 1.22
Author: Amine
Moulay Ramdane Drop-Down Menu widget using the Object Pascal CRT unit. Please look at the test.pas example inside the zip file. Use the 'Delete' on the
keyboard to delete the items Language: FPC Pascal v2.2.0+ / Delphi 7+: http://www.freepascal.org/ Operating Systems: Windows, Mac OSX , Linux , Unix...
-Sd for delphi mode.... -dUnix for Linux , Unix and Mac OSX -dWindows for windows Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi switch For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ |
Zip | |
Synch module version 1.04
Authors: Amine Moulay Ramdane,Marcel van Brakel ,Olivier Sannier ,Matthias Thoma,Florent Ouchet.Robert Marquardt.
The following classes have been added to the Synch module: TCriticalSection,TMutex,TSimpleEvent,TSemaphore,TMultiReadExclusiveWrite. Note: I have modified a
little bit the TJclMultiReadExclusiveWrite from the Jedi
code Library and rename it TMultiReadExclusiveWrite.
TCriticalSection,TMutex,TSimpleEvent,TSemaphore are not
from JCL Operating Systems: Windows, Mac OSX , Linux , Unix...
-Sd for delphi mode.... -dUnix for Linux , Unix and Mac OSX -dWindows for windows Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi switch For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ |
Zip | |
AWE version 1.25
Why the 2 GB limitation on the Win 32bits systems ? My AWE object pascal module is here, it allows your application to use up to 64GB of RAM. And here is the public interfaces of TAWEMem and TAWEStream classes, i have implemented the following methods: TAWEStream = class public Memory:pointer; constructor Create(ulBytes:
longint); published property TotalMem:int64
read gettotalmem; TAWEMem = class Note: To be able to use AWE you have to set the user rights correctly, so, go to: Control Panel -> Administrative tools -> Local Security Policy -> User Rights Assignment and give 'Lock pages in memory' right to the user that wants to use AWE and reboot the system.. Every TAWEMem object can go
up to 4GB of memory and every TAWEStream can go up to 2GB
of memory, and you can go up to 64GB of memory !
Operating Systems: Windows 2000 and up (x86). Required FPC switches: -O3 -Sd -dFPC -dWin32 -dFreePascal -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+ |
Zip | |
Threadpool 1.41 (stable version)
Author: Amine Moulay Ramdane Operating Systems: Win , Linux and Mac (x86).
Thread Pool Engine. Please read an article that i wrote about my Threadpool engine: article. The following have been added:
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
Note: testpool.pas is a parallel program of a Matrix multiply by a vector that uses SSE+ and it requires Delphi 5+. test.pas and test_thread.pas works with both FreePascal and Delphi.
|
Zip | |
Threadpool with priority 1.31 (stable version)
Author: Amine Moulay Ramdane Operating Systems: Win , Linux and Mac (x86).
Thread Pool Engine. The following have been added: - You can give the following priorities to jobs: LOW_PRIORITY - A lock-free queue for each worker thread and it uses work-stealing - for more efficiency - - Enters in a wait state when there no is job in the queue - for more efficiency - - You can distribute your jobs to the workers threads and call any method with the threadpool's execute() method. - Uses 0(1) on enqueue and 0(3) worst case on dequeue. Look into defines.inc there
is many options:
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
Note: testpool.pas is a parallel program of a Matrix multiply by a vector that uses SSE+ and it requires Delphi 5+. test.pas and test_thread.pas works with both FreePascal and Delphi.
|
Zip | |
Parallel Matrix demo
Operating Systems: NT/2000/XP and above. Description: Parallel program of Matrix multiply by a vector that uses SSE+ and my Lock-free Threadpool. Please look at the example testpool.pas inside the zip file... This demonstration does use
SSE+ , so if you don't have SSE support it will not work.
It does work with P4 and above. -Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
|
Zip | |
LockfreeUtils
Operating Systems: NT/2000/XP and above Description: TLFMemoryStream is like the Freepascal and Delphi TMemoryStream, but it's Lock-free: it mean that it's scalable and ready for multicores. Use the Lock-Free TLFMemoryStream to store data in a dynamic memory buffer that is enhanced with file-like access capabilities. TLFMemoryStream provides the general I/O capabilities of a stream object while introducing methods and properties to manage a dynamic memory buffer. Memory streams are useful as intermediary objects that can hold information as well as read it from or write it to another storage medium. They provide a useful format for comparing the contents of streams, or for manipulating data that is stored in a less accessible medium. The zip file also include TAsyncFileStream - asynchronous file input/output in Windows NT. Please read AFS.txt inside the zip.
-Sd for delphi mode.... Required Delphi switches: -DMSWINDOWS -$H+ For Delphi 5,6,7 use -DDelphi For Delphi 2005,2006,2007,2009,2010+ use the switch -DDELPHI2005+
|
Zip | |
API module (By Aldo Calpini) version 0.58
With this module you can import and call arbitrary functions from Win32's Dynamic Link Libraries (DLL). API module for ActivePerl 5.10: Zip Operating Systems: Windows 95/98/Me/NT/2000/XP How to install: Please read the readme file inside the zipfile.
|
.Zip | |
AdvNotify module (By Amine Moulay Ramdane) version 1.32
With this object oriented Perl module you will be able to monitor the changes on your directories, this allows your Perl application to respond to changes in the file system, such as new file and/or directory creation, renaming, size, attribute, time, security-descriptor changes etc. Also, with AdvNotify you can run multiple threads from inside your Perl application to monitor the file system changes and you will be notified of wich file has been changed. The AdvNotify's interface has been carefully designed to be very easy to use. Note: AdvNotify does use asynchronous completion to receive notification from the WinNT OS (no wasting CPU time "polling"), hence AdvNotify is very efficient. This module needs the API module, please download and install the API module before installing AdvNotify. Perl: ActivePerl: 5.0050x, 5.6 or higher. Operating Systems: Windows NT/2000/XP How to install: Read the readme file inside the zip. Documentation: After installing AdvNotify, click on your \perl\html\index.html and scroll down to the Win32 links and you will find it there, or you can also access it directly from \perl\html\lib\win32\AdvNotify.html or from Start => Programs => ActivePerl (documentation). |
Exe |
|
NTFS module (By Amine Moulay Ramdane) version 1.0
Please take a look at the documentation.. Perl: ActivePerl: 5.0050x, 5.6 or higher. Operating System: Windows 2000/XP Note: This module needs the API module, please download and install the API module before installing NTFS. |
Zip | |
MemMap module (By Amine Moulay Ramdane) version 2.12
Perl: ActivePerl: 5.0050x, 5.6 or higher. Operating Systems: Windows 95/98/Me/NT/2000/XP Note: This module needs the API module, please download and install the API module before installing MemMap. |
Zip | |
ISync module (By Amine Moulay Ramdane) version 1.21
This object oriented Perl module implements the Win32 synchronisation mechanisms: Semaphore,Mutex, Event,Timer objects. Perl: ActivePerl: 5.0050x, 5.6 or higher. Operating Systems: Windows 95/98/Me/NT/2000/XP Note: This module needs the API module, please download and install the Perl API module before installing ISync. |
Zip | |
More to come,Thank you. |