On 06/02/2015 23:03, Michael Black wrote:
Hi Mike,
<snip>
A suggestion for a better test method might be to run it on a collection
of .WAV files rather than running it in a loop with just one .WAV file.
You can invoke jt9 with a list of .WAV files which can be generated from
a shell glob for example given a directory 'test_dir' containing a
collection of representative .WAV files:
jt9[_omp] -p 1 -d 3 -w 2 - m 3 test_dir/*.wav
there is no need to run this in a loop if you have sufficient .WAV
files. Also this removes the start up and close down overhead of jt9
which is more realistic since in WSJT-X jt9 runs continuously rather
than being restarted for each decode cycle.
This reduces your test to:
TimeMem-1.0 jt9_omp -p 1 -d 3 -w 2 -m 3 test_dir\*.wav | grep Elapsed |
cut -f2 -d:
No driving program required.
Also the file timer.out will have accumulated profiling data for the
complete run.
Note that any test using jt9 in command line mode will give very skewed
results for elapsed time since there is a considerable time consumed
reading the .WAV file from disk which is not a factor in real running
with WSJT-X where the sample data is acquired into memory in real time
before the decode cycle starts. Also jt9 in command line mode does
symbol spectra calculations while reading the .WAV file data which in
WSJT-X are calculated in real time before the decode cycle starts. This
means that any percentage gains you report will represent considerably
larger gains in decoding time in WSJT-X.
> #include <stdio.h>
> #include <math.h>
>
> int main(int argc,char *argv[])
> {
> char cmdbuf[4096];
> double total=0;
> int n=0;
> int nthreads=1;
> char buf[4096];
> char *cmd="jt9";
>
> if (argc > 1) {
> nthreads = atoi(argv[1]);
> }
> if (nthreads > 0) {
> cmd = "jt9_omp";
> }
> printf("Testing %s with %d thread%c\n",cmd,nthreads,nthreads==1?'
> ':'s');
> sprintf(cmdbuf,"TimeMem-1.0.exe %s -p 1 -d 3 -w 3 -m %d
> 130610_2343.wav | grep Elapsed | cut -f2 -d: >doit.txt",cmd,nthreads);
> while(1) {
> system(cmdbuf);
> FILE *fp=fopen("doit.txt","r");
> fgets(buf,sizeof(buf),fp);
> fclose(fp);
> double sec = atof(buf);
> ++n;
> total+=sec;
> double avg = total/n;
> if (sec > avg*1.5) {
> printf("\nlong run %.2f avg=%.2f\n",sec,avg);
> }
> printf("%d sec=%.2f avg=%.2f\r",n,sec,avg);
> fflush(stdout);
> }
> }
>
73
Bill
G4WJS.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel