LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2008, 02:52 PM   #1
Mikhinja
LQ Newbie
 
Registered: Dec 2008
Location: Bucharest, Romania
Distribution: Kubuntu
Posts: 1

Rep: Reputation: 0
Open MPI with c++ kubuntu


Hello.
I am a newbie and i am having problems with Open MPI.
My apt-get cannot install the openmpi listed with apt-cache so i installed a downloaded version from openmpi.org .
I managed to compile with mpiCC and a simple hello world like program crashes with sigsegv when i execute it.

Here is what i have at the moment. Please help me for I am due to finish a homework using MPI in a few days and I feel lost already !

The source file:

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

int main(int argc, char *argv[]) {
int numprocs, rank, namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
printf("unu\n");
MPI_Init(&argc, &argv);
printf("doi\n");
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(processor_name, &namelen);

printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);

MPI_Finalize();
}


From gdb debugging:

[...]
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) start
Breakpoint 1 at 0x804f666: file mpitut.cpp, line 4.
Starting program: /home/mihai/junk/C/mpitut
[Thread debugging using libthread_db enabled]
[New Thread -1213872432 (LWP 8593)]
[Switching to Thread -1213872432 (LWP 8593)]
main (argc=1, argv=0xbfbddbb4) at mpitut.cpp:4
4 int main(int argc, char *argv[]) {
(gdb) break main
Breakpoint 2 at 0x804f666: file mpitut.cpp, line 4.
(gdb) step
7 printf("unu\n");
(gdb) step
unu
8 MPI_Init(&argc, &argv);
(gdb) ni
0x0804f683 8 MPI_Init(&argc, &argv);
(gdb) ni
0x0804f687 8 MPI_Init(&argc, &argv);
(gdb) ni
0x0804f68a 8 MPI_Init(&argc, &argv);
(gdb) ni

Program received signal SIGSEGV, Segmentation fault.
0x006f732e in ?? ()
(gdb) step
Cannot find bounds of current function
(gdb) ni
0xb7d20a80 in opal_show_stackframe () from /usr/lib/libopen-pal.so.0
[...]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Krusader will not open in KDE4.1.1 Kubuntu 8.04 tarahmarie Linux - Newbie 3 05-14-2009 07:08 PM
upgraded Kubuntu to Hardy Heron, sound died, Dolphin won't open html files cestover Linux - Newbie 7 07-06-2008 01:26 PM
Mpi chandan_shetty Linux - Networking 1 05-10-2008 06:16 AM
How to take screenshot of open K-menu in Kubuntu dannyboy@kubuntu Ubuntu 3 10-13-2006 05:46 AM
what do I need to know to use MPI kgustaf Linux - Networking 0 07-25-2005 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration