📄 allmpi.c
字号:
/* -*- Mode: C; c-basic-offset:4 ; -*- *//* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */#include "mpi.h"/* necessary to get the conditional definitions: HAVE_FORTRAN_BINDING MPI_MPI_IO*/#include "mpitestconf.h"#include <stdio.h>#include <string.h>void handler( MPI_Comm *comm_ptr, int *int_ptr, ... ) {}int comm_copy_attr_fn(MPI_Comm comm, int i, void * buf1, void *buf2, void *buf3, int *int_ptr) {return 0;}int comm_delete_attr_fn(MPI_Comm comm, int i, void *buf1, void *buf2) {return 0;}int tcopy_attr_fn(MPI_Datatype dtype, int i, void *buf1, void *buf2, void *buf3, int *int_ptr) {return 0;}int tdelete_attr_fn(MPI_Datatype dtype, int i, void *buf1, void *buf2) {return 0;}int win_copy_attr_fn(MPI_Win win, int i, void *buf1, void *buf2, void *buf3, int *int_ptr) {return 0;}int win_delete_attr_fn(MPI_Win win, int i, void *buf1, void *buf2) {return 0;}void comm_errhan(MPI_Comm *comm_ptr, int *int_ptr, ...) {}#ifdef HAVE_MPI_IOvoid file_errhan(MPI_File *file_ptr, int *int_ptr, ...) {}#endifvoid win_errhan(MPI_Win *win_ptr, int *int_ptr, ...) {}void user_fn( void *buf1, void *buf2, int *int_ptr, MPI_Datatype *dtype_ptr) {}int copy_fn(MPI_Comm comm, int i, void *buf1, void *buf2, void *buf3, int *int_ptr) {return 0;}int delete_fn(MPI_Comm comm, int i, void *buf1, void *buf2) {return 0;}int cancel_fn(void *buf, int i) {return 0;}int free_fn(void *buf) {return 0;}int query_fn(void *buf, MPI_Status *status_ptr) {return 0;}int conversion_fn(void *buf1, MPI_Datatype dtype, int i, void *buf2, MPI_Offset offset, void *buf3) {return 0;}int extent_fn(MPI_Datatype dtype, MPI_Aint *aint_ptr, void *buf) {return 0;}void testAll(void){ char *cbuf = NULL; int *ibuf = NULL; void *vbuf = NULL; int i = 0; int rank = 0; int tag = 0; MPI_Datatype dtype = MPI_BYTE; MPI_Comm comm = MPI_COMM_WORLD; MPI_Request request = MPI_REQUEST_NULL; MPI_Status status; MPI_Group group = MPI_GROUP_NULL; MPI_Win win = MPI_WIN_NULL; MPI_User_function user_fn; MPI_Op op = MPI_SUM; MPI_Aint aint = 0; MPI_Fint fint = 0; MPI_Copy_function copy_fn; MPI_Delete_function delete_fn; MPI_Errhandler errhan; int a3[1][3]; int argc = 0; char **argv = NULL; char ***argvp = NULL; MPI_Info info = MPI_INFO_NULL; char *cmd = NULL; char *type_name = NULL;#ifdef HAVE_MPI_IO MPI_File file = MPI_FILE_NULL; char *filename = NULL; int amode = 0; MPI_Offset size = 0, offset = 0; MPI_Request iorequest;#endif MPI_Send(vbuf, i, dtype, i, i, comm); MPI_Recv(vbuf, i, dtype, rank, tag, comm, &status); MPI_Get_count(&status, dtype, &i); MPI_Bsend(vbuf, i, dtype, rank, tag, comm); MPI_Ssend(vbuf, i, dtype, rank, tag, comm); MPI_Rsend(vbuf, i, dtype, rank, tag, comm); MPI_Buffer_attach( vbuf, i); MPI_Buffer_detach( vbuf, &i); MPI_Isend(vbuf, i, dtype, rank, tag, comm, &request); MPI_Ibsend(vbuf, i, dtype, rank, tag, comm, &request); MPI_Issend(vbuf, i, dtype, rank, tag, comm, &request); MPI_Irsend(vbuf, i, dtype, rank, tag, comm, &request); MPI_Irecv(vbuf, i, dtype, rank, tag, comm, &request); MPI_Wait(&request, &status); MPI_Test(&request, &i, &status); MPI_Request_free(&request); MPI_Waitany(i, &request, &i, &status); MPI_Testany(i, &request, &i, &i, &status); MPI_Waitall(i, &request, &status); MPI_Testall(i, &request, &i, &status); MPI_Waitsome(i, &request, &i, &i, &status); MPI_Testsome(i, &request, &i, &i, &status); MPI_Iprobe(i, i, comm, &i, &status); MPI_Probe(i, i, comm, &status); MPI_Cancel(&request); MPI_Test_cancelled(&status, &i); MPI_Send_init(vbuf, i, dtype, rank, tag, comm, &request); MPI_Bsend_init(vbuf, i, dtype, i,i, comm, &request); MPI_Ssend_init(vbuf, i, dtype, i,i, comm, &request); MPI_Rsend_init(vbuf, i, dtype, i,i, comm, &request); MPI_Recv_init(vbuf, i, dtype, i,i, comm, &request); MPI_Start(&request); MPI_Startall(i, &request); MPI_Sendrecv(vbuf, i, dtype,rank, tag, vbuf, i, dtype, rank, tag, comm, &status); MPI_Sendrecv_replace(vbuf, i, dtype, rank, tag, rank, tag, comm, &status); MPI_Type_contiguous(i, dtype, &dtype); MPI_Type_vector(i, i, i, dtype, &dtype); MPI_Type_hvector(i, i, aint, dtype, &dtype); MPI_Type_indexed(i, &i, &i, dtype, &dtype); MPI_Type_hindexed(i, &i, &aint, dtype, &dtype); MPI_Type_struct(i, &i, &aint, &dtype, &dtype); MPI_Address(vbuf, &aint); MPI_Type_extent(dtype, &aint); MPI_Type_size(dtype, &i); MPI_Type_lb(dtype, &aint); MPI_Type_ub(dtype, &aint); MPI_Type_commit(&dtype); MPI_Type_free(&dtype); MPI_Get_elements(&status, dtype, &i); MPI_Pack(vbuf, i, dtype, vbuf, i, &i, comm); MPI_Unpack(vbuf, i, &i, vbuf, i, dtype, comm); MPI_Pack_size(i, dtype, comm, &i); MPI_Barrier(comm ); MPI_Bcast(vbuf, i, dtype, i, comm ); MPI_Gather(vbuf , i, dtype, vbuf, i, dtype, i, comm); MPI_Gatherv(vbuf , i, dtype, vbuf, &i, &i, dtype, i, comm); MPI_Scatter(vbuf , i, dtype, vbuf, i, dtype, i, comm); MPI_Scatterv(vbuf , &i, &i, dtype, vbuf, i, dtype, i, comm); MPI_Allgather(vbuf , i, dtype, vbuf, i, dtype, comm); MPI_Allgatherv(vbuf , i, dtype, vbuf, &i, &i, dtype, comm); MPI_Alltoall(vbuf , i, dtype, vbuf, i, dtype, comm); MPI_Alltoallv(vbuf , &i, &i, dtype, vbuf, &i, &i, dtype, comm); MPI_Reduce(vbuf , vbuf, i, dtype, op, i, comm); MPI_Op_create(&user_fn, i, &op); MPI_Op_free( &op); MPI_Allreduce(vbuf , vbuf, i, dtype, op, comm); MPI_Reduce_scatter(vbuf , vbuf, &i, dtype, op, comm); MPI_Scan(vbuf , vbuf, i, dtype, op, comm ); MPI_Group_size(group, &i); MPI_Group_rank(group, &i); MPI_Group_translate_ranks (group, i, &i, group, &i); MPI_Group_compare(group, group, &i); MPI_Comm_group(comm, &group); MPI_Group_union(group, group, &group); MPI_Group_intersection(group, group, &group); MPI_Group_difference(group, group, &group); MPI_Group_incl(group, i, &i, &group); MPI_Group_excl(group, i, &i, &group); MPI_Group_range_incl(group, i, a3, &group); MPI_Group_range_excl(group, i, a3, &group); MPI_Group_free(&group); MPI_Comm_size(comm, &i); MPI_Comm_rank(comm, &i); MPI_Comm_compare(comm, comm, &i); MPI_Comm_dup(comm, &comm); MPI_Comm_create(comm, group, &comm); MPI_Comm_split(comm, i, i, &comm); MPI_Comm_free(&comm); MPI_Comm_test_inter(comm, &i); MPI_Comm_remote_size(comm, &i); MPI_Comm_remote_group(comm, &group); MPI_Intercomm_create(comm, i, comm, i, i, &comm ); MPI_Intercomm_merge(comm, i, &comm); MPI_Keyval_create(©_fn, &delete_fn, &i, vbuf); MPI_Keyval_free(&i); MPI_Attr_put(comm, i, vbuf); MPI_Attr_get(comm, i, vbuf, &i); MPI_Attr_delete(comm, i); MPI_Topo_test(comm, &i); MPI_Cart_create(comm, i, &i, &i, i, &comm); MPI_Dims_create(i, i, &i); MPI_Graph_create(comm, i, &i, &i, i, &comm); MPI_Graphdims_get(comm, &i, &i); MPI_Graph_get(comm, i, i, &i, &i); MPI_Cartdim_get(comm, &i); MPI_Cart_get(comm, i, &i, &i, &i); MPI_Cart_rank(comm, &i, &i); MPI_Cart_coords(comm, i, i, &i); MPI_Graph_neighbors_count(comm, i, &i); MPI_Graph_neighbors(comm, i, i, &i); MPI_Cart_shift(comm, i, i, &i, &i); MPI_Cart_sub(comm, &i, &comm); MPI_Cart_map(comm, i, &i, &i, &i); MPI_Graph_map(comm, i, &i, &i, &i); MPI_Get_processor_name(cbuf, &i); MPI_Get_version(&i, &i); MPI_Errhandler_create(&handler, &errhan); MPI_Errhandler_set(comm, errhan); MPI_Errhandler_get(comm, &errhan); MPI_Errhandler_free(&errhan);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -