Re: mpi and system call

From: Volker Springel <volker_at_MPA-Garching.MPG.DE>
Date: Mon, 30 May 2005 13:15:38 +0200

Hi Yves,

Which MPI library are you working with?

I encountered the same problem recently on a system with Infiniband
Network and MVAPICH communication library.

I think this is not a bug in Gadget2, but rather one of the MPI library.
A simple workaround would be to comment out the system() call, or to
program a workaround like you suggested below.

Regars,
Volker


Yves Revaz wrote:

>
> Dear Gadget list,
>
>
> I met a problem using Gadget2 on our beowulf cluster at the Geneva
> Observatory.
> The use of the command system(buf3); (begrun.c, line +-652) causes MPI
> to block.
> Thus, I suggest to replace the lines :
>
>
> sprintf(buf1, "%s%s", fname, "-usedvalues");
> sprintf(buf2, "%s%s", All.OutputDir, "parameters-usedvalues");
> sprintf(buf3, "cp %s %s", buf1, buf2);
> system(buf3);
>
> by :
>
>
> /* copy parameters-usedvalues file*/
> sprintf(buf1, "%s%s", fname, "-usedvalues");
> sprintf(buf2, "%s%s", All.OutputDir, "parameters-usedvalues");
>
> fd = fopen(buf1,"r");
> fdout = fopen(buf2,"w");
>
> while(1)
> {
> fgets(buf, 200, fd);
> if (feof(fd)) break;
> fprintf(fdout, buf, 200);
> }
>
> fclose(fd);
> fclose(fdout);
>
>
> This problem seems to be system dependent.
> A similar system call is present in restart.c and should be replaced.
>
> Cheers.
>
>
Received on 2005-05-30 13:15:38

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:30 CET