--- trunk/OOPSE-4/src/io/mpiBASS.c 2004/09/24 04:16:43 1490 +++ trunk/OOPSE-4/src/io/mpiBASS.c 2005/07/13 15:54:00 2263 @@ -1,11 +1,52 @@ +/* + * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. + * + * The University of Notre Dame grants you ("Licensee") a + * non-exclusive, royalty free, license to use, modify and + * redistribute this software in source and binary code form, provided + * that the following conditions are met: + * + * 1. Acknowledgement of the program authors must be made in any + * publication of scientific results based in part on use of the + * program. An acceptable form of acknowledgement is citation of + * the article in which the program was described (Matthew + * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher + * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented + * Parallel Simulation Engine for Molecular Dynamics," + * J. Comput. Chem. 26, pp. 252-271 (2005)) + * + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 3. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * This software is provided "AS IS," without a warranty of any + * kind. All express or implied conditions, representations and + * warranties, including any implied warranty of merchantability, + * fitness for a particular purpose or non-infringement, are hereby + * excluded. The University of Notre Dame and its licensors shall not + * be liable for any damages suffered by licensee as a result of + * using, modifying or distributing the software or its + * derivatives. In no event will the University of Notre Dame or its + * licensors be liable for any lost revenue, profit or data, or for + * direct, indirect, special, consequential, incidental or punitive + * damages, however caused and regardless of the theory of liability, + * arising out of the use of or inability to use software, even if the + * University of Notre Dame has been advised of the possibility of + * such damages. + */ + #ifdef IS_MPI #include #include #include #define __mpiBASSEVENT -#include "mpiBASS.h" -#include "simError.h" +#include "io/mpiBASS.h" +#include "utils/simError.h" void mpiCatchEvent(void); @@ -58,71 +99,71 @@ void throwMPIEvent(event* the_event) switch (the_event->event_type){ case MOLECULE: mpiEventContainer.type = mpiMOLECULE; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int - break; + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int */ + break; case RIGIDBODY: mpiEventContainer.type = mpiRIGIDBODY; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int - break; + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int */ + break; case CUTOFFGROUP: mpiEventContainer.type = mpiCUTOFFGROUP; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int - break; + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int */ + break; case ATOM: mpiEventContainer.type = mpiATOM; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case BOND: mpiEventContainer.type = mpiBOND; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case BEND: mpiEventContainer.type = mpiBEND; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case TORSION: mpiEventContainer.type = mpiTORSION; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case ZCONSTRAINT: mpiEventContainer.type = mpiZCONSTRAINT; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case COMPONENT: mpiEventContainer.type = mpiCOMPONENT; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + mpiEventContainer.i1 = the_event->evt.blk_index; /* pack block index into first int*/ break; case POSITION: mpiEventContainer.type = mpiPOSITION; - mpiEventContainer.d1 = the_event->evt.pos.x; // pack pos coord into d + mpiEventContainer.d1 = the_event->evt.pos.x; /* pack pos coord into d*/ mpiEventContainer.d2 = the_event->evt.pos.y; mpiEventContainer.d3 = the_event->evt.pos.z; break; case ORIENTATION: mpiEventContainer.type = mpiORIENTATION; - mpiEventContainer.d1 = the_event->evt.ornt.phi; // pack orientation coord into d + mpiEventContainer.d1 = the_event->evt.ornt.phi; /* pack orientation coord into d*/ mpiEventContainer.d2 = the_event->evt.ornt.theta; mpiEventContainer.d3 = the_event->evt.ornt.psi; break; case CONSTRAINT: mpiEventContainer.type = mpiCONSTRAINT; - mpiEventContainer.d1 = the_event->evt.cnstr; // pack constraint coord into d + mpiEventContainer.d1 = the_event->evt.cnstr; /* pack constraint coord into d*/ break; case MEMBERS: mpiEventContainer.type = mpiMEMBERS; - mpiEventContainer.i1 = the_event->evt.mbrs.nMembers ; // pack member ints into i + mpiEventContainer.i1 = the_event->evt.mbrs.nMembers ; /* pack member ints into i*/ break; case ASSIGNMENT: @@ -167,8 +208,8 @@ void throwMPIEvent(event* the_event) if (the_event->event_type == MEMBERS) { - // For member lists, we need a separate broadcast to spew out the - // membership array: + /* For member lists, we need a separate broadcast to spew out the*/ + /* membership array:*/ MPI_Bcast(the_event->evt.mbrs.memberList, the_event->evt.mbrs.nMembers, MPI_INT, 0, MPI_COMM_WORLD); @@ -182,7 +223,7 @@ void throwMPIEvent(event* the_event) } -// Everybody but node 0 runs this +/* Everybody but node 0 runs this*/ void mpiEventLoop(void) { int mpiContinue; @@ -306,9 +347,9 @@ void mpiCatchEvent(void) the_event.evt.mbrs.nMembers = mpiEventContainer.i1; the_event.evt.mbrs.memberList = (int *) calloc(the_event.evt.mbrs.nMembers, - sizeof(int)); + sizeof(int)); - // Grab the member list since we have a number of members: + /* Grab the member list since we have a number of members:*/ MPI_Bcast(the_event.evt.mbrs.memberList, the_event.evt.mbrs.nMembers, MPI_INT, 0, MPI_COMM_WORLD);