欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

az_interface.c

并行解法器,功能强大
C
字号:
/*==================================================================== * ------------------------ * | CVS File Information | * ------------------------ * * $RCSfile: az_interface.c,v $ * * $Author: tuminaro $ * * $Date: 2000/06/02 16:46:55 $ * * $Revision: 1.14 $ * * $Name:  $ *====================================================================*/#ifndef lintstatic char rcsid[] = "$Id: az_interface.c,v 1.14 2000/06/02 16:46:55 tuminaro Exp $";#endif/******************************************************************************* * Copyright 1995, Sandia Corporation.  The United States Government retains a * * nonexclusive license in this software as prescribed in AL 88-1 and AL 91-7. * * Export of this program may require a license from the United States         * * Government.                                                                 * ******************************************************************************/#include <stdio.h>#include <stdlib.h>#include "az_aztec.h"extern double second(void);extern void get_parallel_info(int *proc, int *nprocs, int *dim);#ifdef AZ_MPIextern void parallel_info(int *proc, int *nprocs, int *dim, MPI_Comm comm);#elseextern void parallel_info(int *proc, int *nprocs, int *dim);#endif/******************************************************************************//******************************************************************************//******************************************************************************/double AZ_second(void){  return second();} /* AZ_second *//******************************************************************************//******************************************************************************//******************************************************************************/void AZ_processor_info(int proc_config[]){  static int first_time = 1;  AZ__MPI_comm_space_ok();  get_parallel_info(&(proc_config[AZ_node]), &(proc_config[AZ_N_procs]),                    &(proc_config[AZ_dim]));  proc_config[AZ_Comm_MPI] = 1;  if ((proc_config[AZ_node] == 0) && (first_time==1))     printf("Warning: AZ_processor_info() command should be replaced with AZ_set_proc_config()\n");  first_time = 0;} /* AZ_processor_info */void AZ_set_proc_config(int proc_config[], MPI_AZComm comm){  AZ__MPI_comm_space_ok();#ifdef AZ_MPI  parallel_info(&(proc_config[AZ_node]), &(proc_config[AZ_N_procs]),                &(proc_config[AZ_dim]), comm);#else  get_parallel_info(&(proc_config[AZ_node]), &(proc_config[AZ_N_procs]),                    &(proc_config[AZ_dim]));  proc_config[AZ_Comm_MPI] = 1;#endif  AZ_set_comm(proc_config, comm);} /* get_parallel_info */MPI_AZComm *AZ_get_comm(int proc_config[]){   if (proc_config[AZ_Comm_Set] != AZ_Done_by_User) {      printf("Error(AZ_get_comm):Communicator not set. Use AZ_set_comm()\n   ");      printf("              (e.g. AZ_set_comm(proc_config,MPI_COMM_WORLD)).\n");      exit(1);   }#ifndef AZ_MPI   printf("Warning(AZ_get_comm):Not using MPI? Returning bogus communicator\n");#endif   return( (MPI_AZComm *) &(proc_config[AZ_Comm_MPI]) );}void AZ_set_comm(int proc_config[], MPI_AZComm comm){#ifdef AZ_MPI  char *ptr1, *ptr2;  int  i;#endif  AZ__MPI_comm_space_ok();#ifdef AZ_MPI  ptr1 = (char *) &comm;  ptr2 = (char *) &(proc_config[AZ_Comm_MPI]);  for (i = 0; i < sizeof(MPI_AZComm); i++) ptr2[i] = ptr1[i];#else  proc_config[AZ_Comm_MPI] = 1;#endif  proc_config[AZ_Comm_Set] = AZ_Done_by_User;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -