N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/OrbisQuartus/server/mini_mpi-internal.h

Go to the documentation of this file.
00001 
00014 /*
00015  * Copyright 2007. Los Alamos National Security, LLC. This material
00016  * was produced under U.S. Government contract DE-AC52-06NA25396 for
00017  * Los Alamos National Laboratory (LANL), which is operated by Los
00018  * Alamos National Security, LLC, for the Department of Energy. The
00019  * U.S. Government has rights to use, reproduce, and distribute this
00020  * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY,
00021  * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL
00022  * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to
00023  * produce derivative works, such modified software should be clearly
00024  * marked, so as not to confuse it with the version available from LANL.
00025  *
00026  * Additionally, this program is free software; you can redistribute
00027  * it and/or modify it under the terms of the GNU General Public
00028  * License as published by the Free Software Foundation; version 2 of
00029  * the License. Accordingly, this program is distributed in the hope
00030  * it will be useful, but WITHOUT ANY WARRANTY; without even the
00031  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00032  * PURPOSE. See the GNU General Public License for more details.
00033  */
00034 
00035 
00036 #ifndef _MINI_MPI_INTERNAL_H_
00037 #define _MINI_MPI_INTERNAL_H_
00038 
00039 #ifdef USING_L4
00040 #include <lwip/sockets.h>
00041 #include <lwip/inet.h>
00042 #else
00043 #include <netinet/in.h>
00044 #include <arpa/inet.h>
00045 #endif
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00051 #define MAX_MTU    1000
00052 
00053 typedef union {
00054         int fd;
00055         void *nc;
00056 } socket_ptr_t;
00057 
00058 typedef struct task_handle {
00059         socket_ptr_t sock;
00060         struct sockaddr_in ip_addr;
00061 } task_t;
00062 
00063 void string_to_tasks(int count, char *str, task_t *head);
00064 int type_size(MPI_Datatype type);
00065 int buffer_to_char(char *string, int len, void *buf, int count, 
00066                    MPI_Datatype type);
00067 int char_to_buffer(void *buf, int count, MPI_Datatype type, char *string);
00068 
00069 
00070 #ifdef __cplusplus
00071 }
00072 #endif
00073 
00074 #endif  // _MINI_MPI_INTERNAL_H_


© 2007, Los Alamos National Security, LLC.