[ltp] An "inverse" fan problem

Michael Keyl linux-thinkpad@linux-thinkpad.org
Wed, 25 May 2005 15:09:51 +0200


On Wednesday 25 May 2005 02:04, Jan Girlich wrote:

> What about posting this small test-program? If you tell me how to use it
> and how you did the temperature-check etc., I will test it on my R51
> 1.5GHz.
>

The following C-program can reproduce the effect, although it takes longer to 
reach the passive temperature (but the code is not very efficient of course). 
I have monitored the temperature as before.

Michael 

---------------------------

#include <stdlib.h>
#include <stdio.h>

/*
 gcc -o fan_test -fomit-frame-pointer -O3 -funroll-all-loops  -march=pentium-m 
-mfpmath=sse -lm fan_test.c
*/

#define MATDIM 1000
#define RUNS 100

int main() {

  double a[MATDIM][MATDIM], b[MATDIM][MATDIM];
  int i,j,k,n;

  for(n=0;n<RUNS;n++) {

    for(i=0;i<MATDIM;i++)
      for(j=0;j<MATDIM;j++) {
	a[i][j] = drand48();
	b[i][j] = 0;
      }

    printf("%d, ", n);
    fflush(stdout);

    for(i=0;i<MATDIM;i++)
      for(j=0;j<MATDIM;j++)
	for(k=0;k<MATDIM;k++) 
	  b[i][j] += a[i][k]*a[k][j];

  }

}