Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
b5332aff
Commit
b5332aff
authored
Mar 24, 2015
by
Elsa Gonsiorowski (Uranus)
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
5509f22e
e6c7f2e0
Changes
55
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
2368 additions
and
1515 deletions
+2368
-1515
codes/codes-workload.h
codes/codes-workload.h
+9
-8
codes/codeslogging.h
codes/codeslogging.h
+0
-183
codes/configuration.h
codes/configuration.h
+3
-1
codes/local-storage-model.h
codes/local-storage-model.h
+19
-1
codes/timeline.h
codes/timeline.h
+0
-76
codes/tools.h
codes/tools.h
+0
-56
configure.ac
configure.ac
+1
-1
doc/BUILD_STEPS
doc/BUILD_STEPS
+9
-0
doc/GETTING_STARTED
doc/GETTING_STARTED
+2
-4
reformat.sh
reformat.sh
+109
-0
src/Makefile.subdir
src/Makefile.subdir
+15
-34
src/iokernellang/CodesIOKernelContext.h
src/iokernellang/CodesIOKernelContext.h
+0
-0
src/iokernellang/CodesIOKernelParser.h
src/iokernellang/CodesIOKernelParser.h
+2
-2
src/iokernellang/CodesIOKernelTypes.h
src/iokernellang/CodesIOKernelTypes.h
+1
-1
src/iokernellang/CodesKernelHelpers.c
src/iokernellang/CodesKernelHelpers.c
+15
-21
src/iokernellang/CodesKernelHelpers.h
src/iokernellang/CodesKernelHelpers.h
+4
-4
src/iokernellang/codesImpl.c
src/iokernellang/codesImpl.c
+2
-2
src/iokernellang/codeslexer.c
src/iokernellang/codeslexer.c
+53
-48
src/iokernellang/codeslexer.h
src/iokernellang/codeslexer.h
+4
-4
src/iokernellang/codeslexer.l
src/iokernellang/codeslexer.l
+2
-2
src/iokernellang/codesparser.c
src/iokernellang/codesparser.c
+59
-59
src/iokernellang/codesparser.h
src/iokernellang/codesparser.h
+2
-2
src/iokernellang/codesparser.y.in
src/iokernellang/codesparser.y.in
+3
-3
src/logging/codeslogging.c
src/logging/codeslogging.c
+0
-492
src/logging/timeline.c
src/logging/timeline.c
+0
-97
src/modelconfig/configfile.c
src/modelconfig/configfile.c
+5
-5
src/modelconfig/configfile.h
src/modelconfig/configfile.h
+13
-15
src/modelconfig/configglue.c
src/modelconfig/configglue.c
+6
-6
src/modelconfig/configglue.h
src/modelconfig/configglue.h
+5
-5
src/modelconfig/configlex.l
src/modelconfig/configlex.l
+0
-1
src/modelconfig/configparser.y
src/modelconfig/configparser.y
+4
-5
src/modelconfig/configstoreadapter.c
src/modelconfig/configstoreadapter.c
+15
-6
src/modelconfig/configstoreadapter.h
src/modelconfig/configstoreadapter.h
+3
-3
src/modelconfig/configuration.c
src/modelconfig/configuration.c
+2
-0
src/modelconfig/txt_configfile.c
src/modelconfig/txt_configfile.c
+18
-19
src/modelconfig/txt_configfile.h
src/modelconfig/txt_configfile.h
+8
-8
src/util/codes-callbacks.c
src/util/codes-callbacks.c
+0
-75
src/util/codes-callbacks.h
src/util/codes-callbacks.h
+0
-39
src/util/local-storage-model.c
src/util/local-storage-model.c
+82
-50
src/util/resource-lp.c
src/util/resource-lp.c
+49
-4
src/util/tools.c
src/util/tools.c
+0
-38
src/workload/codes-workload-dump.c
src/workload/codes-workload-dump.c
+205
-51
src/workload/codes-workload.c
src/workload/codes-workload.c
+23
-5
src/workload/methods/codes-iolang-wrkld.c
src/workload/methods/codes-iolang-wrkld.c
+35
-33
tests/Makefile.subdir
tests/Makefile.subdir
+2
-1
tests/conf/buffer_test.conf
tests/conf/buffer_test.conf
+1
-1
tests/local-storage-model-test.c
tests/local-storage-model-test.c
+0
-10
tests/resource-test.sh
tests/resource-test.sh
+8
-0
tests/workload/README.txt
tests/workload/README.txt
+6
-9
tests/workload/codes-workload-mpi-replay.c
tests/workload/codes-workload-mpi-replay.c
+8
-11
tests/workload/codes-workload-test-cn-lp.c
tests/workload/codes-workload-test-cn-lp.c
+2
-2
tests/workload/codes-workload-test-cn-lp.h
tests/workload/codes-workload-test-cn-lp.h
+1
-1
tests/workload/codes-workload-test.c
tests/workload/codes-workload-test.c
+4
-9
tests/workload/codes-workload-test.conf
tests/workload/codes-workload-test.conf
+1
-2
uc-codes.cfg
uc-codes.cfg
+1548
-0
No files found.
codes/codes-workload.h
View file @
b5332aff
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include "ross.h"
#include "ross.h"
#define MAX_NAME_LENGTH_WKLD 512
#define MAX_NAME_LENGTH_WKLD 512
typedef
struct
bgp_params
bgp
_params
;
typedef
struct
iolang_params
iolang
_params
;
typedef
struct
darshan_params
darshan_params
;
typedef
struct
darshan_params
darshan_params
;
typedef
struct
recorder_params
recorder_params
;
typedef
struct
recorder_params
recorder_params
;
typedef
struct
codes_workload_info
codes_workload_info
;
typedef
struct
codes_workload_info
codes_workload_info
;
...
@@ -25,18 +25,15 @@ typedef struct scala_trace_params scala_trace_params;
...
@@ -25,18 +25,15 @@ typedef struct scala_trace_params scala_trace_params;
typedef
struct
dumpi_trace_params
dumpi_trace_params
;
typedef
struct
dumpi_trace_params
dumpi_trace_params
;
struct
bgp
_params
struct
iolang
_params
{
{
/* We have the number of ranks passed in from the bg/p model because
/* the rank count is defined in the workload config file */
* the I/O lang workloads have no information about the number of ranks.
* Only the bg/p config file knows the number of ranks. */
int
num_cns
;
int
num_cns
;
/* flag - use path to find kernel files relative to the metafile */
/* flag - use path to find kernel files relative to the metafile */
int
use_relpath
;
int
use_relpath
;
char
io_kernel_meta_path
[
MAX_NAME_LENGTH_WKLD
];
char
io_kernel_meta_path
[
MAX_NAME_LENGTH_WKLD
];
char
bgp_config_file
[
MAX_NAME_LENGTH_WKLD
];
/* set by config in the metadata path */
char
io_kernel_path
[
MAX_NAME_LENGTH_WKLD
];
char
io_kernel_path
[
MAX_NAME_LENGTH_WKLD
];
char
io_kernel_def_path
[
MAX_NAME_LENGTH_WKLD
];
};
};
struct
darshan_params
struct
darshan_params
...
@@ -67,8 +64,8 @@ struct scala_trace_params {
...
@@ -67,8 +64,8 @@ struct scala_trace_params {
};
};
struct
dumpi_trace_params
{
struct
dumpi_trace_params
{
int
num_net_traces
;
char
file_name
[
MAX_NAME_LENGTH_WKLD
];
char
file_name
[
MAX_NAME_LENGTH_WKLD
];
int
num_net_traces
;
};
};
...
@@ -127,6 +124,10 @@ enum codes_workload_op_type
...
@@ -127,6 +124,10 @@ enum codes_workload_op_type
CODES_WK_WAITANY
,
CODES_WK_WAITANY
,
/* Testall operation */
/* Testall operation */
CODES_WK_TESTALL
,
CODES_WK_TESTALL
,
/* for workloads that have events not yet handled
* (eg the workload language) */
CODES_WK_IGNORE
};
};
/* I/O operation paramaters */
/* I/O operation paramaters */
...
...
codes/codeslogging.h
deleted
100644 → 0
View file @
5509f22e
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
/*
* (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
/** \defgroup codeslogging codeslogging logging interface
*
* This is a basic application logging facility. It uses printf style
* formatting and provides several mechanisms for output.
*
* @{
*/
/* This code was derived from the PVFS2 codeslogging circa vs. 2.8.1 */
/** \file
*
* Declarations for the codeslogging logging interface.
*/
#ifndef SRC_COMMON_LOGGING_CODESLOGGING_H
#define SRC_COMMON_LOGGING_CODESLOGGING_H
#include <stdint.h>
#include <stdarg.h>
/********************************************************************
* Visible interface
*/
#define CODESLOGGING_BUF_SIZE 1024
/* what type of timestamp to place in msgs */
enum
codeslogging_logstamp
{
CODESLOGGING_LOGSTAMP_NONE
=
0
,
CODESLOGGING_LOGSTAMP_USEC
=
1
,
CODESLOGGING_LOGSTAMP_DATETIME
=
2
,
CODESLOGGING_LOGSTAMP_THREAD
=
3
};
#define CODESLOGGING_LOGSTAMP_DEFAULT CODESLOGGING_LOGSTAMP_USEC
/* stdio is needed by codeslogging_debug_fp declaration for FILE* */
#include <stdio.h>
int
codeslogging_enable_stderr
(
void
);
int
codeslogging_enable_file
(
const
char
*
filename
,
const
char
*
mode
);
int
codeslogging_disable
(
void
);
int
codeslogging_set_debug_mask
(
int
debug_on
,
uint64_t
mask
);
int
codeslogging_get_debug_mask
(
int
*
debug_on
,
uint64_t
*
mask
);
int
codeslogging_set_logstamp
(
enum
codeslogging_logstamp
ts
);
void
codeslogging_backtrace
(
void
);
#ifdef __GNUC__
/* do printf style type checking if built with gcc */
int
__codeslogging_debug
(
uint64_t
mask
,
char
prefix
,
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
3
,
4
)));
int
codeslogging_err
(
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
__codeslogging_debug_va
(
uint64_t
mask
,
char
prefix
,
const
char
*
format
,
va_list
ap
);
int
codeslogging_debug_fp
(
FILE
*
fp
,
char
prefix
,
enum
codeslogging_logstamp
ts
,
const
char
*
format
,
...)
__attribute__
((
format
(
printf
,
4
,
5
)));
#ifdef CODESLOGGING_DISABLE_DEBUG
#define codeslogging_debug(mask, format, f...) do {} while(0)
#define codeslogging_perf_log(format, f...) do {} while(0)
#define codeslogging_debug_enabled(__m) 0
#else
extern
int
codeslogging_debug_on
;
extern
int
codeslogging_facility
;
extern
uint64_t
codeslogging_debug_mask
;
#define codeslogging_debug_enabled(__m) \
(codeslogging_debug_on && (codeslogging_debug_mask & __m))
/* try to avoid function call overhead by checking masks in macro */
#define codeslogging_debug(mask, format, f...) \
do { \
if ((codeslogging_debug_on) && (codeslogging_debug_mask & mask) &&\
(codeslogging_facility)) \
{ \
__codeslogging_debug(mask, '?', format, ##f); \
} \
} while(0)
#define codeslogging_perf_log(format, f...) \
do { \
if ((codeslogging_debug_on) && \
(codeslogging_debug_mask & CODESLOGGING_PERFCOUNTER_DEBUG) && \
(codeslogging_facility)) \
{ \
__codeslogging_debug(CODESLOGGING_PERFCOUNTER_DEBUG, 'P', \
format, ##f); \
} \
} while(0)
#endif
/* CODESLOGGING_DISABLE_DEBUG */
/* do file and line number printouts w/ the GNU preprocessor */
#define codeslogging_ldebug(mask, format, f...) \
do { \
codeslogging_debug(mask, "%s: " format, __func__ , ##f); \
} while(0)
#define codeslogging_lerr(format, f...) \
do { \
codeslogging_err("%s line %d: " format, __FILE__ , __LINE__ , ##f); \
codeslogging_backtrace(); \
} while(0)
#else
/* ! __GNUC__ */
int
__codeslogging_debug
(
uint64_t
mask
,
char
prefix
,
const
char
*
format
,
...);
int
__codeslogging_debug_stub
(
uint64_t
mask
,
char
prefix
,
const
char
*
format
,
...);
int
codeslogging_err
(
const
char
*
format
,
...);
#ifdef CODESLOGGING_DISABLE_DEBUG
#define codeslogging_debug(__m, __f, f...) __codeslogging_debug_stub(__m, '?', __f, ##f);
#define codeslogging_ldebug(__m, __f, f...) __codeslogging_debug_stub(__m, '?', __f, ##f);
#define codeslogging_debug_enabled(__m) 0
#else
#define codeslogging_debug(__m, __f, f...) __codeslogging_debug(__m, '?', __f, ##f);
#define codeslogging_ldebug(__m, __f, f...) __codeslogging_debug(__m, '?', __f, ##f);
#define codeslogging_debug_enabled(__m) \
((codeslogging_debug_on != 0) && (__m & codeslogging_debug_mask))
#endif
/* CODESLOGGING_DISABLE_DEBUG */
#define codeslogging_lerr codeslogging_err
#endif
/* __GNUC__ */
#endif
/* __CODESLOGGING_H */
/* @} */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
codes/configuration.h
View file @
b5332aff
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
#ifndef __CONFIGURATION_H__
#ifndef __CONFIGURATION_H__
#define __CONFIGURATION_H__
#define __CONFIGURATION_H__
#include <stddef.h>
#include <inttypes.h>
#include <inttypes.h>
#include <mpi.h>
#include <mpi.h>
#include "codes/txt_configfile.h"
#define CONFIGURATION_MAX_NAME 256
#define CONFIGURATION_MAX_NAME 256
#define CONFIGURATION_MAX_GROUPS 10
#define CONFIGURATION_MAX_GROUPS 10
...
@@ -53,6 +53,8 @@ typedef struct config_lpgroups_s
...
@@ -53,6 +53,8 @@ typedef struct config_lpgroups_s
config_anno_map_t
lpannos
[
CONFIGURATION_MAX_TYPES
];
config_anno_map_t
lpannos
[
CONFIGURATION_MAX_TYPES
];
}
config_lpgroups_t
;
}
config_lpgroups_t
;
typedef
struct
ConfigVTable
*
ConfigHandle
;
/*
/*
* Load a configuration on the system (collectively)
* Load a configuration on the system (collectively)
*
*
...
...
codes/local-storage-model.h
View file @
b5332aff
...
@@ -43,7 +43,10 @@ typedef enum lsm_event_e
...
@@ -43,7 +43,10 @@ typedef enum lsm_event_e
*/
*/
/* given LP sender, find the LSM device LP in the same group */
/* given LP sender, find the LSM device LP in the same group */
tw_lpid
lsm_find_local_device
(
tw_lp
*
sender
);
tw_lpid
lsm_find_local_device
(
const
char
*
annotation
,
int
ignore_annotations
,
tw_lpid
sender_gid
);
/*
/*
* lsm_event_new
* lsm_event_new
...
@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
...
@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
size_t
message_bytes
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_lp
*
sender
,
tw_stime
delay
);
tw_stime
delay
);
/* equivalent to lsm_event_new, except it allows to specify an annotation to
* filter by. If ignore_annotations is nonzero, A null annotation parameter
* indicates that the lsm LP to issue to has no annotation */
tw_event
*
lsm_event_new_annotated
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
);
void
lsm_event_new_reverse
(
tw_lp
*
sender
);
void
lsm_event_new_reverse
(
tw_lp
*
sender
);
...
...
codes/timeline.h
deleted
100644 → 0
View file @
5509f22e
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
/*
* timeline.h
*
* Created on: Jun 24, 2013
* Author: wozniak
*/
#ifndef TIMELINE_H
#define TIMELINE_H
#define TIMELINE_ENABLED 0
#if TIMELINE_ENABLED == 1
#include <ross.h>
/**
Open filename for writing for timeline data
@return 1 on success, 0 on error
*/
int
timeline_init
(
const
char
*
filename
);
/**
Write a timeline record
@return 1 on success, 0 on error
*/
int
timeline_printf
(
const
char
*
format
,
...);
/**
Write a timeline record
@return 1 on success, 0 on error
*/
int
timeline_printf_va
(
const
char
*
format
,
va_list
ap
);
/**
Write a timeline record with typical ROSS metadata
@return 1 on success, 0 on error
*/
#define timeline_event(lp, format, args...) \
timeline_event_impl(lp, __func__, format, ##args)
int
timeline_event_impl
(
const
tw_lp
*
lp
,
const
char
*
func
,
const
char
*
format
,
...);
/**
Finalize the timeline module
*/
void
timeline_finalize
(
void
);
#else
// Set all functions to noops (return success value 1)
#define timeline_init(x) 1
#define timeline_printf(f, a...) 1
#define timeline_printf_va(f, a) 1
#define timeline_event(lp, f, a...) 1
#define timeline_finalize()
#endif
#endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
codes/tools.h
deleted
100644 → 0
View file @
5509f22e
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef SRC_COMMON_UTIL_TOOLS_H
#define SRC_COMMON_UTIL_TOOLS_H
#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
# define UNUSED(x)
/*@unused@*/
x
#else
# define UNUSED(x) x
#endif
/* UNUSED */
#define codesmin(a,b) ((a)<(b) ? (a):(b))
#define codesmax(a,b) ((a)>(b) ? (a):(b))
void
always_assert_error
(
const
char
*
expr
,
const
char
*
file
,
int
lineno
);
#define ALWAYS_ASSERT(a) if (!(a)) always_assert_error(#a,__FILE__, __LINE__);
#define ARRAY_SIZEOF(a) (sizeof(a)/sizeof(a[0]))
char
*
safe_strncpy
(
char
*
buf
,
const
char
*
source
,
unsigned
int
bufsize
);
#define CODES_FLAG_ISSET(mode_, flag_) ((mode_ & flag_) != 0)
#define CODES_FLAG_SET(mode_, flag_, branch_) \
do \
{ \
mode_ = mode_ | flag_; \
branch_ = 1; \
}while(0)
#define CODES_FLAG_SET_RC(mode_, flag_, branch_) \
do \
{ \
if(branch_) \
{ \
mode_ = mode_ & (~flag_); \
} \
}while(0)
#endif
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ts=8 sts=4 sw=4 expandtab
*/
configure.ac
View file @
b5332aff
...
@@ -123,7 +123,7 @@ if test "x${with_dumpi}" != "x" ; then
...
@@ -123,7 +123,7 @@ if test "x${with_dumpi}" != "x" ; then
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/common"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/common"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libdumpi"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libdumpi"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libundumpi"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libundumpi"
DUMPI_LIBS="-L${with_dumpi}/lib/ -l
dumpi -l
undumpi"
DUMPI_LIBS="-L${with_dumpi}/lib/ -lundumpi"
AC_SUBST(DUMPI_LIBS)
AC_SUBST(DUMPI_LIBS)
AC_SUBST(DUMPI_CFLAGS)
AC_SUBST(DUMPI_CFLAGS)
else
else
...
...
doc/BUILD_STEPS
View file @
b5332aff
...
@@ -67,3 +67,12 @@ Notes on using the clang static analyzer
...
@@ -67,3 +67,12 @@ Notes on using the clang static analyzer
- edit Makefile, and delete the "CC = mpicc" (or similar) line
- edit Makefile, and delete the "CC = mpicc" (or similar) line
- run "scan-build --use-cc=mpicc make"
- run "scan-build --use-cc=mpicc make"
Notes on using uncrustify
-----------------
- version 0.61 is required
- build/install uncrustify from your favorite distro (0.61), OR download from
https://github.com/bengardner/uncrustify and build from source
(configure --prefix /path/to/install && make && make install)
- either use uncrustify directly (see uncrustify --help) or use the provided
reformat.sh tool which is a shim over some of the options (see reformat.sh
-h)
doc/GETTING_STARTED
View file @
b5332aff
...
@@ -96,9 +96,7 @@ IO kernel language, and in-development ScalaTrace
...
@@ -96,9 +96,7 @@ IO kernel language, and in-development ScalaTrace
The
synthetic
IO
language
is
a
simple
,
interpreted
set
of
IO
and
basic
The
synthetic
IO
language
is
a
simple
,
interpreted
set
of
IO
and
basic
arithmetic
commands
meant
to
simplify
the
specification
and
running
of
arithmetic
commands
meant
to
simplify
the
specification
and
running
of
application
workloads
.
In
the
code
it
's currently called the "bgp" workload
application
workloads
.
generator but that is just a historical artifact - in the future it will be
refactored/renamed.
The
input
for
the
workload
generator
consists
of
an
IO
kernel
metadata
file
and
The
input
for
the
workload
generator
consists
of
an
IO
kernel
metadata
file
and
a
number
of
IO
kernel
files
.
The
former
specifies
a
set
of
kernel
files
to
run
a
number
of
IO
kernel
files
.
The
former
specifies
a
set
of
kernel
files
to
run
...
@@ -126,7 +124,7 @@ readat/writeat.
...
@@ -126,7 +124,7 @@ readat/writeat.
More
detailed
documentation
on
the
language
is
ongoing
,
but
for
now
a
general
More
detailed
documentation
on
the
language
is
ongoing
,
but
for
now
a
general
example
can
be
seen
at
doc
/
workload
,
which
shows
a
simple
out
-
of
-
core
data
example
can
be
seen
at
doc
/
workload
,
which
shows
a
simple
out
-
of
-
core
data
shuffle
.
Braver
souls
may
wish
to
visit
the
implementation
at
src
/
iokernellang
shuffle
.
Braver
souls
may
wish
to
visit
the
implementation
at
src
/
iokernellang
and src/workload/codes-
bgp-io
-wrkld.c.
and
src
/
workload
/
codes
-
iolang
-
wrkld
.
c
.
The
following
restrictions
currently
apply
to
the
IO
language
:
The
following
restrictions
currently
apply
to
the
IO
language
:
*
all
user
-
defined
variables
must
be
a
single
,
lower
-
case
letter
(
the
symbol
*
all
user
-
defined
variables
must
be
a
single
,
lower
-
case
letter
(
the
symbol
...
...
reformat.sh
0 → 100755
View file @
b5332aff
#!/bin/bash
script_dir
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
function
error
()
{
echo
"ERROR:
$@
"
>
&2
exit
1
}
function
usage
()
{
cat
\
<<
EOF
USAGE: reformat.sh [-x] [-i] [-c CFG] [-b FILE] {-a | FILE...}
-i: perform in-place (will ask to confirm if being done recursively)
-c CFG: use CFG as the uncrustify config (default:
$script_dir
/uc-codes.cfg)
-b FILE[,...]: add FILE to the blacklist of directories (in the form *FILE/*)
multiple files can be added by separating with commas
-a: perform recursively on all files ending in .c or .h
if -a not provided, then perform on all files passed in
-x: instead of formatting, check if output format is the same as input
-h: show this help and exit
EOF
}
function
build_blacklist
()
{
for
x
in
$@
;
do
echo
-n
"-and -not -path
\*
$x
/
\*
"
done
}
function
getfiles
()
{
find
.
\(
-name
\*
.c
-or
-name
\*
.h
\)
$(
build_blacklist
$@
)
}
cfg
=
$script_dir
/uc-codes.cfg
which uncrustify
>
/dev/null 2>&1
||
error
"uncrustify not found"
do_inplace
=
no
do_recursive
=
no
do_check
=
no
blacklist
=
while
getopts
":ib:axh"
opt
;
do
case
$opt
in
i
)
do_inplace
=
yes
;;
b
)
blacklist
=
$(
cat
$OPTARG
|
sed
s/,/ /g
)
;;
c
)
cfg
=
$OPTARG
;;
a
)
do_recursive
=
yes
;;
x
)
do_check
=
yes
;;
h
)
usage
exit
1
;;
\?
)
usage
error
"invalid argument: -
$OPTARG
"
;;
esac
done
shift
$((
OPTIND-1
))
[[
-e
$cfg
]]
||
(
usage
&&
error
"config file
$cfg
not found"
)
[[
$#
-gt
0
&&
$do_recursive
==
yes
]]
&&
\
usage
&&
error
"no file args expected in recursive mode"
[[
$#
-eq
0
&&
$do_recursive
==
no
]]
&&
\
usage
&&
error
"expected file args in non-recursive mode"
if
[[
$do_recursive
==
yes
]]
;
then
file_list
=
"
$(
getfiles
$blacklist
)
"
else
file_list
=
"
$@
"
fi
if
[[
$do_recursive
==
yes
&&
$do_inplace
==
yes
]]
;
then
echo
-n
"Do recursive in-place reformat? (y/n) "
read
answer
[[
$answer
=
~
"[^y].*"
]]
&&
echo
"...aborting reformat"
&&
exit
1
fi
[[
$do_inplace
==
yes
]]
\
&&
output_arg
=
"--replace"
\
||
output_arg
=
if
[[
$do_check
==
yes
]]
;
then
check_arg
=
--check
output_arg
=
echo
"checking format..."
else
check_arg
=
fi
function
echolines
()
{
for
x
in
$@
;
do
echo
$x
;
done
}
echolines
$file_list
| uncrustify
$check_arg
-c
$cfg
$output_arg
-F
-
src/Makefile.subdir
View file @
b5332aff
...
@@ -29,33 +29,22 @@ maintainer-clean-local::
...
@@ -29,33 +29,22 @@ maintainer-clean-local::
src/modelconfig/configparser.h
:
src/modelconfig/configparser.y
src/modelconfig/configparser.h
:
src/modelconfig/configparser.y
src/modelconfig/configlex.h
:
src/modelconfig/configlex.l
src/modelconfig/configlex.h
:
src/modelconfig/configlex.l
#BUILT_SOURCES +=
codes
/codesparser.h \
#BUILT_SOURCES +=
src/iokernellang
/codesparser.h \
# src/iokernellang/codesparser.c \
# src/iokernellang/codesparser.c \
# src/iokernellang/codeslexer.h \
# src/iokernellang/codeslexer.h \
#
codes
/codeslexer.h
#
src/iokernellang
/codeslexer.h
#src/iokernellang/codesparser.y: src/iokernellang/codesparser.y.in Makefile
#src/iokernellang/codesparser.y: src/iokernellang/codesparser.y.in Makefile
#src/iokernellang/codesparser.c
codes
/codesparser.h: src/iokernellang/codesparser.y
#src/iokernellang/codesparser.c
src/iokernellang
/codesparser.h: src/iokernellang/codesparser.y
#
codes
/codeslexer.h: $(top_srcdir)/src/iokernellang/codeslexer.h
#
src/iokernellang
/codeslexer.h: $(top_srcdir)/src/iokernellang/codeslexer.h
#mkdir -p codes
#mkdir -p codes
#cp $(top_srcdir)/src/iokernellang/codeslexer.h
codes
/codeslexer.h
#cp $(top_srcdir)/src/iokernellang/codeslexer.h
src/iokernellang
/codeslexer.h
nobase_include_HEADERS
=
\
nobase_include_HEADERS
=
\
codes/CodesKernelHelpers.h
\
codes/CodesIOKernelContext.h
\
codes/CodesIOKernelParser.h
\
codes/CodesIOKernelTypes.h
\
codes/codeslexer.h
\
codes/txt_configfile.h
\
codes/tools.h
\
codes/codeslogging.h
\
codes/timeline.h
\
codes/codesparser.h
\
codes/quickhash.h
\
codes/quickhash.h
\
codes/configfile.h
\
codes/quicklist.h
\
codes/quicklist.h
\
codes/codes_mapping.h
\
codes/codes_mapping.h
\
codes/lp-type-lookup.h
\
codes/lp-type-lookup.h
\
...
@@ -73,15 +62,15 @@ nobase_include_HEADERS = \
...
@@ -73,15 +62,15 @@ nobase_include_HEADERS = \
#codes/codes-nw-workload.h
#codes/codes-nw-workload.h
src_libcodes_base_a_SOURCES
=
\
src_libcodes_base_a_SOURCES
=
\
codes
/codesparser.h
\
src/iokernellang
/codesparser.h
\
src/iokernellang/codesparser.c
\
src/iokernellang/codesparser.c
\
codes
/codeslexer.h
\
src/iokernellang
/codeslexer.h
\
src/iokernellang/codeslexer.c
\
src/iokernellang/codeslexer.c
\
src/iokernellang/codesImpl.c
\
src/iokernellang/codesImpl.c
\
codes
/CodesIOKernelContext.h
\
src/iokernellang
/CodesIOKernelContext.h
\
codes
/CodesIOKernelParser.h
\
src/iokernellang
/CodesIOKernelParser.h
\
codes
/CodesIOKernelTypes.h
\
src/iokernellang
/CodesIOKernelTypes.h
\
codes
/CodesKernelHelpers.h
\
src/iokernellang
/CodesKernelHelpers.h
\
src/iokernellang/CodesKernelHelpers.c
\
src/iokernellang/CodesKernelHelpers.c
\
src/modelconfig/configlex.c
\
src/modelconfig/configlex.c
\
src/modelconfig/configlex.h
\
src/modelconfig/configlex.h
\
...
@@ -90,33 +79,25 @@ src_libcodes_base_a_SOURCES = \
...
@@ -90,33 +79,25 @@ src_libcodes_base_a_SOURCES = \
src/modelconfig/configfile.c
\
src/modelconfig/configfile.c
\
src/modelconfig/configglue.h
\
src/modelconfig/configglue.h
\
src/modelconfig/configglue.c
\
src/modelconfig/configglue.c
\
codes
/configfile.h
\
src/modelconfig
/configfile.h
\
src/modelconfig/configstore.h
\
src/modelconfig/configstore.h
\
src/modelconfig/configstore.c
\
src/modelconfig/configstore.c
\
src/modelconfig/configstoreadapter.h
\
src/modelconfig/configstoreadapter.h
\
src/modelconfig/configstoreadapter.c
\
src/modelconfig/configstoreadapter.c
\
codes
/txt_configfile.h
\
src/modelconfig
/txt_configfile.h
\
src/modelconfig/txt_configfile.c
\
src/modelconfig/txt_configfile.c
\
codes/tools.h
\
src/modelconfig/configuration.c
\
src/util/tools.c
\
src/util/codes-callbacks.h
\
src/util/codes-callbacks.c
\
src/util/codes_mapping.c
\
src/util/codes_mapping.c
\