FAQ  •  Login

HW 11 OpenMPI issue

<<

kishorekumarjagadeesha

Newbie
Newbie

Posts: 8

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Wed Dec 02, 2015 4:31 pm

HW 11 OpenMPI issue

Hi all,

I've been running into the following error.
-bash: mpicxx: command not found
I checked /usr/lib64/openmpi/bin/ but it's empty? Should we install OpenMPI on euler? I thought it was already installed.
Help!

Thank you.
<<

chadbustard

Newbie
Newbie

Posts: 10

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Wed Dec 02, 2015 10:24 pm

Re: HW 11 OpenMPI issue

I fixed the same issue by first typing "module load openmpi" and then, instead of using mpicxx, I used mpic++, i.e.
mpic++ -o prob3 prob3.cpp -lm -lstdc++

Without including the -lm and -lstdc++, I ran into a few errors using math functions, cout, etc.
<<

timhaines

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Fri Dec 04, 2015 2:05 pm

Re: HW 11 OpenMPI issue

kishorekumarjagadeesha wrote:Hi all,

I've been running into the following error.
-bash: mpicxx: command not found
I checked /usr/lib64/openmpi/bin/ but it's empty? Should we install OpenMPI on euler? I thought it was already installed.
Help!

Thank you.


It looks like the gcc-specific OpenMPI builds don't work anymore, so you will need to load the 'openmpi/1.10.0' module (this is what gets loaded by default when you use 'module load openmpi' as chadbustard suggested).
- Tim
<<

timhaines

Newbie
Newbie

Posts: 34

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Fri Dec 04, 2015 2:32 pm

Re: HW 11 OpenMPI issue

chadbustard wrote:I fixed the same issue by first typing "module load openmpi" and then, instead of using mpicxx, I used mpic++, i.e.
mpic++ -o prob3 prob3.cpp -lm -lstdc++

Without including the -lm and -lstdc++, I ran into a few errors using math functions, cout, etc.

That's interesting. I was able to compile this without specifying either library...

  Code:
#include <iostream>
#include <cmath>
#include <mpi.h>

int main(int argc, char *argv[]) {
   MPI::Init(argc,argv);
   int rank = MPI::COMM_WORLD.Get_rank();

   auto f = std::sin(rank*0.1);

   if(rank == 0) {
      std::cout << "f = " << f << std::endl;
   }
   MPI::Finalize();
}


I compiled with
mpicxx -std=c++11 -Wall -Wextra -o test test.cpp
- Tim
<<

jonathoncrandallmagana

Newbie
Newbie

Posts: 14

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Sat Dec 05, 2015 12:31 pm

Re: HW 11 OpenMPI issue

Using this compile command (posted earlier in this thread):
mpicxx -std=c++11 -Wall -Wextra -o hw11p1 hw11p1.cpp
(I ran the "module load openmpi" first)

This sbatch file worked for me (for 10 processes)

!/bin/sh
#SBATCH --partition=slurm_me759
#SBATCH --time=0-00:05:00 # run time in days-hh:mm:ss
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --ntasks-per-node=10
#SBATCH --error=/home/jcmagana/me759_homework/homework_11/out.err
#SBATCH --output=/home/jcmagana/me759_homework/homework_11/out.out
#SBATCH --gres=gpu:1

mpirun -N 10 hw11p1
<<

kishorekumarjagadeesha

Newbie
Newbie

Posts: 8

Joined: Fri Sep 04, 2015 12:51 pm

Unread post Sat Dec 05, 2015 3:22 pm

Re: HW 11 OpenMPI issue

I'd overlooked the 'module load openmpi' part in the lecture notes (though it says "Typically not needed, should be done automatically for you"'). Thank you all.

Return to ME759 Fall 2015: High Performance Computing

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.