ShadowSubdomainActor.cppGo to the documentation of this file.00001 /* ****************************************************************** ** 00002 ** OpenSees - Open System for Earthquake Engineering Simulation ** 00003 ** Pacific Earthquake Engineering Research Center ** 00004 ** ** 00005 ** ** 00006 ** (C) Copyright 1999, The Regents of the University of California ** 00007 ** All Rights Reserved. ** 00008 ** ** 00009 ** Commercial use of this program without express permission of the ** 00010 ** University of California, Berkeley, is strictly prohibited. See ** 00011 ** file 'COPYRIGHT' in main directory for information on usage and ** 00012 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. ** 00013 ** ** 00014 ** Developed by: ** 00015 ** Frank McKenna (fmckenna@ce.berkeley.edu) ** 00016 ** Gregory L. Fenves (fenves@ce.berkeley.edu) ** 00017 ** Filip C. Filippou (filippou@ce.berkeley.edu) ** 00018 ** ** 00019 ** ****************************************************************** */ 00020 00021 // $Revision: 1.2 $ 00022 // $Date: 2003/02/14 23:01:02 $ 00023 // $Source: /usr/local/cvs/OpenSees/SRC/domain/subdomain/ShadowSubdomainActor.cpp,v $ 00024 00025 00026 // Written: fmk 00027 // Created: 12/96 00028 // Revision: A 00029 // 00030 // Purpose: This file contains the code for a node process. 00031 // What: "@(#) ShadowSubdomainActor.C, revA" 00032 00033 #include <ActorSubdomain.h> 00034 #include <FEM_ObjectBroker.h> 00035 #include <TCP_Socket.h> 00036 // #include <TCP_SocketNoDelay.h> 00037 #include <UDP_Socket.h> 00038 #include <SocketAddress.h> 00039 #include <Message.h> 00040 00041 int main(int argv, char **argc) 00042 { 00043 int channelType = atoi(argc[1]); 00044 00045 00046 // 00047 // create a channel 00048 // 00049 00050 Channel *theChannel = 0; 00051 if (channelType == 1) { 00052 char *machine = argc[2]; 00053 int port = atoi(argc[3]); 00054 theChannel = new TCP_Socket(port,machine); 00055 } 00056 // else if (channelType == 2) { 00057 // char *machine = argc[2]; 00058 // int port = atoi(argc[3]); 00059 // theChannel = new UDP_Socket(port,machine); 00060 // { 00061 // else if (channelType == 3) { 00062 // char *machine = argc[2]; 00063 // int port = atoi(argc[3]); 00064 // theChannel = new TCP_SocketNoDelay(port,machine); 00065 // } 00066 else { 00067 opserr << "ACTOR PROCESS: ShadowSubdomainActor Exiting "; 00068 opserr << "- invalid channel type " << channelType << endln; 00069 exit(-1); 00070 } 00071 00072 if (theChannel == 0) { 00073 opserr << "ACTOR PROCESS: ShadowSubdomainActor Exiting "; 00074 opserr << "- could not create the channel " << endln; 00075 exit(-1); 00076 } 00077 00078 // 00079 // create an object broker 00080 // 00081 00082 FEM_ObjectBroker theObjectBroker; 00083 00084 // 00085 // create the actor object and start it running 00086 // 00087 00088 ActorSubdomain theActor(*theChannel,theObjectBroker); 00089 theActor.run(); 00090 00091 // exit normally 00092 opserr << "ShadowSubdomainActor:: ACTOR PROCESS EXITING\n\n"; 00093 // opserr << theActor; 00094 exit(0); 00095 } 00096 00097 |