Thread: Malloc and MPI

  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

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, 04:10 PM