| 1 |
#include <stdio.h> |
| 2 |
|
| 3 |
// #include <mkl.h> |
| 4 |
// #include <mkl_scalapack.h> |
| 5 |
// #include <mkl_blacs.h> |
| 6 |
|
| 7 |
extern float pslamch_(const int *, const char *); |
| 8 |
extern void blacs_pinfo_(int *, int *); |
| 9 |
extern void blacs_get_(const int *, const int *, int *); |
| 10 |
extern void blacs_gridinit_(int *, const char *, const int *, const int *); |
| 11 |
extern void blacs_gridinfo_(const int *, int *, int *, int *, int *); |
| 12 |
extern void blacs_gridexit_(const int *); |
| 13 |
extern void blacs_exit_(const int *); |
| 14 |
|
| 15 |
int main(void){ |
| 16 |
|
| 17 |
int myid, nprocs, ictxt, mycol, myrow, npcol=2, nprow=2; |
| 18 |
const int i0=0, i1=1, in1=-1; |
| 19 |
|
| 20 |
blacs_pinfo_(&myid, &nprocs); |
| 21 |
blacs_get_(&in1, &i0, &ictxt); |
| 22 |
blacs_gridinit_(&ictxt, "C", &nprocs, &i1); |
| 23 |
|
| 24 |
blacs_gridinfo_(&ictxt, &nprow, &npcol, &myrow, &mycol); |
| 25 |
|
| 26 |
float eps = pslamch_(&ictxt, "E"); |
| 27 |
|
| 28 |
if (myrow == mycol) printf("OK: Scalapack C: eps= %f\n", eps); |
| 29 |
|
| 30 |
blacs_gridexit_(&ictxt); |
| 31 |
blacs_exit_(&i0); |
| 32 |
|
| 33 |
return 0; |
| 34 |
} |