Hello all,
We are working on a benchmark of Notify performances for inter-processor communications (with Sys/bios for the DSP C6678).
We started from the example in the mcsdk and adapted it for parallel work.
The core 0 is the master, it sends a Notify event to all slaves (cores 1 to 7) so that they work in parallel and when they're done they send an event back to the master.
The work is simply adding value from 2 separate tables to another one. All data is in L3.
The project is build with O3 optimization and no debug. Cycles are mesured using TSCL.
The application is working as expected in all cases. The problem is the performance.
Here are the results :
Total number of cores used | Notify cost
2 -> 9288 cycles
4 -> 119423 cycles
8 -> 352984 cycles
for 2 cores it is good but for 4 and 8 it is extremely high.
We are not saying that Notify performance is terrible, maybe how we built the test isn't scalable for 4 or 8 cores and there's a better way to do it.
We hope someone can help us identifying what's wrong with the test.
Here's the pseudo code :
nb_cores = 8;
Void cbFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, UArg arg, UInt32 payload){
Semaphore_post(semHandle); }
Void tsk0_func(){
if (MultiProc_self() == 0) {
/* Master Code */
/* SENDING NOTIFY FOR ALL SLAVES CORES */
for(p = 1; p < nb_cores; p++) {
status = Notify_sendEvent(p, INTERRUPT_LINE, EVENTID, NULL, TRUE);
if (status < 0) { System_abort("sendEvent failed\n"); }
}
/* some work */
/* Wait to be released by the cbFxn posting the semaphore */
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
}
else {
/* Slaves Code */
/* wait forever on a semaphore, semaphore is posted in callback */
Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
/* some work */
status = Notify_sendEvent(0, INTERRUPT_LINE, EVENTID, NULL, TRUE);
if (status < 0) { System_abort("sendEvent failed slave\n"); }
}
BIOS_exit(0);
}
Int main()
{
status = Ipc_start();
if (status < 0) { System_abort("Ipc_start failed\n"); }
if (MultiProc_self() == 0) {
/* Master : will receive event from each 1-7 cores */
for (core_sending_event = 1; core_sending_event < nb_cores; core_sending_event++)
{
status = Notify_registerEvent(core_sending_event, INTERRUPT_LINE, EVENTID, (Notify_FnNotifyCbck)cbFxn, NULL);
if (status < 0) { System_abort("Notify_registerEvent failed\n"); }
}
}
else
{
/* Each slave will receive event from the master (core 0)*/
status = Notify_registerEvent(0, INTERRUPT_LINE, EVENTID, (Notify_FnNotifyCbck)cbFxn, NULL);
if (status < 0) { System_abort("Notify_registerEvent failed\n"); }
}
BIOS_start();
return (0);
}
Thank you