This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Hostfile for Open MPI | |
# The master node, 'slots=4' is used because it is a dual-processor machine. | |
localhost slots=8 | |
# The following slave nodes are single processor machines: | |
#cluster-nodo1 | |
#cluster-nodo2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* compile with : mpicc -o helloworld mpi_HelloWorld.c | |
* run with mpirun -np [#Number of Cores] helloworld | |
*/ | |
#include <stdio.h> | |
#include "mpi.h" | |
int main(int argc,char **argv){ | |
int rank,size; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fibo(0,1). | |
fibo(1,1). | |
fibo(N,M):- +N>1,r(2,1,2,N,M). | |
r(I,B,_,N,B) :- I>N. | |
r(I,B,C,N,M) :- I=<N,I1 is I+1,D is C+B,r(I1,C,D,N,M). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fibo(0,1). | |
fibo(1,1). | |
fibo(N,M):-N>0,N1 is N-1,N2 is N-2,fibo(N1,M1),fibo(N2,M2),M is M1+M2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
factorial(0,1). | |
factorial(N,M):-N>0, N1 is N-1,factorial(N1,M1),M is N*M1. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.