GithubHelp home page GithubHelp logo

trabalhoesp1's Introduction

sudo apt update sudo apt install openssh-server

nano /etc/hosts 192.168.1.73 nod01 192.168.1.74 nod02

remova qualquer entrada do ssh

Gere as senhas

ssh-keygen -t rsa

ssh-copy-id nod02

Logue-se no

ssh nod02

########## No servidor sudo apt-get install nfs-kernel-server

Permita acesso sem senha

eval ssh-agent ssh-add .ssh/id_rsa

criar uma pasta para compartilhamento

mkdir /home/ifmt/mpiexemplo

#Adicionar uma entrada no arquivo /etc/exports sudo nano /etc/exports

Adicionar o conteúdo

/home/ifmt/mpiexemplo *(rw,sync,no_root_squash,no_subtree_check)

Restarta o servidor

sudo service nfs-kernel-server restart

Configuração do nfs dos clientes

ssh nodxxx sudo apt-get install nfs-common

Cria a pasta para efetuar a montagem

mkdir /home/ifmt/mpiexemplo

Permitir que a pasta seja montada automaticamente

sudo nano /etc/fstab nod01:/home/ifmt/mpiexemplo /home/ifmt/mpiexemplo nfs

monta o diretório

mount -a

sudo apt install libmpich-dev build-essential

Crie um Arquivo para testar o cluster

nano hello.c

#include <mpi.h> #include <stdio.h>

int main(int argc, char** argv) { // Initialize the MPI environment MPI_Init(NULL, NULL);

// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);

// Get the rank of the process
int world_rank;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);

// Get the name of the processor
char processor_name[MPI_MAX_PROCESSOR_NAME];
int name_len;
MPI_Get_processor_name(processor_name, &name_len);

// Print off a hello world message
printf("Hello world from processor %s, rank %d"
       " out of %d processors\n",
       processor_name, world_rank, world_size);

// Finalize the MPI environment.
MPI_Finalize();

}

pressione CTRL+X

mpicc hello.c

mpirun -np 4 --hosts nod01:4,nod02:2 ./a.out

trabalhoesp1's People

Contributors

geekaia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.