[mpich-discuss] Issue regarding MPI_Comm_spawn_multiple

Mahesh Doijade maheshdoijade at gmail.com
Mon May 6 06:45:19 CDT 2013


Hi,
      I am using  MPI_Comm_spawn_multiple for dynamic process creation and
passing different arguments to each process through this function,  but the
code runs perfectly fine for some inputs and throws SEGFAULT for some other
inputs the code sample is


/*Arguments generation starts*/
char ***procs_argv =     procs_argv = (char ***) malloc(sizeof(char **) *
no_processes_to_launch);

    for(i=0; i < no_processes_to_launch; i++)
    {
        procs_argv[i] =    ( char **)malloc(sizeof(char *) * 2);
        procs_argv[i][0] = ( char *) malloc(sizeof(char)*4);
        procs_argv[i][1] = ( char *) malloc(sizeof(char)*10);
        sprintf(procs_argv[i][0], "%d", ppstat_ptr[i].no_of_pivots);
//Total no. of pivot variables
        sprintf(procs_argv[i][1], "%d", all_sizes_elems_fep[i+1]);//Total
bytes of all sizes data.
    }

/*Arguments generation finish*/
 and process is launched as --
MPI_Comm_spawn_multiple(no_processes_to_launch, cmds, procs_argv, nprocs,
infos, 0, MPI_COMM_WORLD, &worker_comm, errcodes);

Error given when debugged through gdb :

in _IO_vfprintf_internal (s=<value optimized out>, format=<value optimized
out>, ap=<value optimized out>) at vfprintf.c : 1603 ,
process_string_arg(((struct printf_spec *)NULL));





-- 

Regards,
-- Mahesh Doijade
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130506/4a007872/attachment.html>


More information about the discuss mailing list