Emulation and simulation of
Wireless Sensor Networks


   Project Page






 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/OrbisQuartus/control/mini_mpi_server.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <mini_mpi.h>
#include <daemon.h>
#include "mini_mpi_server.h"

Go to the source code of this file.


struct  task_handle


#define TIMEOUT   180
#define BACKLOG   10


typedef task_handle task_t


int get_cluster_size (void)
int get_task_socket (int i)
void change_task_flag (int i, short f)
int tasks_to_string (int count, task_t *head, char *string)
void * mpi_handler (void *t)
void * mini_mpi_server (void *arg_struct)


timeval _beginning_
volatile unsigned int __first__
volatile unsigned int _proc_count_
pthread_cond_t mpi_conditional
pthread_mutex_t mpi_mutex
pthread_mutex_t task_mutex

Define Documentation

#define BACKLOG   10

Definition at line 57 of file mini_mpi_server.c.

#define TIMEOUT   180

Definition at line 55 of file mini_mpi_server.c.

Typedef Documentation

typedef struct task_handle task_t

Function Documentation

void change_task_flag int  i,
short  f

Definition at line 108 of file mini_mpi_server.c.

References task_handle::flag, task_handle::id, mpi_mutex, task_handle::next, and tasks_head.

int get_cluster_size void   ) 

Definition at line 81 of file mini_mpi_server.c.

References _proc_count_, and mpi_mutex.

Referenced by ctl_server(), and virtual_time_server().

int get_task_socket int  i  ) 

Definition at line 90 of file mini_mpi_server.c.

References task_handle::fd, task_handle::id, mpi_mutex, task_handle::next, task_handle::sock, and tasks_head.

Referenced by ctl_server().

void* mini_mpi_server void *  arg_struct  ) 

Definition at line 239 of file mini_mpi_server.c.

References _proc_count_, BACKLOG, daemon_quitting(), daemon_shuttingdown(), task_handle::fd, task_handle::flag, task_handle::id, task_handle::ip_addr, task_handle::list, mpi_handler(), mpi_mutex, MPI_PORT, task_handle::next, task_mutex, tasks_head, tasks_tail, and task_handle::thread.

Referenced by main().

void* mpi_handler void *  t  ) 

Definition at line 175 of file mini_mpi_server.c.

References _proc_count_, daemon_shuttingdown(), task_handle::fd, task_handle::id, MINI_MPI_ABORT, MINI_MPI_BARRIER, MINI_MPI_FINAL, MINI_MPI_GATHER, MINI_MPI_HEAD, MINI_MPI_INIT, MINI_MPI_RECV, MINI_MPI_SCATTER, MINI_MPI_SEND, mpi_conditional, mpi_mutex, task_mutex, tasks_head, and tasks_to_string().

Referenced by mini_mpi_server().

int tasks_to_string int  count,
task_t head,
char *  string

Definition at line 125 of file mini_mpi_server.c.

References task_handle::id, task_handle::ip_addr, and task_handle::next.

Referenced by mpi_handler().

Variable Documentation

volatile unsigned int __first__

Definition at line 61 of file mini_mpi_server.c.

struct timeval _beginning_

Definition at line 60 of file mini_mpi_server.c.

volatile unsigned int _proc_count_

Definition at line 62 of file mini_mpi_server.c.

Referenced by get_cluster_size(), mini_mpi_server(), and mpi_handler().

pthread_cond_t mpi_conditional

Definition at line 64 of file mini_mpi_server.c.

Referenced by main(), mpi_handler(), and virtual_time_server().

pthread_mutex_t mpi_mutex

Definition at line 65 of file mini_mpi_server.c.

Referenced by change_task_flag(), get_cluster_size(), get_task_socket(), main(), mini_mpi_server(), mpi_handler(), and virtual_time_server().

pthread_mutex_t task_mutex

Definition at line 66 of file mini_mpi_server.c.

Referenced by mini_mpi_server(), and mpi_handler().

task_t* tasks_head

Definition at line 78 of file mini_mpi_server.c.

Referenced by change_task_flag(), get_task_socket(), mini_mpi_server(), and mpi_handler().

task_t * tasks_tail

Definition at line 78 of file mini_mpi_server.c.

Referenced by mini_mpi_server().

© 2007, Los Alamos National Security, LLC.