Blog :: 2010/09/...
MPI find minimum demo
Posted 2010/09/03
How to find the 'find minimum' using MPI.
#include "mpi.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAXSIZE 1000
void main(int argc, char **argv) {
int myid, numprocs, data[MAXSIZE], i, x, myresult, result, status;
FILE *fp;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
if(myid == 0){
if((fp = fopen("./rand_data.txt", "r")) [...]
MacBook Pro
Posted 2010/09/03
New work laptop
Some things move about as fast in every university and I guess buying new equipment is one of those things. Today I finally got hold of my work laptop. I had to swear to bring it in to be asset tagged by the computer people. Previous experience has [...]
MPI Hello World
Posted 2010/09/01
Hello world MPI example.
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include "mpi.h"
main(int argc, char **argv ) {
char message[20];
int i,rank, size, type=99;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if(rank == [...]