Skip to content

Restore Olden and Ptrdist to unchecked versions #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions MultiSource/Benchmarks/Olden/bh/args.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* For copyright information, see olden_v1.0/COPYRIGHT */
#include <stdlib.h>

#pragma CHECKED_SCOPE ON

extern int NumNodes;
extern int nbody;

int dealwithargs(int argc, _Array_ptr<_Nt_array_ptr<char>> argv : count(argc)) {
int dealwithargs(int argc, char *argv[]) {
int level;

if (argc > 2)
Expand Down
3 changes: 1 addition & 2 deletions MultiSource/Benchmarks/Olden/bh/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* It's free because it's yours.
*/

#pragma CHECKED_SCOPE ON

/* Former global variables. convert to #defines */

Expand All @@ -21,7 +20,7 @@

extern int nbody;

#pragma CHECKED_SCOPE OFF




Expand Down
46 changes: 20 additions & 26 deletions MultiSource/Benchmarks/Olden/bh/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#ifdef TORONTO
#include <stdio_checked.h>
#include <stdio.h>
#define chatting printf
#define PLAIN
#define LOCAL(xxx) xxx
Expand All @@ -26,12 +26,9 @@ int NumNodes;
#define THREEDIM
#include "vectmath.h"

#pragma CHECKED_SCOPE ON

#define MAX_NUM_NODES 64
extern double fabs(double);
extern double fabs();

#define printf(...) _Unchecked { printf(__VA_ARGS__); }

/*
* BODY and CELL data structures are used to represent the tree:
Expand Down Expand Up @@ -65,10 +62,9 @@ typedef struct node{
int proc; /* parent's processor number */
int new_proc; /* processor where this node will reside */
#ifdef JUMP
_Ptr<struct node> next_few_node;
struct node * next_few_node;
#endif
} node;
typedef _Ptr<struct node> nodeptr;
} node, *nodeptr;

/***
#define Type(x) (((nodeptr) (x))->type)
Expand All @@ -89,7 +85,7 @@ typedef _Ptr<struct node> nodeptr;

#define BODY 01 /* type code for bodies */

typedef _Ptr<struct bnode> bodyptr;
typedef struct bnode *bodyptr;

typedef struct bnode {
short type;
Expand All @@ -98,7 +94,7 @@ typedef struct bnode {
int proc; /* parent's processor number */
int new_proc;
#ifdef JUMP
_Ptr<struct node> next_few_node;
struct node * next_few_node;
#endif
vector vel; /* velocity of body */
vector acc; /* acceleration of body */
Expand Down Expand Up @@ -131,7 +127,7 @@ typedef struct bnode {

#define NSUB (1 << NDIM) /* subcells per cell */

typedef _Ptr<struct cnode> cellptr;
typedef struct cnode *cellptr;

typedef struct cnode {
short type;
Expand All @@ -140,9 +136,9 @@ typedef struct cnode {
int proc;
int new_proc;
#ifdef JUMP
_Ptr<struct node> next_few_node;
struct node * next_few_node;
#endif
nodeptr subp _Checked[NSUB]; /* descendents of cell */
nodeptr subp[NSUB]; /* descendents of cell */
cellptr next; /* for free list */

} cell;
Expand All @@ -156,13 +152,12 @@ typedef struct cnode {
#define FL_Next(x) ((x)->next)

typedef struct {
real rmin _Checked[3];
real rmin[3];
real rsize;
nodeptr root;
bodyptr bodytab _Checked[MAX_NUM_NODES];
bodyptr bodiesperproc _Checked[MAX_NUM_NODES];
} tree;
typedef _Ptr<tree> treeptr;
bodyptr bodytab[MAX_NUM_NODES];
bodyptr bodiesperproc[MAX_NUM_NODES];
} tree, *treeptr;

#define Root(t) ((t)->root)
#define Rmin(t) ((t)->rmin)
Expand All @@ -173,24 +168,23 @@ typedef _Ptr<tree> treeptr;



struct {
typedef struct {
real tnow;
real tout;
int nsteps;
} timerecord;
typedef _Ptr<struct timerecord> timeptr;
} timerecord, *timeptr;

#define Tnow(t) ((t)->tnow)
#define Tout(t) ((t)->tout)
#define Nsteps(t) ((t)->nsteps)

typedef struct {
int xp _Checked[NDIM];
int xp[NDIM];
bool inb;
} icstruct;

typedef struct {
double v _Checked[NDIM];
double v[NDIM];
} vecstruct;


Expand Down Expand Up @@ -228,10 +222,10 @@ global real xxxrsize; /* side-length of integer coordinate box */

typedef struct {
real mtot; /* total mass of N-body system */
real etot _Checked[3]; /* binding, kinetic, potential energy */
real etot[3]; /* binding, kinetic, potential energy */
matrix keten; /* kinetic energy tensor */
matrix peten; /* potential energy tensor */
vector cmphase _Checked[2]; /* center of mass coordinates */
vector cmphase[2]; /* center of mass coordinates */
vector amvec; /* angular momentum vector */
} ostruct;

Expand All @@ -250,5 +244,5 @@ extern int nbody;



#pragma CHECKED_SCOPE OFF


Loading