#include <stdio.h>      /* standard I/O                */
#include <string.h>     /* for strcpy - 3 occurrences  */
#include <stdlib.h>     /* for exit   - 1 occurrence   */
#ifdef enable_threading
#include <pthread.h>
#endif

double lscompress,compress1;

int Compress1()
{
	int i;
	FILE *fp;

	system("sh compressiondir/cleanup.run");

	printf("\n\tPreparing test, this will only use about 6MB of disk space\n");
       fp = fopen("compressiondir/arch1.txt", "w");
#ifdef enable_threading
#pragma omp parallel for
#endif
	        for(i=0; i<1333; i++) {
        fprintf(fp, "\nab cdefg hijklmno pqrstuvwx yz12345 678 9 0,.;:><?][}{'");
        fprintf(fp, "\n181 818haha8hasui yc-7f6734 hbbbbbjkasd. ..,mjasdu,.okah?.j awhahdn ayqoclpi'[");	
	}
	fclose(fp);
	printf("\tdone.\n");
	printf("\tTest running...\n");
	system("sh compressiondir/prepare.run");
        gettimeofday(&starttime, NULL); 
#ifdef enable_threading
#pragma omp parallel for
#endif 
        for(i=0; i<2; i++) {
	system("sh compressiondir/tar.run");
	system("sh compressiondir/gz.run");
	system("sh compressiondir/bzip2.run");
	}
        gettimeofday(&endtime, NULL);
	
	system("sh compressiondir/cleanup.run");

        te0=((double)(endtime.tv_sec*1000000-starttime.tv_sec*1000000+endtime.tv_usec-starttime.tv_usec))/1000000;
        compress1 = 3 * 3 / te0;
        printf("\n\tTest #1:\tCompression/archiving test tar/gzip/bzip2: %lf/s\n", compress1);
return compress1;
return 0;
}
