Skip to content

Instantly share code, notes, and snippets.

View lazarljubenovic's full-sized avatar

Lazar Ljubenović lazarljubenovic

View GitHub Profile
// 24. 9. 2016 (3)
#include <stdio.h>
#include <mpi.h>
#define W MPI_COMM_WORLD
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
int m = 3;
// 24. 9. 2016 (4)
#include <stdio.h>
#include <mpi.h>
#define W MPI_COMM_WORLD
int q(int i, int j, int m) {
return i * m + j;
}
#include <mpi.h>
#include <stdio.h>
#define W MPI_COMM_WORLD
void printArray(int n, int array[n], int rank) {
for (int i = 0; i < n; i++) {
if (rank == -1) printf("%4d ", array[i]);
else printf("{%d}%4d ", rank, array[i]);
}
printf("\n");
#include <stdio.h>
#include <mpi.h>
#define W MPI_COMM_WORLD
#define MPI_SI MPI_STATUS_IGNORE
#define n 6
void printArray(int size, int array[size], int rank) {
for (int i = 0; i < size; i++) {
if (rank == -1) printf("%4d ", array[i]);
else printf("{%d}%4d ", rank, array[i]);
#include <mpi.h>
#include <stdio.h>
#define W MPI_COMM_WORLD
#define n 99999
void printArray(int size, double array[size], int rank) {
for (int i = 0; i < size; i++) {
if (rank == -1) printf("%4.4f ", array[i]);
else printf("{%d}%4.4f ", rank, array[i]);
}
#include <mpi.h>
#include <stdio.h>
#define W MPI_COMM_WORLD
#define n 99999
void printArray(int size, double array[size], int rank) {
for (int i = 0; i < size; i++) {
if (rank == -1) printf("%4.4f ", array[i]);
else printf("{%d}%4.4f ", rank, array[i]);
}
#include <stdio.h>
#include <mpi.h>
#define W MPI_COMM_WORLD
#define n 4
void printArray(int size, int array[size], int rank) {
for (int i = 0; i < size; i++) {
if (rank == -1) printf("%02d ", array[i]);
else printf("{%d}%02d ", rank, array[i]);
}
let i = 0
let baz = i == 0 ? true : false