double pi_kernel (int n, double h)
{
	double tmp = 0;
	double x;
	int i;
	extrae_combined_events_t evt;

	extrae_type_t type = 2020;
	extrae_value_t enter = (extrae_value_t) pi_kernel, leave = 0;

	Extrae_register_function_address (pi_kernel, (char*)__FUNCTION__, (char*)__FILE__, __LINE__);

	Extrae_init_CombinedEvents (&evt);
	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &enter;
	Extrae_emit_CombinedEvents (&evt);

	for (i = 1; i <= n; i++)
	{
		x = h * ((double)i - 0.5);
		tmp += (4.0 / (1.0 + x*x));
	}

	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &leave;
	Extrae_emit_CombinedEvents (&evt);

	return tmp;
}
Beispiel #2
0
JNIEXPORT void JNICALL Java_es_bsc_cepbatools_extrae_Wrapper_Comm (JNIEnv *env,
	jclass jc, jboolean send, jint tag, jint size, jint partner, jlong id)
{
	struct extrae_UserCommunication comm;
	struct extrae_CombinedEvents events;

	UNREFERENCED(env);
	UNREFERENCED(jc);

 	Extrae_init_UserCommunication(&comm);
	Extrae_init_CombinedEvents(&events);

	if(send)
		comm.type = EXTRAE_USER_SEND;
	else
		comm.type = EXTRAE_USER_RECV;

	comm.tag=tag;
	comm.size=size;
	comm.partner=partner;
	comm.id=id;

	events.nCommunications=1;	
	events.Communications=&comm;	
	events.nEvents=0;

	Extrae_emit_CombinedEvents(&events);
}
void fake_kernel_ol_1 (void)
{
	Extrae_register_function_address (fake_kernel_ol_1, "fake_kernel", (char*)__FILE__, __LINE__);

	extrae_combined_events_t evt;
	extrae_type_t type = 2020;
	extrae_value_t enter = (extrae_value_t) fake_kernel_ol_1, leave = 0;

	Extrae_init_CombinedEvents (&evt);
	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &enter;
	Extrae_emit_CombinedEvents (&evt);

	fake_kernel();

	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &leave;
	Extrae_emit_CombinedEvents (&evt);
}
void sleep_kernel (int n)
{
	extrae_combined_events_t evt;
	extrae_type_t type = 2020;
	extrae_value_t enter = (extrae_value_t) sleep_kernel, leave = 0;

	Extrae_register_function_address (sleep_kernel, (char*)__FUNCTION__, (char*)__FILE__, __LINE__);

	Extrae_init_CombinedEvents (&evt);
	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &enter;
	Extrae_emit_CombinedEvents (&evt);

	printf ("in sleep_kernel (%d)\n", n);

	evt.nEvents = 1;
	evt.Types = &type;
	evt.Values = &leave;
	Extrae_emit_CombinedEvents (&evt);
}
void * Task0(void *param)
{
	struct extrae_CombinedEvents events;
	struct extrae_UserCommunication comm;
	extrae_type_t types[2] = { 123456, 123457 } ;
	extrae_value_t values[2] = { 1, 2 };

	Extrae_init_UserCommunication (&comm);
	comm.type = EXTRAE_USER_SEND;
	comm.partner = 0;
	comm.tag = 1234;
	comm.size = 1024;
	comm.id = 0xdeadbeef;

	Extrae_init_CombinedEvents (&events);
	events.nCommunications = 1;
	events.Communications = &comm;
	events.nEvents = 2;
	events.Types = types;
	events.Values = values;

	Extrae_emit_CombinedEvents (&events);
}