1 / 21

MPE e ferramentas para depuração

MPE e ferramentas para depuração. Karina Foroutan Laize Gabriela Pescarolo Viviane Palodeto. Problemas da Programação Paralela. Visualizar os eventos Identificar quais funções são os gargalos. MPE, o que é?. Conjunto de bibliotecas distribuídas com o MPICH

uzuri
Download Presentation

MPE e ferramentas para depuração

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MPE e ferramentas para depuração Karina Foroutan Laize Gabriela Pescarolo Viviane Palodeto

  2. Problemas da Programação Paralela • Visualizar os eventos • Identificar quais funções são os gargalos

  3. MPE, o que é? • Conjunto de bibliotecas distribuídas com o MPICH • Biblioteca para geração de gráficos • Biblioteca para geração de arquivos de LOG

  4. MPE para Gráficos

  5. MPE para Gráficos (cont)

  6. MPE funções para Lofiles • Additional routines for user-defined events and states • MPE_Log_get_event_number • MPE_Describe_event • MPE_Describe_state • MPE_Log_event

  7. Arquivo de LOG -1 0 0 0 0 0 -2 0 0 192 0 0 -3 0 0 3 0 0 -4 0 0 1 0 0 -5 0 0 0 0 0 -6 0 0 0 0 0 -7 0 0 0 0 63590846

  8. Arquivo de LOG (cont) -8 0 0 1 0 0 -11 0 0 0 0 0 -13 0 2 3 0 0 : MPI_Allreduce -13 0 4 5 0 0 : MPI_Barrier -13 0 6 7 0 0 : MPI_Bcast -13 0 8 9 0 0 : MPI_Reduce

  9. Exemplo de arquivo com MPE int main( int argc, char *argv[]) { int n, myid, numprocs, i, j; double PI25DT = 3.141592653589793238462643; double mypi, pi, h, sum, x; double startwtime = 0.0, endwtime; int namelen; int event1a, event1b, event2a, event2b, event3a, event3b, event4a, event4b;

  10. Exemplo de arquivo com MPE char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&numprocs); MPI_Comm_rank(MPI_COMM_WORLD,&myid); MPI_Get_processor_name(processor_name,&namelen); fprintf(stderr,"Process %d running on %s\n", myid, processor_name);

  11. Exemplo de arquivo com MPE event1a = MPE_Log_get_event_number(); event1b = MPE_Log_get_event_number(); event2a = MPE_Log_get_event_number(); event2b = MPE_Log_get_event_number(); event3a = MPE_Log_get_event_number(); event3b = MPE_Log_get_event_number(); event4a = MPE_Log_get_event_number(); event4b = MPE_Log_get_event_number();

  12. Exemplo de arquivo com MPE if (myid == 0) { MPE_Describe_state(event1a, event1b, "Broadcast", "red"); MPE_Describe_state(event2a, event2b, "Compute", "blue"); MPE_Describe_state(event3a, event3b, "Reduce", "green"); MPE_Describe_state(event4a, event4b, "Sync", "orange"); }

  13. Exemplo de arquivo com MPE MPI_Barrier(MPI_COMM_WORLD); MPE_Start_log(); for (j = 0; j < 5; j++) { MPE_Log_event(event1a, 0, "start broadcast"); MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD); MPE_Log_event(event1b, 0, "end broadcast"); MPE_Log_event(event4a,0,"Start Sync");

  14. Exemplo de arquivo com MPE MPI_Barrier(MPI_COMM_WORLD); MPE_Log_event(event4b,0,"End Sync"); MPE_Log_event(event2a, 0, "start compute"); h = 1.0 / (double) n; sum = 0.0; for (i = myid + 1; i <= n; i += numprocs) { x = h * ((double)i - 0.5); sum += f(x); }

  15. Exemplo de arquivo com MPE mypi = h * sum; MPE_Log_event(event2b, 0, "end compute"); MPE_Log_event(event3a, 0, "start reduce"); MPI_Reduce(&mypi, &pi, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD); MPE_Log_event(event3b, 0, "end reduce"); }

  16. Exemplo de arquivo com MPE if (myid == 0) { endwtime = MPI_Wtime(); printf("pi is approximately %.16f, Error is %.16f\n",pi, fabs(pi - PI25DT)); printf("wall clock time = %f\n", endwtime-startwtime); } MPI_Finalize(); return(0); }

  17. Upshot

  18. Jumpshot

  19. Xshot

  20. Nupshot

  21. Referências • Studying Parallel Program Behavior with Upshot, Virginia Herrarte and Ewing Lusk • http://www-unix.mcs.anl.gov/mpi/mpich/docs/mpeguide/paper.htm • http://www.millennium.berkeley.edu/mpi/manual/

More Related