Hi,
I'm working on a project with MPI and have just found out that malloc should not be used as it is not thread-safe. This makes sense as initially I made all my matrices in the form matrix[x][x] but when I changed it to a pointer instead and dynamically created memory for it using malloc my program kept crashing... (system bus error) Seeing as this is the only thing I changed I figured it must be the malloc causing the problem. So my question is what alternative do I have to malloc if I want to dynamically create an array (won't know the size until run-time.. dependent on what is entered on the command line)
Thanks.