Exemple #1
0
//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)
}
Exemple #2
0
//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)
}
Exemple #3
0
//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)
}
Exemple #4
0
//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)
}
Exemple #5
0
//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)
}
Exemple #6
0
//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)
}
Exemple #7
0
//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)
}
Exemple #8
0
//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)
}
Exemple #9
0
//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)
}
Exemple #10
0
//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)
}