void _xlsmpParRegionSetup_TPO (int p1, void *p2, int p3, void* p4, void* p5, void** p6, long p7, long p8)
{
#if defined(DEBUG)
	fprintf (stderr, PACKAGE_NAME": _xlsmpParRegionSetup_TPO is at %p\n", _xlsmpParRegionSetup_TPO_real);
	fprintf (stderr, PACKAGE_NAME": _xlsmpParRegionSetup_TPO params %d %p %d %p %p %p %ld %ld\n", p1, p2, p3, p4, p5, p6, p7, p8);
#endif

	if (_xlsmpParRegionSetup_TPO_real != NULL && mpitrace_on)
	{
		/* Set the pointer to the correct PARALLEL user function */
		par_uf = (void(*)(char*))p2;

		/* Reset the counter of the sections to 0 */
		__atomic_index = 0;

		Extrae_OpenMP_ParRegion_Entry();
		_xlsmpParRegionSetup_TPO_real (p1, callme_par, p3, p4, p5, p6, p7, p8);
		Extrae_OpenMP_ParRegion_Exit();
  }
	else if (_xlsmpParRegionSetup_TPO_real != NULL && !mpitrace_on)
	{
		_xlsmpParRegionSetup_TPO_real (p1, p2, p3, p4, p5, p6, p7, p8);
	}
	else
	{
		fprintf (stderr, PACKAGE_NAME": _xlsmpParRegionSetup_TPO is not hooked! exiting!!\n");
		exit (0);
	}
}
Exemple #2
0
/*
 * kmpc_fork_call / kmpc_fork_call_extrae_dyninst
 *   dlsym does not seem to work under dyninst and we can't replace this
 *   function by itself (opposite to MPI, OpenMP does not have something like
 *   PMPI). Thus, we need to pass the address of the original __kmpc_fork_call
 *   (through Extrae_intel_kmpc_runtime_init_dyninst) and let the new 
 *   __kmpc_fork_call_extrae_dyninst do the work by finally calling to
 *   __kmpc_fork_call passed.
 */
void __kmpc_fork_call (void *p1, int p2, void *p3, ...)
{
	void *params[INTEL_OMP_FUNC_ENTRIES];
	va_list ap;
	int i;

#if defined(DEBUG)
	fprintf (stderr, PACKAGE_NAME": THREAD %d: __kmpc_fork_call is at %p\n", THREADID, __kmpc_fork_call_real);
	fprintf (stderr, PACKAGE_NAME": THREAD %d: __kmpc_fork_call params %p %d %p (and more to come ... )\n", THREADID, p1, p2, p3);
#endif

	if (__kmpc_fork_call_real != NULL && mpitrace_on)
	{
		Extrae_OpenMP_ParRegion_Entry ();

		/* Grab parameters */
		va_start (ap, p3);
		for (i = 0; i < p2; i++)
			params[i] = va_arg (ap, void*);
		va_end (ap);

		par_func = p3;

		switch (p2)
		{
			/* This big switch is handled by this file generated automatically by  genstubs-kmpc-11.sh */
#include "intel-kmpc-11-intermediate-switch.c"

			default:
				fprintf (stderr, PACKAGE_NAME": Error! Unhandled __kmpc_fork_call with %d arguments! Quitting!\n"
				                 PACKAGE_NAME":        Recompile Extrae to support this quantity of arguments!\n"
						         PACKAGE_NAME":        Use src/tracer/wrappers/OMP/genstubs-kmpc-11.sh to do so\n", p2);
				exit (-1);
				break;
		}

		Extrae_OpenMP_ParRegion_Exit ();	
	}