示例#1
0
文件: file.go 项目: jmptrader/go-mpi
//File_seek_shared
//Updates the global shared file pointer (collective).
func File_seek_shared(fh File, offset Offset, whence int) int {

	err := C.MPI_File_seek_shared(C.MPI_File(fh),
		C.MPI_Offset(offset),
		C.int(whence))

	return int(err)
}
示例#2
0
文件: file.go 项目: jmptrader/go-mpi
//File_get_byte_offset
//Converts a view-relative offset into an absolute byte position.
func File_get_byte_offset(fh File, offset Offset) (Offset, int) {

	var disp C.MPI_Offset

	err := C.MPI_File_get_byte_offset(C.MPI_File(fh),
		C.MPI_Offset(offset),
		&disp)

	return Offset(disp), int(err)
}
示例#3
0
文件: file.go 项目: jmptrader/go-mpi
//File_write_at_all_begin
//Writes a file at explicitly specified offsets
//beginning part of a split collective routine (nonblocking).
func File_write_at_all_begin(fh File, offset Offset, buf unsafe.Pointer, count int, datatype Datatype) (File, int) {

	new_fh := C.MPI_File(fh)

	err := C.MPI_File_write_at_all_begin(new_fh,
		C.MPI_Offset(offset),
		buf,
		C.int(count),
		C.MPI_Datatype(datatype))

	return File(new_fh), int(err)
}
示例#4
0
文件: file.go 项目: jmptrader/go-mpi
//File_read_at_all_begin
//Reads a file at explicitly specified offsets;
//beginning part of a split collective routine (nonblocking).
func File_read_at_all_begin(fh File, offset Offset, count int, datatype Datatype) (unsafe.Pointer, int) {

	var buffer unsafe.Pointer

	err := C.MPI_File_read_at_all_begin(C.MPI_File(fh),
		C.MPI_Offset(offset),
		buffer,
		C.int(count),
		C.MPI_Datatype(datatype))

	return buffer, int(err)
}
示例#5
0
文件: file.go 项目: jmptrader/go-mpi
//File_set_view
//Changes process’s view of data in file (collective).
func File_set_view(fh File, disp Offset, etype Datatype, filetype Datatype, datarep string, info Info) (File, int) {

	new_fh := C.MPI_File(fh)
	err := C.MPI_File_set_view(fh,
		C.MPI_Offset(disp),
		C.MPI_Datatype(etype),
		C.MPI_Datatype(filetype),
		C.CString(datarep),
		C.MPI_Info(info))

	return File(new_fh), int(err)
}
示例#6
0
文件: file.go 项目: jmptrader/go-mpi
//File_iwrite_at
//Writes a file at an explicitly specified offset (nonblocking, noncollective).
func File_iwrite_at(fh File, offset Offset, buffer unsafe.Pointer, count int, datatype Datatype) (Request, int) {

	var request C.MPI_Request

	err := C.MPI_File_iwrite_at(C.MPI_File(fh),
		C.MPI_Offset(offset),
		buffer,
		C.int(count),
		C.MPI_Datatype(datatype),
		&request)

	return Request(request), int(err)
}
示例#7
0
文件: file.go 项目: jmptrader/go-mpi
//File_write_at_all
//Writes a file at explicitly specified offsets (blocking, collective).
func File_write_at_all(fh File, offset Offset, buffer unsafe.Pointer, count int, datatype Datatype) (Status, int) {

	var status C.MPI_Status

	err := C.MPI_File_write_at_all(C.MPI_File(fh),
		C.MPI_Offset(offset),
		buffer,
		C.int(count),
		C.MPI_Datatype(datatype),
		&status)

	return Status(status), int(err)
}
示例#8
0
文件: file.go 项目: jmptrader/go-mpi
//File_read_at
//Reads a file at an explicitly specified offset (blocking, noncollective).
func File_read_at(fh File, offset Offset, count int, datatype Datatype) (unsafe.Pointer, Status, int) {

	var buffer unsafe.Pointer
	var status C.MPI_Status

	err := C.MPI_File_read_at(C.MPI_File(fh),
		C.MPI_Offset(offset),
		buffer,
		C.int(count),
		C.MPI_Datatype(datatype),
		&status)

	return buffer, Status(status), int(err)
}
示例#9
0
文件: file.go 项目: jmptrader/go-mpi
//File_preallocate
//Preallocates a specified amount of storage space at the beginning of a file (collective).
func File_preallocate(fh File, size Offset) int {

	err := C.MPI_File_preallocate(C.MPI_File(fh), C.MPI_Offset(size))

	return int(err)
}
示例#10
0
文件: file.go 项目: jmptrader/go-mpi
//File_set_size
//Resizes a file (collective).
func File_set_size(fh File, size Offset) int {

	err := C.MPI_File_set_size(C.MPI_File(fh), C.MPI_Offset(size))

	return int(err)
}