(MPI) Segmentation fault with dynamic allocated 2D array
Hi all,
I'm getting segmentation fault errors when I try to send/receive 2 rows of a matrix as a block, and I can't figure out why.
Basically, I have a 4x5 matrix with an extra top row and an extra leftmost column, making it a (4+1)x(5+1) matrix stored in P0. I'm trying to send the 2nd and 3rd row as a block to P1, print out the contents, send the 4th and 5th row as a block to P1, then print out the contents again. I have dynamically allocated a (4+1)x(5+1) memory block to cellblock, then used the pointers cell[i] to point to each "row" of cellblock, so I can access the 2D array by cell[i][j].
I get the correct output, but with segmentation fault at the end.
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
tk::tablematrix::spreadsheet
TableMatrix::Spreadsheet(3pm) perl/Tk Documentation TableMatrix::Spreadsheet(3pm)NAME
Tk::TableMatrix::Spreadsheet - Table Display with Spreadsheet-like bindings.
SYNOPSIS
use Tk;
use Tk::TableMatrix::Spreadsheet;
my $t = $top->Scrolled('Spreadsheet', -rows => 21, -cols => 11,
-width => 6, -height => 6,
-titlerows => 1, -titlecols => 1,
-variable => $arrayVar,
-selectmode => 'extended',
-titlerows => 1,
-titlecols => 1,
-bg => 'white',
);
DESCRIPTION
Tk::TableMatrix::Spreadsheet is a Tk::TableMatrix-derived widget that implements some bindings so the resulting widget behaves more like a
spreadsheet.
Bindings Added:
o
Row/Col resize handles appear when the cursor is placed over a row/col border line in the rol/col title area.
Dragging these handles will resize the row or column. If multiple rows or columns are selected, then the new row/col size will apply to
all row/cols selected.
Note: With the base Tk::TableMatrix, it is possible to resize the row/cols by dragging on any cell border. To be more spreadsheet-like,
Tk::TableMatrix::Spreadsheet defaults to enable row/col resizing only thru the title row/col dragging. To override this default behavoir,
set the -resizeborder option to 'both' at startup.
o
A popup menu for row/col insert/delete appears when the mouse is right-clicked in the row/col title areas.
o
Cells activate (i.e. the contents become edit-able) only when the cell is double-clicked or the F2 button is pressed. The default
Tk::TableMatrix behavior is for the cell to be activated when the cell is single-clicked.
o
The Escape key causes any changes made to a cell to be canceled and the current selection cleared.
o
The return key causes the the current cell to move down.
o
The tab (or shift tab) key causes the current cell to be moved to the right (left).
o
The delete key will delete the current selection, if no cell is currently active.
o
The Mouse button 2 (middle button) paste from the PRIMARY. (Control-v pastes from the clipboard).
Additional Information
Widget methods, options, etc, are inherited from the Tk::TableMatrix widget. See its docs for additional information.
Tk1.23 2007-01-09 TableMatrix::Spreadsheet(3pm)