Malloc and MPI

This is a discussion on Malloc and MPI within the C Programming forums, part of the General Programming Boards category; One other option on the scheme of "variable size element in a struct" is if you just add all the ...

  1. #16
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    One other option on the scheme of "variable size element in a struct" is if you just add all the array sizes together, and then make one long array.

    Let's say you have 10 of array a, then 100 of the array b and c.

    So on the one side, you fill in 0-9 with the contents of a, then 10-109 with b, then 110-209 with c.

    On the "other side", you fetch the data out by:

    a = &array[0];
    b = &array[10];
    c = &array[110];

    --
    Mats

  2. #17
    Registered User
    Join Date
    Jun 2007
    Posts
    26
    I may try this, it seems a little easier to implement, at least for me.

    thanks again

  3. #18
    Registered User
    Join Date
    Mar 2008
    Posts
    1
    Is there anybody from the member who has a program Palindrome Using MPI

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting whit MPI
    By isato in forum C Programming
    Replies: 0
    Last Post: 03-03-2009, 10:38 AM
  2. Alternative to malloc
    By stellastarr in forum C Programming
    Replies: 13
    Last Post: 04-30-2007, 05:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21