int main(int argc, char *argv[]) { int nrT = atoi(argv[1]); omp_set_num_threads(nrT); printf("Rodando a %d ThRead\n", nrT); tempo1(); inicializa_vetor(); int i, aux; #pragma omp for private (i) for (i = 1; i < TAM; i++) { aux = vetor[i]; //printf("\n Valor %d", aux); int auxThRead = aux * nrT / TAM; //printf("\n Vetor Indice %d", auxThRead); vetorAux[auxThRead][maxVetor[auxThRead]] = aux; maxVetor[auxThRead]++; } { organiza(); } tempo2(); tempoFinal("mili segundos", argv[0], MSGLOG, argv[1]); /* mostra_vetor(); */ }
void desafio_gosma2(int v[]) { inicializa_vetor(v); v[0] = DIRECT; v[1] = ATK_DOUBLE; v[2] = WHILE; v[3] = ARRAY; v[4] = ARRAY_GRAB; v[5] = WHILE_BREAK; }
void desafio_fantasma(int v[]) { inicializa_vetor(v); transferir_condicao(cond, "I- Enquanto o fantasma estiver vivo;\nII- Enquanto o fantasma for imaterial;\nIII- Enquanto o fantasma for assustador;\nIV- Enquanto o fantasma estiver vulnerável;\nV- Enquanto você não tiver medo de fantasma."); transferir_condicao(cond_buttons, "Condição I|Condição II|Condição III|Condição IV|Condição V"); v[0] = WHILE; v[1] = ARRAY; v[2] = ARRAY_USE; v[3] = WHILE_BREAK; v[4] = WHILE; v[5] = 10000+4; //alguma condição "Enquanto o fantasma estiver vulnerável" v[6] = ATK; v[7] = WHILE_BREAK; }