/// Construct without an MPI communicator.
///
/// This is merely a wrapper around `lammps_open_no_mpi`.
///
/// # MPI
///
/// I don't know what happens if you use this when MPI is initialized.
///
/// # Safety
///
/// Construction of LammpsOwner is inherently unsafe because it is unsafe
/// to use multiple instances simultaneously on separate threads.
Construct without an MPI communicator.
This is merely a wrapper around `lammps_open_no_mpi`.
Construct without an MPI communicator . This is merely a wrapper around ` lammps_open_no_mpi ` .
pub(crate) unsafe fn new(argv: &[&str]) -> FailResult<Self>
    {Ok({
        let mut argv = CArgv::from_strs(&argv);
        let mut ptr: *mut c_void = std::ptr::null_mut();
        unsafe {
            lammps_sys::lammps_open_no_mpi(
                argv.len().try_to_c_int()?,
                argv.as_argv_ptr(),
                &mut ptr,
            );
        }
        let ptr = unsafe {
            ptr.as_mut()
        }.ok_or_else(|| format_err!("Lammps initialization failed"))?;
        LammpsOwner { argv, ptr }
    })}
pub ( crate ) unsafe fn new ( argv : & [ & str ] ) -> FailResult < Self > { Ok ( { let mut argv = CArgv :: from_strs ( & argv ) ; let mut ptr : * mut c_void = std :: ptr :: null_mut ( ) ; unsafe { lammps_sys :: lammps_open_no_mpi ( argv . len ( ) . try_to_c_int ( ) ? , argv . as_argv_ptr ( ) , & mut ptr , ) ; } let ptr = unsafe { ptr . as_mut ( ) } . ok_or_else ( | | format_err ! ( " " ) ) ? ; LammpsOwner { argv , ptr } } ) }
Construct without an MPI communicator.
Construct without an MPI communicator .
argv
&[&str]
mpi
I don't know what happens if you use this when MPI is initialized.
I don ' t know what happens if you use this when MPI is initialized .
safety
Construction of LammpsOwner is inherently unsafe because it is unsafe
to use multiple instances simultaneously on separate threads.
Construction of LammpsOwner is inherently unsafe because it is unsafe to use multiple instances simultaneously on separate threads .