Sponsored Content
Top Forums Programming (MPI) Segmentation fault with dynamic allocated 2D array Post 302150770 by porter on Wednesday 12th of December 2007 03:17:03 PM
Old 12-12-2007
Quote:
Originally Posted by lancer6238
Please advise. Thank you.
Firstly, make a backup.

Then remove all the code that refers to arrays of ints and just prove that you can pass a buffer of characters around, effectively an MPI Hello World. Confirm that this cleanly exits.

Then be careful with your type casting whereever there is a void *, for instance the first argument to MPI_Send.

If you want to send 'ints' then change that to a

Code:
int *mySendData=&(cell[i][0]);
MPI_Send(mySendData,.....

and similarly on the read, this lets the compiler do type checking for you.

Also, run the thing under a debugger or use the core dump to find out where the thing is failing. Have you not closed the library down correctly? Is this a build issue? Is it compiler options or selection of libraries?
 

10 More Discussions You Might Find Interesting

1. Programming

segmentation fault

hi all i'm trying to execute a c program under linux RH and it gives me segmentation fault, this program was running under unix at&t anybody kow what the problem could be? thanx in advance regards (2 Replies)
Discussion started by: omran
2 Replies

2. UNIX for Dummies Questions & Answers

Segmentation Fault

hello all, I tried a program on an array to intialise array elements from the standard input device.it is an integer array of 5 elements.but after entering the 4th element it throws a message called "Segmentation Fault" and returns to the command prompt without asking for the 5th element. ... (3 Replies)
Discussion started by: compbug
3 Replies

3. Programming

Hi! segmentation fault

I have written a program which takes a directory as command line arguments and displays all the dir and files in it. I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
Discussion started by: vijlak
4 Replies

4. Programming

segmentation fault

If I do this. Assume struct life { char *nolife; } struct life **life; // malloc initialization & everything if(life->nolife == 0) Would I get error at life->nolife if it is equal to 0. wrong accession? (3 Replies)
Discussion started by: joey
3 Replies

5. Programming

segmentation fault

What is segmentation fault(core dumped) (1 Reply)
Discussion started by: gokult
1 Replies

6. Programming

Segmentation fault.

I'm getting a segmentation fault. I'm new to Linux programming. Thanks so much for all of your input.:eek: #include </usr/include/mysql++/mysql++.h> #include <stdio.h> #include <iostream> #include <sstream> #include <string.h> using namespace std; int outputToImport(const char*... (1 Reply)
Discussion started by: sepoto
1 Replies

7. Programming

segmentation fault.

This code is causing a segmentation fault and I can't figure out why. I'm new to UNIX and I need to learn how to avoid this segmentation fault thing. Thank you so much. Thanks also for the great answers to my last post.:):b: int main() { mysqlpp::Connection conn(false); if... (3 Replies)
Discussion started by: sepoto
3 Replies

8. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this : i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies

9. Programming

Segmentation fault

I keep getting this fault on a lot of the codes I write, I'm not exactly sure why so I'd really appreciate it if someone could explain the idea to me. For example this code #include <stdio.h> main() { unsigned long a=0; unsigned long b=0; int z; { printf("Enter two... (2 Replies)
Discussion started by: sizzler786
2 Replies

10. Programming

C. To segmentation fault or not to segmentation fault, that is the question.

Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1... I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one. Below are two very condensed snippets of which I have added the results inside the each code section. IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
stpqrt2.f(3)							      LAPACK							      stpqrt2.f(3)

NAME
stpqrt2.f - SYNOPSIS
Functions/Subroutines subroutine stpqrt2 (M, N, L, A, LDA, B, LDB, T, LDT, INFO) STPQRT2 Function/Subroutine Documentation subroutine stpqrt2 (integerM, integerN, integerL, real, dimension( lda, * )A, integerLDA, real, dimension( ldb, * )B, integerLDB, real, dimension( ldt, * )T, integerLDT, integerINFO) STPQRT2 Purpose: STPQRT2 computes a QR factorization of a real "triangular-pentagonal" matrix C, which is composed of a triangular block A and pentagonal block B, using the compact WY representation for Q. Parameters: M M is INTEGER The total number of rows of the matrix B. M >= 0. N N is INTEGER The number of columns of the matrix B, and the order of the triangular matrix A. N >= 0. L L is INTEGER The number of rows of the upper trapezoidal part of B. MIN(M,N) >= L >= 0. See Further Details. A A is REAL array, dimension (LDA,N) On entry, the upper triangular N-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the upper triangular matrix R. LDA LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N). B B is REAL array, dimension (LDB,N) On entry, the pentagonal M-by-N matrix B. The first M-L rows are rectangular, and the last L rows are upper trapezoidal. On exit, B contains the pentagonal matrix V. See Further Details. LDB LDB is INTEGER The leading dimension of the array B. LDB >= max(1,M). T T is REAL array, dimension (LDT,N) The N-by-N upper triangular factor T of the block reflector. See Further Details. LDT LDT is INTEGER The leading dimension of the array T. LDT >= max(1,N) INFO INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: April 2012 Further Details: The input matrix C is a (N+M)-by-N matrix C = [ A ] [ B ] where A is an upper triangular N-by-N matrix, and B is M-by-N pentagonal matrix consisting of a (M-L)-by-N rectangular matrix B1 on top of a L-by-N upper trapezoidal matrix B2: B = [ B1 ] <- (M-L)-by-N rectangular [ B2 ] <- L-by-N upper trapezoidal. The upper trapezoidal matrix B2 consists of the first L rows of a N-by-N upper triangular matrix, where 0 <= L <= MIN(M,N). If L=0, B is rectangular M-by-N; if M=L=N, B is upper triangular. The matrix W stores the elementary reflectors H(i) in the i-th column below the diagonal (of A) in the (N+M)-by-N input matrix C C = [ A ] <- upper triangular N-by-N [ B ] <- M-by-N pentagonal so that W can be represented as W = [ I ] <- identity, N-by-N [ V ] <- M-by-N, same form as B. Thus, all of information needed for W is contained on exit in B, which we call V above. Note that V has the same form as B; that is, V = [ V1 ] <- (M-L)-by-N rectangular [ V2 ] <- L-by-N upper trapezoidal. The columns of V represent the vectors which define the H(i)'s. The (M+N)-by-(M+N) block reflector H is then given by H = I - W * T * W^H where W^H is the conjugate transpose of W and T is the upper triangular factor of the block reflector. Definition at line 174 of file stpqrt2.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 stpqrt2.f(3)
All times are GMT -4. The time now is 02:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy