[DFTB-Plus-User] dftb+.mpi as spawned process

Alex A. Schmidt aas at ufsm.br
Mon Dec 29 21:10:55 CET 2014


Dear Bálint,

Thanks for your reply.

2014-12-29 13:09 GMT-02:00 Bálint Aradi <aradi at uni-bremen.de>:

>
> I've added that to the code in our MPI-branch.
> >
> >     if (mympi%master.and.mpi_comm_parent.eq.mpi_comm_null) then
> >       stdout = output_unit
> >     else
> >       stdout = 1
> >       open(stdout, file="/dev/null", action="write")
> >     end if
>
> This solution, I do no like as a general solution, as for me it is not
> trivial at all, that all IO to stdout should be suppressed when DFTB+ is
> spawned by other process via mpi_comm_spawn(). One could eventually
> think about a flag in the input file (or a command line argument for
> DFTB+), which would do that.
>

I certainly agree with you regarding the above solution to suppress stdout.
Its advantage is to be quick and easy to implement and would do the trick
in my case...

I think a command line argument like "-o outfile" is indeed a much better
choice to manage stdout as options like this can be easily passed to spawn
processes. It is also aesthetically similar to the regular i/o redirection
"> outfile"
option and you would not have to alter the current input standard of dftb+,
even
though I have a feeling that adding a flag to the input file would be much
easier
to implement.

Best regards and a great 2015,

Alex

2014-12-29 13:09 GMT-02:00 Bálint Aradi <aradi at uni-bremen.de>:

> Dear Alex,
>
> thank you for your suggestions.
>
> > As far as I know, all that is necessary for dftb+.mpi to become "spawn
> > ready" would be to
> > add something like
> >
> >    integer :: mpi_comm_parent
> >
> >    call mpi_comm_get_parent(mpi_comm_parent,error0)
> >
> >    if (mpi_comm_parent.ne.mpi_comm_null) then
> >        call mpi_comm_disconnect(mpi_comm_parent,error0)
> >    endif
> >
> > right before "call mpi_finalize(error0)". Please, note that testing the
> > value of mpi_comm_parent
> > as above make the call to mpi_comm_disconnect safe in case dftb+.mpi is
> > called from "mpirun".
>
> I've added that to the code in our MPI-branch.
> >
> >     if (mympi%master.and.mpi_comm_parent.eq.mpi_comm_null) then
> >       stdout = output_unit
> >     else
> >       stdout = 1
> >       open(stdout, file="/dev/null", action="write")
> >     end if
>
> This solution, I do no like as a general solution, as for me it is not
> trivial at all, that all IO to stdout should be suppressed when DFTB+ is
> spawned by other process via mpi_comm_spawn(). One could eventually
> think about a flag in the input file (or a command line argument for
> DFTB+), which would do that.
>
>   Best regards and a happy new year,
>
>   Bálint
>
> --
> Dr. Bálint Aradi
> Bremen Center for Computational Materials Science, University of Bremen
> http://www.bccms.uni-bremen.de/cms/people/b_aradi/
>
>
>
> _______________________________________________
> DFTB-Plus-User mailing list
> DFTB-Plus-User at mailman.zfn.uni-bremen.de
> https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.zfn.uni-bremen.de/pipermail/dftb-plus-user/attachments/20141229/1c2f95bd/attachment.html>


More information about the DFTB-Plus-User mailing list