diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/frameworks/30 scalapack/main.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/frameworks/30 scalapack/main.c')
-rw-r--r-- | meson/test cases/frameworks/30 scalapack/main.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meson/test cases/frameworks/30 scalapack/main.c b/meson/test cases/frameworks/30 scalapack/main.c new file mode 100644 index 000000000..ca01977ec --- /dev/null +++ b/meson/test cases/frameworks/30 scalapack/main.c @@ -0,0 +1,34 @@ +#include <stdio.h> + +// #include <mkl.h> +// #include <mkl_scalapack.h> +// #include <mkl_blacs.h> + +extern float pslamch_(const int *, const char *); +extern void blacs_pinfo_(int *, int *); +extern void blacs_get_(const int *, const int *, int *); +extern void blacs_gridinit_(int *, const char *, const int *, const int *); +extern void blacs_gridinfo_(const int *, int *, int *, int *, int *); +extern void blacs_gridexit_(const int *); +extern void blacs_exit_(const int *); + +int main(void){ + +int myid, nprocs, ictxt, mycol, myrow, npcol=2, nprow=2; +const int i0=0, i1=1, in1=-1; + +blacs_pinfo_(&myid, &nprocs); +blacs_get_(&in1, &i0, &ictxt); +blacs_gridinit_(&ictxt, "C", &nprocs, &i1); + +blacs_gridinfo_(&ictxt, &nprow, &npcol, &myrow, &mycol); + +float eps = pslamch_(&ictxt, "E"); + +if (myrow == mycol) printf("OK: Scalapack C: eps= %f\n", eps); + +blacs_gridexit_(&ictxt); +blacs_exit_(&i0); + +return 0; +}
\ No newline at end of file |