Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| documentation:examples:sommevecvecparopenmpmpi.c [2018/04/24 13:15] – créée cicaluga | documentation:examples:sommevecvecparopenmpmpi.c [2023/01/13 09:38] (Version actuelle) – supprimée ccalugar | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | vi hello.c | ||
| - | #include < | ||
| - | #include " | ||
| - | #include < | ||
| - | |||
| - | int main(int argc, char *argv[]) { | ||
| - | int numprocs, rank, namelen; | ||
| - | char processor_name[MPI_MAX_PROCESSOR_NAME]; | ||
| - | int iam = 0, np = 1; | ||
| - | |||
| - | MPI_Init(& | ||
| - | MPI_Comm_size(MPI_COMM_WORLD, | ||
| - | MPI_Comm_rank(MPI_COMM_WORLD, | ||
| - | MPI_Get_processor_name(processor_name, | ||
| - | |||
| - | #pragma omp parallel default(shared) private(iam, | ||
| - | { | ||
| - | np = omp_get_num_threads(); | ||
| - | iam = omp_get_thread_num(); | ||
| - | printf(" | ||
| - | iam, np, rank, numprocs, processor_name); | ||
| - | } | ||
| - | |||
| - | MPI_Finalize(); | ||
| - | } | ||