Emulation and simulation of
Wireless Sensor Networks


   Project Page






 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/OrbisQuartus/server/virtual_time.cpp File Reference

Virtual Time implementation. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <avl.h>
#include <daemon.h>
#include <mini_mpi.h>
#include <orbisquartus.h>
#include <sensor_node.h>
#include <mutex.h>
#include "virtual_time.h"

Go to the source code of this file.


#define BIT_RATE   400


int checkpoint (unsigned long node_id)
int chkpt_all (void)
int restore (unsigned long node_id)
void virtual_time_iterate (void)


mutex_t vt_mutex
mutex_t vt_sync
AVL_tree< VT_timestampsend_queue
AVL_tree< VT_timestamprcv_queue
AVL_tree< VT_timestampstate_queue
int my_taskid

Detailed Description

Virtual Time implementation.


Original Author: Sean M. Brennan <brennan@lanl.gov>


Created: October 23, 2006

2007/10/11 17:13:29

Definition in file virtual_time.cpp.

Define Documentation

#define BIT_RATE   400

Definition at line 47 of file virtual_time.cpp.

Referenced by VT_message::VT_message().

Function Documentation

int checkpoint unsigned long  node_id  ) 

FIXME: manage vt message queues

FIXME: store disk snapshot

Definition at line 97 of file virtual_time.cpp.

References OrbisQuartus::cfg, AVL_node< Key >::elt(), error, AVL_tree< Key >::find(), Configuration::get_nodes(), oq, Sensor_node::pause(), Sensor_node::save(), and Sensor_node::unpause().

Referenced by chkpt_all().

int chkpt_all void   ) 

Definition at line 118 of file virtual_time.cpp.

References checkpoint(), error, OrbisQuartus::get_assignment(), and oq.

int restore unsigned long  node_id  ) 

FIXME: restore from chkpt

Definition at line 135 of file virtual_time.cpp.

References error.

void virtual_time_iterate void   ) 

Definition at line 148 of file virtual_time.cpp.

References VT_timestamp::tick().

Referenced by OrbisQuartus::iterate().

Variable Documentation

int my_taskid

Definition at line 45 of file mini_mpi.c.

OrbisQuartus* oq

Definition at line 49 of file virtual_time.cpp.

AVL_tree<VT_timestamp> rcv_queue

Definition at line 54 of file virtual_time.cpp.

AVL_tree<VT_timestamp> send_queue

Definition at line 53 of file virtual_time.cpp.

Referenced by vt_recv(), and vt_send().

AVL_tree<VT_timestamp> state_queue

Definition at line 55 of file virtual_time.cpp.

mutex_t vt_mutex

Definition at line 50 of file virtual_time.cpp.

Referenced by virtual_time_client().

mutex_t vt_sync

Definition at line 51 of file virtual_time.cpp.

Referenced by virtual_time_client().

© 2007, Los Alamos National Security, LLC.