| /petsc/src/sys/objects/device/interface/ |
| H A D | global_dcontext.cxx | 26 …rrorCode PetscSetDefaultCUPMStreamFromDeviceContext(PetscDeviceContext dctx, PetscDeviceType dtype) in PetscSetDefaultCUPMStreamFromDeviceContext() argument 30 if (dtype == PETSC_DEVICE_CUDA) { in PetscSetDefaultCUPMStreamFromDeviceContext() 38 if (dtype == PETSC_DEVICE_HIP) { in PetscSetDefaultCUPMStreamFromDeviceContext() 46 (void)dctx, (void)dtype; in PetscSetDefaultCUPMStreamFromDeviceContext() 56 const auto dtype = rootDeviceType; in PetscDeviceContextSetupGlobalContext_Private() local 58 PetscDeviceType dtype; in PetscDeviceContextSetupGlobalContext_Private() local 61 PetscCall(PetscDeviceContextGetDeviceType(globalContext, &dtype)); in PetscDeviceContextSetupGlobalContext_Private() 62 …alContext, "Destroying global PetscDeviceContext with device type %s\n", PetscDeviceTypes[dtype])); in PetscDeviceContextSetupGlobalContext_Private() 73 …Context, "Initializing global PetscDeviceContext with device type %s\n", PetscDeviceTypes[dtype])); in PetscDeviceContextSetupGlobalContext_Private() 78 PetscCall(PetscDeviceContextSetDefaultDeviceForType_Internal(globalContext, dtype)); in PetscDeviceContextSetupGlobalContext_Private() [all …]
|
| H A D | mark_dcontext.cxx | 47 event->dtype = PETSC_DEVICE_DEFAULT(); in reset_() 62 PetscCall(PetscDeviceContextGetDeviceType(dctx, &(*event)->dtype)); in PetscDeviceContextCreateEvent_Private() 92 if (PetscDefined(USE_DEBUG) && (event->dtype != PETSC_DEVICE_HOST)) { in PetscDeviceContextRecordEvent_Private() 93 PetscDeviceType dtype; in PetscDeviceContextRecordEvent_Private() local 95 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in PetscDeviceContextRecordEvent_Private() 96 …dtype == dtype, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Event type %s does not match device contex… in PetscDeviceContextRecordEvent_Private() 113 const auto etype = event->dtype; in PetscDeviceContextWaitForEvent_Private() 114 PetscDeviceType dtype; in PetscDeviceContextWaitForEvent_Private() local 116 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in PetscDeviceContextWaitForEvent_Private() 117 …= dtype, PETSC_COMM_SELF, PETSC_ERR_ARG_INCOMP, "Event type %s does not match device context type … in PetscDeviceContextWaitForEvent_Private() [all …]
|
| H A D | device.cxx | 185 switch (const auto dtype = device->type) { in PetscDeviceConfigure() local 199 …M_SELF, PETSC_ERR_SUP, "PETSc was not configured for PetscDeviceType %s", PetscDeviceTypes[dtype]); in PetscDeviceConfigure() 235 auto dtype = PETSC_DEVICE_HOST; in PetscDeviceView() local 244 PetscCall(PetscDeviceGetType(device, &dtype)); in PetscDeviceView() 248 PetscCall(PetscViewerASCIIPrintf(sub, "type: %s\n", PetscDeviceTypes[dtype])); in PetscDeviceView() 694 auto dtype = std::make_pair(PETSC_DEVICE_DEFAULT(), PETSC_FALSE); in PetscDeviceInitializeFromOptions_Internal() local 698 PetscCall(PetscDeviceContextQueryOptions_Internal(PetscOptionsObject, dtype, stype)); in PetscDeviceInitializeFromOptions_Internal() 701 if (dtype.second) PetscCall(PetscDeviceContextSetRootDeviceType_Internal(dtype.first)); in PetscDeviceInitializeFromOptions_Internal()
|
| /petsc/src/vec/is/sf/interface/ftn-custom/ |
| H A D | zsf.c | 91 MPI_Datatype dtype; in petscsfbcastbegin_() local 94 *ierr = PetscMPIFortranDatatypeToC(*unit, &dtype); in petscsfbcastbegin_() 96 *ierr = PetscSFBcastBegin(*sf, dtype, rptr, lptr, cop); in petscsfbcastbegin_() 101 MPI_Datatype dtype; in petscsfbcastend_() local 104 *ierr = PetscMPIFortranDatatypeToC(*unit, &dtype); in petscsfbcastend_() 106 *ierr = PetscSFBcastEnd(*sf, dtype, rptr, lptr, cop); in petscsfbcastend_() 111 MPI_Datatype dtype; in petscsfreducebegin_() local 114 *ierr = PetscMPIFortranDatatypeToC(*unit, &dtype); in petscsfreducebegin_() 116 *ierr = PetscSFReduceBegin(*sf, dtype, lptr, rptr, cop); in petscsfreducebegin_() 121 MPI_Datatype dtype; in petscsfreduceend_() local [all …]
|
| /petsc/src/sys/tests/ |
| H A D | ex49.c | 6 PetscDataType dtype; in main() local 21 PetscCall(PetscDataTypeFromString("Scalar", &dtype, &found)); in main() 23 …PetscCheck(dtype == PETSC_SCALAR, PETSC_COMM_WORLD, PETSC_ERR_ARG_WRONG, "Found wrong datatype for… in main() 25 PetscCall(PetscDataTypeFromString("INT", &dtype, &found)); in main() 27 …PetscCheck(dtype == PETSC_INT, PETSC_COMM_WORLD, PETSC_ERR_ARG_WRONG, "Found wrong datatype for in… in main() 29 PetscCall(PetscDataTypeFromString("real", &dtype, &found)); in main() 31 …PetscCheck(dtype == PETSC_REAL, PETSC_COMM_WORLD, PETSC_ERR_ARG_WRONG, "Found wrong datatype for r… in main() 33 PetscCall(PetscDataTypeFromString("abogusdatatype", &dtype, &found)); in main()
|
| H A D | ex55.py | 9 data = numpy.arange(1000, dtype='i') 12 data = numpy.empty(1000, dtype='i') 17 data = numpy.arange(100, dtype=numpy.float64) 20 data = numpy.empty(100, dtype=numpy.float64)
|
| H A D | ex8.c | 11 static PetscErrorCode MakeDatatype(MPI_Datatype *dtype) in MakeDatatype() argument 31 PetscCallMPI(MPI_Type_create_resized(tmptype, 0, sizeof(Unit), dtype)); in MakeDatatype() 32 PetscCallMPI(MPI_Type_commit(dtype)); in MakeDatatype() 36 PetscCallMPI(MPI_Type_get_extent(*dtype, &lb, &extent)); in MakeDatatype() 84 MPI_Datatype dtype; in main() local 111 PetscCall(MakeDatatype(&dtype)); in main() 129 …PetscCall(PetscCommBuildTwoSided(PETSC_COMM_WORLD, 1, dtype, nto, toranks, todata, &nfrom, &fromra… in main() 131 PetscCallMPI(MPI_Type_free(&dtype)); in main()
|
| /petsc/lib/petsc/bin/ |
| H A D | PetscBinaryIO.py | 217 self._inttype = np.dtype('>i8') 219 self._inttype = np.dtype('>i4') 241 vals = np.fromfile(fh, dtype=self._scalartype, count=1) 252 nz = np.fromfile(fh, dtype=self._inttype, count=1)[0] 254 vals = np.fromfile(fh, dtype=self._scalartype, count=nz) 265 metadata = np.array([Vec._classid, len(vec)], dtype=self._inttype) 285 M,N,nz = np.fromfile(fh, dtype=self._inttype, count=3) 286 I = np.empty(M+1, dtype=self._inttype) 288 rownz = np.fromfile(fh, dtype=self._inttype, count=M) 292 J = np.fromfile(fh, dtype=self._inttype, count=nz) [all …]
|
| H A D | PetscBinaryIOTrajectory.py | 26 t.append(np.fromfile(fh, dtype=io._scalartype, count=1)[0]) 33 nstrings = np.fromfile(fh, dtype=io._inttype, count=1)[0] 34 sizes = np.fromfile(fh, dtype=io._inttype, count=nstrings) 36 s = np.fromfile(fh, dtype=np.byte, count=sizes[i])
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | petscdevice.pxi | 70 cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1): argument 71 if isinstance(dtype, str): 72 dtype = dtype.upper() 74 return getattr(Device.Type, dtype) 76 raise ValueError("unknown device type: %s" % dtype) 77 return dtype 79 cdef inline str toDeviceType(PetscDeviceType dtype): argument 81 return Device.Type.__enum2str[dtype] 83 raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
|
| H A D | SF.pyx | 458 cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) 460 CHKERR(PetscSFBcastBegin(self.sf, dtype, <const void*>PyArray_DATA(rootdata), 484 cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) 486 CHKERR(PetscSFBcastEnd(self.sf, dtype, <const void*>PyArray_DATA(rootdata), 512 cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) 514 CHKERR(PetscSFReduceBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata), 538 cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) 540 CHKERR(PetscSFReduceEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata), 565 cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) 566 CHKERR(PetscSFScatterBegin(self.sf, dtype, <const void*>PyArray_DATA(multirootdata), [all …]
|
| /petsc/src/dm/impls/swarm/tutorials/ |
| H A D | ex1.c | 20 PetscDataType dtype; in main() local 59 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 60 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 67 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 68 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 80 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 81 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 83 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 84 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main()
|
| H A D | ex1f90.F90 | 20 PetscDataType :: dtype 48 PetscCallA(DMSwarmGetField(sw, 'w_q', bs, dtype, wq, ierr)) 49 PetscCallA(DMSwarmGetField(sw, 'DMSwarmPIC_coor', bs, dtype, coords, ierr)) 55 PetscCallA(DMSwarmRestoreField(sw, 'DMSwarmPIC_coor', bs, dtype, coords, ierr)) 56 PetscCallA(DMSwarmRestoreField(sw, 'w_q', bs, dtype, wq, ierr))
|
| /petsc/src/sys/utils/ |
| H A D | mpits.c | 73 …CommBuildTwoSided_Ibarrier(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, PetscMPIInt nto, … in PetscCommBuildTwoSided_Ibarrier() argument 84 PetscCallMPI(MPI_Type_get_extent(dtype, &lb, &unitbytes)); in PetscCommBuildTwoSided_Ibarrier() 88 …) PetscCallMPI(MPI_Issend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, … in PetscCommBuildTwoSided_Ibarrier() 107 PetscCallMPI(MPI_Recv(buf, count, dtype, status.MPI_SOURCE, tag, comm, MPI_STATUS_IGNORE)); in PetscCommBuildTwoSided_Ibarrier() 133 …ommBuildTwoSided_Allreduce(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, PetscMPIInt nto, … in PetscCommBuildTwoSided_Allreduce() argument 158 PetscCallMPI(MPI_Type_get_extent(dtype, &lb, &unitbytes)); in PetscCommBuildTwoSided_Allreduce() 164 …) PetscCallMPI(MPIU_Irecv((void *)(fdata + count * unitbytes * i), count, dtype, MPI_ANY_SOURCE, t… in PetscCommBuildTwoSided_Allreduce() 165 …) PetscCallMPI(MPIU_Isend((void *)(tdata + count * unitbytes * i), count, dtype, toranks[i], tag, … in PetscCommBuildTwoSided_Allreduce() 179 …mmBuildTwoSided_RedScatter(MPI_Comm comm, PetscMPIInt count, MPI_Datatype dtype, PetscMPIInt nto, … in PetscCommBuildTwoSided_RedScatter() argument 202 PetscCallMPI(MPI_Type_get_extent(dtype, &lb, &unitbytes)); in PetscCommBuildTwoSided_RedScatter() [all …]
|
| /petsc/src/sys/classes/bag/ |
| H A D | bag.c | 68 item->dtype = PETSC_ENUM; in PetscBagRegisterEnum() 121 item->dtype = PETSC_INT; in PetscBagRegisterIntArray() 172 item->dtype = PETSC_REAL; in PetscBagRegisterRealArray() 218 item->dtype = PETSC_INT; in PetscBagRegisterInt() 266 item->dtype = PETSC_INT; in PetscBagRegisterInt64() 318 item->dtype = PETSC_BOOL; in PetscBagRegisterBoolArray() 368 item->dtype = PETSC_CHAR; in PetscBagRegisterString() 416 item->dtype = PETSC_REAL; in PetscBagRegisterReal() 463 item->dtype = PETSC_SCALAR; in PetscBagRegisterScalar() 510 item->dtype = PETSC_BOOL; in PetscBagRegisterBool() [all …]
|
| /petsc/src/dm/ftn-mod/ |
| H A D | petscdmswarm.h90 | 2 subroutine DMSwarmGetField(dm, fieldname, blocksize, dtype, data, ierr) 9 PetscDataType dtype 14 subroutine DMSwarmRestoreField(dm, fieldname, blocksize, dtype, data, ierr) 21 PetscDataType dtype
|
| /petsc/src/sys/objects/kokkos/ |
| H A D | kinit.kokkos.cxx | 79 PetscDeviceType dtype; in PetscKokkosInitializeCheck() local 82 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in PetscKokkosInitializeCheck() 85 …if (dtype == PETSC_DEVICE_CUDA) PetscCallCXX(PetscKokkosExecutionSpacePtr = new Kokkos::DefaultExe… in PetscKokkosInitializeCheck() 87 …if (dtype == PETSC_DEVICE_HIP) PetscCallCXX(PetscKokkosExecutionSpacePtr = new Kokkos::DefaultExec… in PetscKokkosInitializeCheck() 89 if (dtype == PETSC_DEVICE_SYCL) { in PetscKokkosInitializeCheck()
|
| /petsc/share/petsc/matlab/ |
| H A D | PetscBagRead.m | 18 dtype = offsetdtype(2); variable 23 if dtype == 16 % integer 25 elseif dtype == 1 % double 27 elseif dtype == 6 % char 29 elseif dtype == 9 % truth 32 % elseif dtype == 7 % boolean 34 elseif dtype == 8 % Enum
|
| /petsc/src/binding/petsc4py/demo/legacy/dmplex/ |
| H A D | distribute_field.py | 23 [1.0, 1.0]], dtype=PETSc.RealType) 27 [4,5,8,7]], dtype=PETSc.IntType) 29 coords = np.zeros((0, 2), dtype=PETSc.RealType) 30 cells = np.zeros((0, 4), dtype=PETSc.IntType)
|
| /petsc/src/sys/objects/device/tests/ |
| H A D | ex11.cxx | 60 …" PetscInt64_FMT ", data: %p, destroy: %p}\n", j, PetscDeviceTypes[event->dtype], event->dctx_id, … in MarkedObjectMapView() 101 PetscDeviceType dtype; in TestAllCombinations() local 112 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in TestAllCombinations() 150 …][0]->dtype == dtype, "unexpected device type on event: %s, expected %s", PetscDeviceTypes[depende… in TestAllCombinations() 221 PetscDeviceType dtype; in CheckMapEqual() local 224 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in CheckMapEqual() 226 …jectMap(event->dtype == dtype, "unexpected device type on event: %s, expected %s", PetscDeviceType… in CheckMapEqual()
|
| H A D | ex7.c | 27 PetscDeviceType dtype; in TestAllocate() local 29 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in TestAllocate() 31 if (dtype == PETSC_DEVICE_HOST) PetscFunctionReturn(PETSC_SUCCESS); in TestAllocate() 104 PetscDeviceType dtype; in TestAsyncCoherence() local 108 PetscCall(PetscDeviceContextGetDeviceType(dctx, &dtype)); in TestAsyncCoherence() 115 if (dtype != PETSC_DEVICE_HOST) { in TestAsyncCoherence() 137 if (dtype != PETSC_DEVICE_HOST) { in TestAsyncCoherence()
|
| /petsc/src/sys/fileio/ |
| H A D | sysio.c | 788 PetscErrorCode MPIU_File_write_all(MPI_File fd, void *data, PetscMPIInt cnt, MPI_Datatype dtype, MP… in MPIU_File_write_all() argument 793 PetscCall(PetscMPIDataTypeToPetscDataType(dtype, &pdtype)); in MPIU_File_write_all() 795 PetscCallMPI(MPI_File_write_all(fd, data, cnt, dtype, status)); in MPIU_File_write_all() 800 PetscErrorCode MPIU_File_read_all(MPI_File fd, void *data, PetscMPIInt cnt, MPI_Datatype dtype, MPI… in MPIU_File_read_all() argument 805 PetscCall(PetscMPIDataTypeToPetscDataType(dtype, &pdtype)); in MPIU_File_read_all() 806 PetscCallMPI(MPI_File_read_all(fd, data, cnt, dtype, status)); in MPIU_File_read_all() 811 …at(MPI_File fd, MPI_Offset off, void *data, PetscMPIInt cnt, MPI_Datatype dtype, MPI_Status *statu… in MPIU_File_write_at() argument 816 PetscCall(PetscMPIDataTypeToPetscDataType(dtype, &pdtype)); in MPIU_File_write_at() 818 PetscCallMPI(MPI_File_write_at(fd, off, data, cnt, dtype, status)); in MPIU_File_write_at() 823 …at(MPI_File fd, MPI_Offset off, void *data, PetscMPIInt cnt, MPI_Datatype dtype, MPI_Status *statu… in MPIU_File_read_at() argument [all …]
|
| /petsc/include/ |
| H A D | petscsys.h | 2725 static inline PetscMPIInt MPIU_Get_count(MPI_Status *status, MPI_Datatype dtype, PetscCount *count) in MPIU_Get_count() argument 2730 err = MPI_Get_count(status, dtype, &count2); in MPIU_Get_count() 2735 static inline PetscMPIInt MPIU_Send(const void *buf, MPIU_Count count, MPI_Datatype dtype, PetscMPI… in MPIU_Send() argument 2740 err = MPI_Send((void *)buf, count2, dtype, dest, tag, comm); in MPIU_Send() 2744 static inline PetscMPIInt MPIU_Send_init(const void *buf, MPIU_Count count, MPI_Datatype dtype, Pet… in MPIU_Send_init() argument 2749 err = MPI_Send_init((void *)buf, count2, dtype, dest, tag, comm, request); in MPIU_Send_init() 2753 static inline PetscMPIInt MPIU_Isend(const void *buf, MPIU_Count count, MPI_Datatype dtype, PetscMP… in MPIU_Isend() argument 2758 err = MPI_Isend((void *)buf, count2, dtype, dest, tag, comm, request); in MPIU_Isend() 2762 static inline PetscMPIInt MPIU_Recv(const void *buf, MPIU_Count count, MPI_Datatype dtype, PetscMPI… in MPIU_Recv() argument 2767 err = MPI_Recv((void *)buf, count2, dtype, source, tag, comm, status); in MPIU_Recv() [all …]
|
| /petsc/src/ts/tests/ |
| H A D | ex30.c | 89 PetscDataType dtype; in makeSwarm() local 94 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in makeSwarm() 100 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in makeSwarm() 139 PetscDataType dtype; in particlesToGrid() local 144 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid() 147 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid() 305 PetscDataType dtype; in gridToParticles_private() local 309 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wp)); // take data out here in gridToParticles_private() 310 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in gridToParticles_private() 319 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wp)); in gridToParticles_private() [all …]
|
| /petsc/src/dm/impls/swarm/tests/ |
| H A D | ex7.c | 67 PetscDataType dtype; in gridToParticles() local 146 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in gridToParticles() 147 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in gridToParticles() 154 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in gridToParticles() 155 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in gridToParticles() 165 PetscDataType dtype; in particlesToGrid() local 172 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid() 173 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in particlesToGrid() 179 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in particlesToGrid() 180 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid()
|