diff --git a/cbind/base/psb_c_base.h b/cbind/base/psb_c_base.h index df97c50b..d151428e 100644 --- a/cbind/base/psb_c_base.h +++ b/cbind/base/psb_c_base.h @@ -66,6 +66,7 @@ extern "C" { void psb_c_barrier(psb_c_ctxt cctxt); void psb_c_info(psb_c_ctxt cctxt, psb_i_t *iam, psb_i_t *np); void psb_c_get_i_ctxt(psb_c_ctxt cctxt, psb_i_t *ictxt, psb_i_t *info); + bool psb_c_cmp_ctxt(psb_c_ctxt cctxt1, psb_c_ctxt cctxt2); psb_d_t psb_c_wtime(); psb_i_t psb_c_get_errstatus(); diff --git a/cbind/base/psb_cpenv_mod.f90 b/cbind/base/psb_cpenv_mod.f90 index b6a6a3d2..b09887ce 100644 --- a/cbind/base/psb_cpenv_mod.f90 +++ b/cbind/base/psb_cpenv_mod.f90 @@ -78,6 +78,23 @@ contains end subroutine + function psb_c_cmp_ctxt(cctxt1, cctxt2) result(res) + implicit none + type(psb_c_object_type), value :: cctxt1, cctxt2 + logical(c_bool) :: res + + logical :: equal + type(psb_ctxt_type), pointer :: ctxt1, ctxt2 + + ctxt1 => psb_c2f_ctxt(cctxt1) + ctxt2 => psb_c2f_ctxt(cctxt2) + + equal = psb_cmp_ctxt(ctxt1, ctxt2) + + res = equal + + end + subroutine psb_c_exit_ctxt(cctxt) bind(c) use psb_base_mod, only : psb_exit, psb_ctxt_type type(psb_c_object_type), value :: cctxt