summaryrefslogtreecommitdiffstats
path: root/test cases/frameworks/30 scalapack/main.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/frameworks/30 scalapack/main.c
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/frameworks/30 scalapack/main.c')
-rw-r--r--test cases/frameworks/30 scalapack/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/test cases/frameworks/30 scalapack/main.c b/test cases/frameworks/30 scalapack/main.c
new file mode 100644
index 0000000..ca01977
--- /dev/null
+++ b/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