New Services from MineQuest

July 1st, 2009

With the soon to be released version 2.4 of WPS, MineQuest will be offering a couple of new services to appeal to both the small and midsized organization as well as the large companies who has migrated from SAS to WPS. We will offer these services first on the Windows platforms and then on the Unix/Linux platforms at a later date. Here are the services that we are offering.

WPS Fast Start

With the MineQuest Fast Start service, we will help you be up and running with WPS more quickly and more reliably. Our Fast Start Service is designed so that you can begin running your existing SAS code without hassles and knowing that our approach is based on extensive experience.

Installation Optimization

With our Fast Start Service, we will provide consulting to help you get the most out of your hardware platform. We will review your system, provide recommendations so that your organization can get the most out of your hardware investment when using the WPS System.

Remote Support, Development and Troubleshooting Assistance

MineQuest can provide support for your WPS investment by providing expertise in the SAS language, assistance in production implementation, coding and report development. If you have limited in-house expertise or resources, we can provide development, maintenance, and production support to your organization.

Support Services

Either long term or short term, MineQuest can help you by providing WPS customers with extensive information and product support. These include:

    • · Language Support and Development Services
    • · Production Implementation
    • · ETL and Report Programming
    • · WPS coding advice for best practices

For those organizations who don’t have in-house support expertise, MineQuest can fill that role with easy and affordable support and development contracts that help you control your cost and get the most ROI from your WPS licenses. Service packages are available starting at 12 hours of support a month.

 

Growing Market Share

July 1st, 2009

Some interesting tidbits I wanted to share with some readers. In the latest SAS Business Report, there’s a link to an interview with Anne Milley of SAS. Ms. Milley talks a little bit about SAS deployment and states, "…including 91 of the top 100 FORTUNE Global 500 companies." I thought at one time that SAS was actually deployed at 98 or 99 of the Fortune 100 companies. If so, we’re seeing some significant erosion in the penetration of SAS in really large corporate environments.

I can say with certainty that WPS has been successfully installed in a number of Fortune 100 Companies and perhaps that has something to do with these numbers. The other factor of course, is price. It’s very hard if you are in the retail industry, auto manufacturing industry or even banking, to continue justifying exorbitant license fees.

I’m not a mainframe guy and haven’t developed on these machines in years but I have a number of friends and colleagues who still do. Often, they use SAS or WPS mainly for ETL, MXG, or summarization of data from a database or VSAM for download to servers. I think this realization may also be driving interest in WPS on the mainframes.

I think we’re in the final stretch before the next release of WPS (v2.4) and I’m sure that many companies will be impressed with the product. It’s safe to say that there’s something in this release for everybody and I doubt that anyone will be disappointed.

Stay tuned… more to come…

 

Links for Friday, June 12th, 2009

June 12th, 2009

Here are two interesting open source applications that you may want to take a look at for your business or use in your consulting business. I can see both of them being effective and money saving applications for both the consultant as well as the client.

First, DimDim is a web conferencing application that is open source. You can use DimDim in a virtual machine as well. They do have a VM that is downloadable (so does JumpBox). That’s rather interesting because you can run DimDim on Amazon’s EC2 only when you need to have a conference and at a cost of about twenty cents an hour. Compare that to WebEx’s price of close to $500 a year.

Another interesting tool that I expect to play with over the weekend is SnapLogic. SnapLogic is a data integration application that is open source also. There are VM’s available for SnapLogic so you can play around with it and not worry about corrupting your system. This would be a good application to start with if you have been thinking about SAS Institute’s DI Studio. If you need to perform a lot of ETL type of work, these kinds of apps save a lot of time and SnapLogic could also save your company a lot of cash.

 

Technorati Tags: ,,,

And more documentation…

June 11th, 2009

I’ve been working on updating and standardizing the MQ Macro Library so it is not dependent on the use of a .EXE file (or DLL’s) in running applications. The reason for doing this is to make the code more portable across platforms. By relying on WPS for implmenting such things as FileExist and calling batch files, it’s easier to make the code portable. The idea is to be able to have the library run on Windows, Linux and Unix platforms without any code changes.

I did have one of those “ah… hah…” moments when modifying the XML macros. I find that I, as a developer think in terms of tool sets and how I develop tools. I pretty much write a tool set to solve a specific problem and have this bad habit of not generalizing it beyond the task for which I wrote it. But looking at the code for XML2WPS (which reads in a tabular xml file), it dawned on me that I could probably make use of the threading library in MPExec to greatly increase the speed of reading in the XML. This is something I want to pursue in the next release of the Macro Library and it’s kind of exciting to be able to use an existing tool set to create a new tool set.

Anyway, I’m adding documentation for the XML2WPS macro so its use is understandable. That should only take another day. I do want to modify the Bridge to R so that it’s not dependent on any external programs as well. To be able to do this however, I might have to make the Bridge to R run in a non-parallel mode. I need to do a bit more research on this before I can really decide what is possible.

MPExec Documentation Preview

June 6th, 2009

We have the first draft of the documentation for MPExec. MPExec is a software add-in that allows for multi-threading WPS applications. I’ll place the document out on the MineQuest website for anyone interested in taking a look at it. Be forewarned, it is a first draft so expect some grammar and spelling issues.

The documentation is pretty short, only five pages long but you can easily read and understand what is required to run MPExec. Adding threading to a WPS program using MPExec is easy to do. Simply add a few statements to existing code segments that are good candidates for concurrent processing and you can dramatically reduce your applications execution time.

Right now, we are planning on including it as part of the MineQuest MacroLib. You can get the MacroLib included for free if you choose to license WPS (either Windows Desktops or Windows Servers) from MineQuest directly. The MacroLib includes some other useful applications such as XMLRead and XMLWrite, and the Bridge to R for WPS. We also plan on supporting MPExec on the Unix/Linux platforms in the future and we’ll announce that availability when we are thoroughly done testing.

If you’ve licensed WPS from WPC directly or some other reseller, we can offer an annual license for the MacroLib so you have access to all the goodies as if you had purchased directly from us. Right now, the pricing for the MacroLib is $119 for the desktop version. The pricing for the Windows Server version is set at 15% of the annual WPS license fee.

The documentation for MPExec can be found at: http://www.minequest.com/Misc/mpexec_users_guide.pdf

MPExec requires WPS release 2.3.5. By the end of June, we expect to be able to begin fulfilling phone orders. Make sure you check our website for an announcement!

MPExec – Everything but the Documentation

June 2nd, 2009

I finally finished the programming for MPExec and have the runtime notes for the log looking just the way I want. It’s a nice little system to run concurrent WPS processes on a windows work station or server and get full utilization of your processor cores. I have a log file that you can view where we are running eight processes on four cores. You will want to look at the last thirty five or forty lines in the log to see the summary of the multi-threading for all eight processes. You can view the log at: http://tinyurl.com/mdnhej

Over the next few days, I’ll be writing the documentation for MPExec. Installation is pretty easy and the only configuration required is to write a few lines to your autoexec.sas file. Any code changes to your existing programs will be pretty simple. There’s only four new commands so you can multi-thread your WPS program without much work.

Currently, MPExec requires WPS version 2.3.5 which is the latest release. We use some new functionality in this release to get our code to execute the way we want and not have to use an external DLL or .EXE file. Hence the requirement for the latest release of WPS.

We also intend to get MPExec running in the Unix and Linux platforms as well. We will announce that availability at a later date.

Finally, we intend to include MPExec as part of the macrolib that we include when you license WPS from MineQuest. The new macrolib will include the Bridge to R for WPS, XMLRead and XMLWrite as well as MPExec. If you have licensed WPS through another reseller or through WPC directly, we can sell you a license for the MineQuest macrolib separately. Contact us directly for pricing.

 

Benchmarks WPS in a Threaded Environment

June 1st, 2009

I finally completed the writing of MPExec over the weekend. MPExec is the name of the macro’s that create an environment where you can run multiple threads or processes at the same time. All-in-all, I have maybe 40 hours into the project and I’m quite satisfied with the results. I’m sure it would have normally taken me more than 40 hours but I was able to piggy-back on existing code that I had written with the Bridge to R.

I decided to make MPExec as portable as possible. Thus, I didn’t use any outside exec files that I used in the Bridge to R to do such things as check for file existence and to spawn new threads Btw, FileExist is a new function in WPS 2.3.5 and works great! The other thing that I see in version 2.3.5 is that I can shut off log messages/notes/source and not have the log fill up with blank lines as in the earlier releases. This is fantastic and allows my logs to look professional without lots of white space.

I don’t think I can get the code to execute any faster than it does on my development machine when executing multiple threads. So let’s take a look at some benchmarks. Below is a table that shows how well a Quad-Core PC can execute multiple WPS threads. All times are in minutes and seconds.

 

1,000,000

Records

2,000,000

Records

5,000,000

Records

Threads

Par / Seq

Par / Seq

Par / Seq

2

0: 18 / 0:22

0:18 / 0:28

0:25 / 0:41

4

0:19 / 0:44

0: 20 / 0:54

0:42 / 1:28

6

0:22 / 1:06

0:30 / 1:20

0:58 / 2:01

8

0:28 / 1:44

0:34 / 1:56

2:16 / 2:49

A brief explanation so the above table makes a little sense is in order. I ran each test three times and took the average time for all three runs and rounded to the highest value. I developed the test programs so that one thread was creating the data and then performing a SORT, MEANS and FREQ on the data. The other thread that executed was always a UNIVARIATE and a CORR using a permanent data set with 600,000 records. I kept this balance of creating temp data sets and using permanent data sets when I had more than two threads. So, when running four threads, I had two CORR and UNIVARIATES running and two SORT, MEANS and FREQ running. With six threads, I had three of each and with eight threads, I had four of each running. For an example of the code, see the bottom of the blog.

I ran the test times sequentially as well. This gives us the time that it would take to run the programs without threading. Comparing the Parallel times with the sequential times, we can get an idea of how much faster we can run our code using threading.

One thing to note. Since we are always running the CORR and UNIVARIATES using 600,000 records (and from a different drive array) these times tend to be pretty constant. This is true especially with two and four threads with one or two million records. The time differences start to disappear appear when we start using 5,000,000 records and six or eight threads. The test machines temp drive(s) start to become overwhelmed and are I/O bound.

With a fast drive array for your work space (temp files), you can really get some amazing decreases in your execution times by using threading. The system I’m running these tests on has a two drive RAID-0 setup for temp space. If I was to add an additional drive to that array, I’m sure the execution times with eight threads and five million records would be much lower… perhaps by 30 to 40%.

WPS Code for benchmarking two threads.

%MPExec;

%let iter=1e6;

%startthread(Job_A);

     data a;
       do ii=1 to &iter;
       a=ranuni(0);
       b=ranuni(0);
       c=ranuni(0);
       d=ranuni(0);
       e=ranuni(0);
       f=ranuni(0);
       g=ranuni(0);
       h=ranuni(0);
       i=ranuni(0);
       aa=round(a*10,1);
       output;
       end;
    run;

    Proc sort data=a; by ii; run;

    proc means data=a;
    run;

    Proc freq data=a;
    tables aa;
    run;

;;;;
%stopThread;

%startThread(Corr_Run);

    libname tstdata ‘c:\wpstestdata\’;

    Proc univariate data=tstdata.d;
    var j k l;
    run;

    Proc corr data=tstdata.d;
    run;

;;;;

%stopThread;

%WaitForThreads;

 

Implementing Threaded Processes in WPS

May 28th, 2009

I’ve been working the last few days on creating code that will allow a WPS user to run parts of a WPS program in parallel. I’ve made a lot of progress and it seems to be working fine. It needs a lot of cleaning up and some tuning yet, but I’m fairly satisfied with the progress.

The good news is that it’s fairly easy to implement in your existing code. Simply adding a few lines of code before and after each segment will spawn a new thread that is executed separately. At the end of all the threads execution, we read in the LOG and LST files so the output appears in the Hosts programs log and list files.

There are a couple of nifty attributes that are worth mentioning. First, you can pass a macro variable’s value to the spawned program. Secondly, you have access to all the work files that were created at the end of all the threads from your Host program. This way, you can use the temp data sets in future steps and PROCS.

Performance seems pretty decent on my work station which is a Quad-Core with 8GB of RAM. Once I get the code cleaned up and documented, I’ll run some benchmarks on a server. On my workstation however, running four tasks with 10 million records each in parallel took 42 seconds. Running these sequentially took 1:30 (mm:ss). When I upped that to five tasks with 10 million records and a different mix of PROCS and data steps, my sequential processing time took 2:37 (mm:ss) and time to run in parallel was 1:23. So you can see, there are some real potential performance increases available.

It will be interesting to see how well this can scale in terms of number of threads. I’m seeing that the larger the data set to be processed, the better the performance. I suppose this is reasonable when you consider that each thread must fire up another instance of WPS so that smaller threads are handicapped by the start-up and initialization of the system.

There are some ugly issues though. Log Analyzers are going to be confused with duplicate line numbers (each threaded processes will have line numbers that are also in other threaded processes) and making the log appear in such a way that it’s not just a mass of text that is hard to follow also needs to be addressed.

But these are things that are doable and I’ll provide some more information as time permits.

 

Code Constructs for Running WPS in Parallel

May 27th, 2009

In my last two blog posts, I’ve discussed some issues surrounding running WPS jobs in parallel. One thing that I feel is worth mentioning (and I see as a WPS Reseller) are the number of small servers that SAS runs on. Over the year, almost every server I see is either a single or dual-core processor model. The SAS licensing fees are so horribly high that companies cannot afford to (a) put the number of developers on a server that they would like to and (b) due the smaller size of the server, do the type of processing they would like to in their analysis and reporting groups.

Of course, more sanely priced software allows you to overcome these two hurdles and that’s where the ability to implement parallel processing in your code. Hence, with a larger server you can run more data and support more users by being able to utilize multiple cores.

In thinking about the code constructs, I want to make this as simple as possible to implement for any developer. The key to this is to minimize the number of new keywords that are introduced and to keep processing to a single machine (whether a desktop or server).

We can use something along the lines of ParallelR in the keyword constructs to implement running WPS jobs in parallel. Creating a Parallel WPS processing implementation is much easier than implementing the parallel R processing code. We already know such things as the name of the work directory and we can use workinit, workterm, and work to control the placement of the work libraries that will be spawned by the additional processes. Also, there’s much less code checking that has to take place for such things as file types and whether other programs also exist.

Since I want to reuse as much of my older code as possible, I’m going to frame my processing in a very similar manner. Consider the following code segments:

%ParallelWPS;

  %StartThread()

  Proc Sort data = mylib.dda0109;
    by descending avgbal;
  run;

  Proc Print data = mylib.dda0109(obs=50);
  run;

  %StopThread();

  %StartThread();

  Proc Sort data = mylib.dda0209;
    by descending avgbal;
  run;

  Proc Print data = mylib.dda0209(obs=50);
  run;

  %StopThread();

%WaitFor;

The above code spawns two parallel processes. Each new process is started with a %StartThread() call and ends with a %StopThread call. Let’s take a closer look at the keywords.

The Macro %ParallelWPS sets up the environment for parallel processing.

%StartThread() begins processing the WPS/SAS code for the parallel processing.

%StopThread() is an indicator of where the code breaks. In other words, everything between the code block %StartThread() and %StopThread() is executed in a single process.

%Waitfor simply waits for both of the programs to terminate and then reads in the log and lst files back to the master program.

One nice thing that can be added in the future to the ParallelWPS construct are parameters such as Priority=[Low/Normal/High] or Remote=[MachineName] to be able to control execution even more.

Using these keywords and this style of implementation, I think most users could eyeball their code and decide pretty easily which parts can be run in parallel. By using parallel processing for spawning threads for execution, the smart WPS developer can achieve huge performance gains in their SAS code and are able to purchase and utilize high performance hardware for their BI solutions.

 

Technorati Tags: ,,

Programs and Areas of Code that are Good Candidates for Parallelization

May 23rd, 2009

What parts of a production system or WPS program are good candidates for running in parallel? I touched on it a bit in the last posting but it’s worth talking about in more detail.

Programs that have a substantial data preparation for later processing are usually excellent candidates. Specifically, we are looking for programs and code, where it can be determined that it’s data output is not used by any other processes at the same time and thus can be run in parallel. Begin by looking for data steps and procedures such as PROC CIMPORT, PROC CPORT, multiple PROC SORTS, and PROC DATASETS where data is being indexed. Also, look for long running procedures and data steps as potential candidates. Often times, these can be broken into multiple groups and run simultaneously.

Another area that is ripe for parallelization are areas where there is lots of reporting and data file creation for export type data sets. That is, Excel or MS Access tables that are created for end users. If the data is processed using BY GROUPS, you can more than likely split these groups into separate threads for processing.

Determining what can be run in parallel can be tricky if you don’t take the time to really understand your programs code. Since WPS or SAS processes data in a top down fashion, take your time and eye ball your data to determine where natural distinctions take place. In other words, try to identify where code is being used to manipulate large amounts of data, where code is being used to analyze the data, and where the code is that is reporting the data. Based on these three processing segments, you can often rapidly determine what can be processed in parallel.

The other handy item to use is a log profiler or analyzer program. You can profile the log of an existing program and look at run times to determine where the greatest amount of time is being spent. There are a few macro programs available from SAS to help you do this and Savian has a log analyzer as well. The Savian log analyzer does not work with WPS at this time however.

So, there’s a few hints in how to get started to identify which programs and program segments are good candidates for running in parallel.