From c93e7828c5640e675189e807d0437ceac47d1733 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 17 Feb 2022 22:29:53 +0100 Subject: [PATCH] Added qmckl_context_touch for benchmarking --- org/qmckl_ao.org | 12 +++++------- org/qmckl_context.org | 38 +++++++++++++++++++++++++++++--------- org/qmckl_point.org | 15 ++++++++++++--- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/org/qmckl_ao.org b/org/qmckl_ao.org index 91dfe05..1202117 100644 --- a/org/qmckl_ao.org +++ b/org/qmckl_ao.org @@ -5384,13 +5384,11 @@ qmckl_compute_ao_vgl_hpc ( switch (nucleus_max_ang_mom[inucl]) { case 0: - for (int64_t il=0 ; ildate += 1UL; + ctx->point.date += 1UL; + return QMCKL_SUCCESS; +} + #+end_src + ** Creation To create a new context, ~qmckl_context_create()~ should be used. diff --git a/org/qmckl_point.org b/org/qmckl_point.org index 0672d1c..08bda8c 100644 --- a/org/qmckl_point.org +++ b/org/qmckl_point.org @@ -318,8 +318,17 @@ qmckl_set_point (qmckl_context context, ctx->point.num = num; if (transp == 'T') { - memcpy(ctx->point.coord.data, coord, 3*num*sizeof(double)); + double *a = ctx->point.coord.data; +#ifdef HAVE_OPENMP + #pragma omp for +#endif + for (int64_t i=0 ; i<3*num ; ++i) { + a[i] = coord[i]; + } } else { +#ifdef HAVE_OPENMP + #pragma omp for +#endif for (int64_t i=0 ; ipoint.coord, i, 0) = coord[3*i ]; qmckl_mat(ctx->point.coord, i, 1) = coord[3*i+1]; @@ -328,8 +337,8 @@ qmckl_set_point (qmckl_context context, } /* Increment the date of the context */ - ctx->date += 1UL; - ctx->point.date = ctx->date; + rc = qmckl_context_touch(context); + assert (rc == QMCKL_SUCCESS); return QMCKL_SUCCESS;