Skip to content

Commit

Permalink
Use lowest extinction for flux-limit calculation
Browse files Browse the repository at this point in the history
As extinction can change within the finite width of the beam, find and use
the smallest extinction within the voxel to test whether it's fainter than
the flux limit.
  • Loading branch information
mjuric committed May 19, 2010
1 parent 647aed9 commit 35b0098
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 115 deletions.
40 changes: 20 additions & 20 deletions galaxy.kdevelop
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
<secondaryLanguages/>
<versioncontrol/>
<projectname>galaxy</projectname>
<defaultencoding></defaultencoding>
<defaultencoding/>
</general>
<kdevautoproject>
<general>
<activetarget>src/galfast.x</activetarget>
<useconfiguration>optimized</useconfiguration>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>/home/mjuric/projects/galaxy/debug/src/galfast.x</mainprogram>
<terminal>true</terminal>
<directoryradio>custom</directoryradio>
<customdirectory>/home/mjuric/projects/galaxy/tests/os_photometry/</customdirectory>
<programargs></programargs>
<programargs>catalog cmd.conf</programargs>
<autocompile>true</autocompile>
<envvars>
<envvar value="5" name="all_log_level" />
Expand Down Expand Up @@ -60,7 +60,7 @@
<selector.x/>
</runarguments>
<globaldebugarguments>catalog cmd.conf</globaldebugarguments>
<globalcwd>/home/mjuric/projects/galaxy/workspace/milkyway-1.0/</globalcwd>
<globalcwd>/home/mjuric/projects/galaxy/workspace/milkyway-1.0.1</globalcwd>
<useglobalprogram>true</useglobalprogram>
<autoinstall>false</autoinstall>
<autokdesu>false</autokdesu>
Expand All @@ -81,14 +81,14 @@
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O2 -Wstrict-aliasing -fno-strict-aliasing</cxxflags>
<configargs>--with-cuda --enable-cuda-devemuX --with-sm=/usr/local --with-libpeyton=$HOME/projects/libpeyton --prefix=$HOME/projects/galaxy/workspace/staging --with-cfitsio-include=/usr/include/cfitsio --with-libpeyton-libdir=$HOME/projects/libpeyton/lib-optimized</configargs>
<topsourcedir></topsourcedir>
<topsourcedir/>
<cppflags>-DDEBUGMODE=0</cppflags>
<ldflags>-rdynamic -L/opt/cudatools/2.3/lib</ldflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<cflags></cflags>
<f77flags></f77flags>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags/>
<f77flags/>
<envvars/>
</optimized>
<debug>
Expand All @@ -98,12 +98,12 @@
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cxxflags>-O0 -g3 -Wno-deprecated</cxxflags>
<topsourcedir></topsourcedir>
<topsourcedir/>
<cppflags>-DDEBUGMODE=1</cppflags>
<ldflags>-rdynamic -L/opt/cudatools/2.3/lib</ldflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags>-O0 -g3 -Wno-deprecated</cflags>
<f77flags>-O0 -g3 -Wno-deprecated</f77flags>
<envvars/>
Expand Down Expand Up @@ -134,7 +134,7 @@
<abortonerror>false</abortonerror>
<numberofjobs>8</numberofjobs>
<dontact>false</dontact>
<makebin></makebin>
<makebin/>
<prio>0</prio>
<runmultiplejobs>true</runmultiplejobs>
</make>
Expand Down Expand Up @@ -206,7 +206,7 @@
</codecompletion>
<references/>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
Expand All @@ -232,11 +232,11 @@
<kdevdebugger>
<general>
<programargs>postprocess postprocess.conf skygen.conf</programargs>
<gdbpath></gdbpath>
<gdbpath/>
<dbgshell>libtool --mode=execute</dbgshell>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SUBDIRS = common gpc modules skygen
# explicit dependency for CUDA sources
include ./$(DEPDIR)/kernels_gpu.Po

noinst_HEADERS = simulate_gpu.cu.h sph_polygon.h pipeline.h
noinst_HEADERS = pipeline.h simulate_gpu.cu.h sph_polygon.h
galfast_x_SOURCES = footprint.cpp galfast.cpp kernels_cpu.cpp kernels_gpu.cu \
pipeline.cpp tests.cpp
galfast_x_LDADD = $(top_builddir)/src/skygen/libskygen.la \
Expand Down
3 changes: 3 additions & 0 deletions src/galfast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "gpu.h"
#include "io.h"
#include "gpulog/gpulog.h"
void init_logs(); // defined in os_skygen()

#include <astro/math.h>
#include <astro/system/options.h>
Expand Down Expand Up @@ -160,6 +162,7 @@ try
MLOG(verb1) << "Error initializing GPU acceleration. Aborting.";
return -1;
}
init_logs();

if(cmd == "util cudaquery")
{
Expand Down
5 changes: 4 additions & 1 deletion src/modules/FeH_gpu.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ KERNEL(
os_FeH_kernel(
otable_ks ks, os_FeH_data par, gpu_rng_t rng,
cint_t::gpu_t comp,
cint_t::gpu_t hidden,
cfloat_t::gpu_t XYZ,
cfloat_t::gpu_t FeH),
os_FeH_kernel,
(ks, par, rng, comp, XYZ, FeH)
(ks, par, rng, comp, hidden, XYZ, FeH)
)
{
uint32_t tid = threadID();
rng.load(tid);
for(uint32_t row = ks.row_begin(); row < ks.row_end(); row++)
{
if(hidden(row)) { continue; }

int cmp = comp(row);
if(par.comp_thin.isset(cmp) || par.comp_thick.isset(cmp))
{
Expand Down
5 changes: 3 additions & 2 deletions src/modules/FeH_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class os_FeH : public osink, os_FeH_data
};
extern "C" opipeline_stage *create_module_feh() { return new os_FeH(); } // Factory; called by opipeline_stage::create()

DECLARE_KERNEL(os_FeH_kernel(otable_ks ks, os_FeH_data par, gpu_rng_t rng, cint_t::gpu_t comp, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t FeH))
DECLARE_KERNEL(os_FeH_kernel(otable_ks ks, os_FeH_data par, gpu_rng_t rng, cint_t::gpu_t comp, cint_t::gpu_t hidden, cfloat_t::gpu_t XYZ, cfloat_t::gpu_t FeH))
size_t os_FeH::process(otable &in, size_t begin, size_t end, rng_t &rng)
{
// ASSUMPTIONS:
Expand All @@ -66,13 +66,14 @@ size_t os_FeH::process(otable &in, size_t begin, size_t end, rng_t &rng)

// fetch prerequisites
cint_t &comp = in.col<int>("comp");
cint_t &hidden= in.col<int>("hidden");
cfloat_t &XYZ = in.col<float>("XYZ");
cfloat_t &FeH = in.col<float>("FeH");

comp_thin = icomp_thin;
comp_thick = icomp_thick;
comp_halo = icomp_halo;
CALL_KERNEL(os_FeH_kernel, otable_ks(begin, end), *this, rng, comp, XYZ, FeH);
CALL_KERNEL(os_FeH_kernel, otable_ks(begin, end), *this, rng, comp, hidden, XYZ, FeH);
return nextlink->process(in, begin, end, rng);
}

Expand Down
3 changes: 3 additions & 0 deletions src/modules/module_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
return ret;
};

__device__ __host__ double lon() const { return atan2(sl, cl); }
__device__ __host__ double lat() const { return atan2(sb, cb); }

direction() {}
direction(double l_, double b_) // l,b are in radians
: cl(cos(l_)), cb(cos(b_)), sl(sin(l_)), sb(sin(b_))
Expand Down
1 change: 1 addition & 0 deletions src/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,7 @@ void generate_catalog(int seed, size_t maxstars, size_t nstars, const std::set<C
size_t Kbatch = 5000000;
EnvVar kb("KBATCH");
if(kb) { Kbatch = (int)atof(kb.c_str()); } // atof instead of atoi to allow shorthands such as 1e5
if(kb) { MLOG(verb1) << "Batch size: " << Kbatch << " objects"; }
DLOG(verb1) << "Processing in batches of " << Kbatch << " objects";
otable t(Kbatch);

Expand Down
1 change: 1 addition & 0 deletions src/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class opipeline_stage
enum
{
ord_input,
ord_clipper,
ord_feh,
ord_multiples,
ord_kinematics,
Expand Down
Loading

0 comments on commit 35b0098

Please sign in to comment.