[Openmp-dev] Openmp-dev Digest, Vol 74, Issue 36

Jim Cownie via Openmp-dev openmp-dev at lists.llvm.org
Mon Mar 2 01:10:14 PST 2020



> Date: Sat, 29 Feb 2020 07:13:58 -0500
> From: Abid Malik via Openmp-dev <openmp-dev at lists.llvm.org>
> To: openmp-dev at lists.llvm.org
> Subject: [Openmp-dev] __kmpc_for_static_fini
> Message-ID:
> 	<CAAYQrotWVjQDf-uq0iBfcBNWYQ__yAZG7osgC=06zfTtNfah4g at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Hello,
> 
> What does  "__kmpc_for_static_fini" do? Does it rewind some parameters for
> the openmp static scheduler? What will happen if I remove it; especially to
> the second openmp for loop immediately available for static scheduling?
> 
> Thanks,
> 
> -- 
> Abid M. Malik
> ******************************************************
> "I have learned silence from the talkative, toleration from the intolerant,
> and kindness from the unkind"---Gibran
> "Success is not for the chosen few, but for the few who choose" --- John
> Maxwell
> "Being a good person does not depend on your religion or status in life,
> your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD
> YOU TREAT OTHERS"--- Abid
> "The Universe is talking to us, and the language of the Universe is
> mathematics."----Abid
> -------------- next part --------------


“Use the source, Luke” 

/*!
@ingroup WORK_SHARING
@param loc Source location
@param global_tid Global thread id

Mark the end of a statically scheduled loop.
*/
void __kmpc_for_static_fini(ident_t *loc, kmp_int32 global_tid) {
  KMP_POP_PARTITIONED_TIMER();
  KE_TRACE(10, ("__kmpc_for_static_fini called T#%d\n", global_tid));

#if OMPT_SUPPORT && OMPT_OPTIONAL
  if (ompt_enabled.ompt_callback_work) {
    ompt_work_t ompt_work_type = ompt_work_loop;
    ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);
    ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
    // Determine workshare type
    if (loc != NULL) {
      if ((loc->flags & KMP_IDENT_WORK_LOOP) != 0) {
        ompt_work_type = ompt_work_loop;
      } else if ((loc->flags & KMP_IDENT_WORK_SECTIONS) != 0) {
        ompt_work_type = ompt_work_sections;
      } else if ((loc->flags & KMP_IDENT_WORK_DISTRIBUTE) != 0) {
        ompt_work_type = ompt_work_distribute;
      } else {
        // use default set above.
        // a warning about this case is provided in __kmpc_for_static_init
      }
      KMP_DEBUG_ASSERT(ompt_work_type);
    }
    ompt_callbacks.ompt_callback(ompt_callback_work)(
        ompt_work_type, ompt_scope_end, &(team_info->parallel_data),
        &(task_info->task_data), 0, OMPT_GET_RETURN_ADDRESS(0));
  }
#endif
  if (__kmp_env_consistency_check)
    __kmp_pop_workshare(global_tid, ct_pdo, loc);
}

So it handles the tracing events required for the OMPT interface, does a runtime check if requested and nothing else…

> What will happen if I remove it; especially to
> the second openmp for loop immediately available for static scheduling?
If you remove it you won’t have a compliant OpenMP implementation since you’ll lose the OMPT support which is part of the standard,

-- Jim
James Cownie <jcownie at gmail.com>
Mob: +44 780 637 7146




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20200302/3ac81074/attachment.html>


More information about the Openmp-dev mailing list