Unverified Commit a1cf6c08 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

no need to use a deprecated argument in a newly added API

parent 2a42fe66
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -54,12 +54,11 @@ MODULE LIBLAMMPS

  ! interface definitions for calling functions in library.cpp
  INTERFACE
      FUNCTION lammps_open(argc,argv,comm,handle) &
      FUNCTION lammps_open(argc,argv,comm) &
          BIND(C, name='lammps_open_fortran')
        IMPORT :: c_ptr, c_int
        INTEGER(c_int), VALUE, INTENT(in)     :: argc, comm
        TYPE(c_ptr), DIMENSION(*), INTENT(in) :: argv
        TYPE(c_ptr), INTENT(out)              :: handle
        TYPE(c_ptr)                           :: lammps_open
      END FUNCTION lammps_open

@@ -161,7 +160,7 @@ CONTAINS
    ENDIF

    IF (PRESENT(comm)) THEN
        lmp_open%handle = lammps_open(argc,argv,comm,dummy)
        lmp_open%handle = lammps_open(argc,argv,comm)
    ELSE
        lmp_open%handle = lammps_open_no_mpi(argc,argv,dummy)
    END IF
+4 −4
Original line number Diff line number Diff line
@@ -205,20 +205,20 @@ module. Internally it converts the *f_comm* argument into a C-style MPI
communicator with ``MPI_Comm_f2c()`` and then calls
:cpp:func:`lammps_open`.

.. versionadded:: 15Sep2020

\endverbatim
 *
 * \param  argc   number of command line arguments
 * \param  argv   list of command line argument strings
 * \param  f_comm Fortran style MPI communicator for this LAMMPS instance
 * \param  ptr    pointer to a void pointer variable
 *                which serves as a handle; may be ``NULL``
 * \return        pointer to new LAMMPS instance cast to ``void *`` */

void *lammps_open_fortran(int argc, char **argv, int f_comm, void **ptr)
void *lammps_open_fortran(int argc, char **argv, int f_comm)
{
  lammps_mpi_init();
  MPI_Comm c_comm = MPI_Comm_f2c((MPI_Fint)f_comm);
  return lammps_open(argc, argv, c_comm, ptr);
  return lammps_open(argc, argv, c_comm, nullptr);
}

/* ---------------------------------------------------------------------- */
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ extern "C" {
void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr);
#endif
void *lammps_open_no_mpi(int argc, char **argv, void **ptr);
void *lammps_open_fortran(int argc, char **argv, int f_comm, void **ptr);
void *lammps_open_fortran(int argc, char **argv, int f_comm);
void  lammps_close(void *handle);
void  lammps_mpi_init();
void  lammps_mpi_finalize();