Skip to content

Commit

Permalink
Minor cleanup in the command-line interfaces. The executables were no…
Browse files Browse the repository at this point in the history
…t showing the pplicable options
  • Loading branch information
manodeep committed Apr 18, 2017
1 parent 210cac7 commit f9e5d0e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 15 deletions.
26 changes: 16 additions & 10 deletions mocks/DDrppi_mocks/DDrppi_mocks.c
Expand Up @@ -125,7 +125,7 @@ int main(int argc, char *argv[])
sscanf(argv[6],"%"REAL_FORMAT,&pimax) ;
cosmology = atoi(argv[7]);

#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
nthreads=atoi(argv[8]);
assert(nthreads >= 1 && "Number of threads must be at least 1");
#endif
Expand Down Expand Up @@ -273,7 +273,7 @@ int main(int argc, char *argv[])
void Printhelp(void)
{
fprintf(stderr,"=========================================================================\n") ;
#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr," --- DDrppi file1 format1 file2 format2 binfile pimax cosmology numthreads [weight_method weights_file1 weights_format1 [weights_file2 weights_format2]] > DDfile\n") ;
#else
fprintf(stderr," --- DDrppi file1 format1 file2 format2 binfile pimax cosmology [weight_method weights_file1 weights_format1 [weights_file2 weights_format2]] > DDfile\n") ;
Expand All @@ -287,7 +287,7 @@ void Printhelp(void)
fprintf(stderr," * binfile = name of ascii file containing the r-bins (rmin rmax for each bin)\n") ;
fprintf(stderr," * pimax = maximum line-of-sight-separation\n") ;
fprintf(stderr," * cosmology = flag to pick-up the cosmology combination to use (set as an array of combinations in ../utils/cosmology_params.c)\n") ;
#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr," * numthreads = number of threads to use\n");
#endif
fprintf(stderr," --- OPTIONAL ARGS:\n");
Expand All @@ -307,19 +307,25 @@ void Printhelp(void)
fprintf(stderr,"Output RPAVG = False\n");
#endif

#ifdef DOUBLE_PREC
fprintf(stderr,"Precision = double\n");
#ifdef FAST_DIVIDE
fprintf(stderr,"Fast (approx) divide = True\n");
#else
fprintf(stderr,"Precision = float\n");
fprintf(stderr,"Fast (approx) divide = False\n");
#endif

#if defined(USE_AVX) && defined(__AVX__)
fprintf(stderr,"Use AVX = True\n");
#ifdef COMOVING_DIST
fprintf(stderr,"CZ column contains co-moving distance = True\n");
#else
fprintf(stderr,"Use AVX = False\n");
fprintf(stderr,"CZ column contains co-moving distance = False\n");
#endif

#ifdef DOUBLE_PREC
fprintf(stderr,"Precision = double\n");
#else
fprintf(stderr,"Precision = float\n");
#endif

#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr,"Use OMP = True\n");
#else
fprintf(stderr,"Use OMP = False\n");
Expand Down
36 changes: 32 additions & 4 deletions mocks/DDtheta_mocks/DDtheta_mocks.c
Expand Up @@ -259,7 +259,7 @@ int main(int argc, char **argv)
void Printhelp(void)
{
fprintf(stderr,"========================================================================================\n") ;
#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr," --- DDtheta file1 format1 file2 format2 binfile numthreads [weight_method weights_file1 weights_format1 [weights_file2 weights_format2]] > Thetafile\n") ;
#else
fprintf(stderr," --- DDtheta file1 format1 file2 format2 binfile [weight_method weights_file1 weights_format1 [weights_file2 weights_format2]] > Thetafile\n") ;
Expand All @@ -271,7 +271,7 @@ void Printhelp(void)
fprintf(stderr," * file2 = name of second data file\n") ;
fprintf(stderr," * format2 = format of second data file\n") ;
fprintf(stderr," * binfile = name of ascii file containing the theta-bins (thetamin thetamax for each bin)\n") ;
#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr," * numthreads = number of threads to use\n");
#endif
fprintf(stderr," --- OPTIONAL ARGS:\n");
Expand All @@ -294,19 +294,47 @@ void Printhelp(void)
fprintf(stderr,"Output THETAAVG = False\n");
#endif

/* #OPT += -DOUTPUT_THETAAVG */
/* OPT += -DLINK_IN_RA #link_in_dec must be enabled before link_in_ra */
/* #OPT += -DFAST_ACOS ## replaces acos by an 8th order REMEZ polynomial. Results are approximate (max. absolute error 3.6e-9) ~50% boost, but obviously approximate */

#ifdef LINK_IN_DEC
fprintf(stderr,"Linking in declination = True\n");
#else
fprintf(stderr,"Linking in declination = False\n");
#endif

#ifdef LINK_IN_DEC
//RA linking only works when dec linking is enabled
#ifdef LINK_IN_RA
fprintf(stderr,"Linking in right ascension = True\n");
#else
fprintf(stderr,"Linking in right ascension = False\n");
#endif//ra
#endif//dec

#ifdef OUTPUT_THETAAVG
//Only makes sense when <theta> is requested
#ifdef FAST_ACOS
fprintf(stderr,"Fast (approx) arc-cosine = True\n");
#else
fprintf(stderr,"Fast (approx) arc-cosine = False\n");
#endif//fast acos
#endif//thetaavg

#ifdef DOUBLE_PREC
fprintf(stderr,"Precision = double\n");
#else
fprintf(stderr,"Precision = float\n");
#endif

#if defined(USE_AVX) && defined(__AVX__)
#if defined(__AVX__)
fprintf(stderr,"Use AVX = True\n");
#else
fprintf(stderr,"Use AVX = False\n");
#endif

#if defined(USE_OMP) && defined(_OPENMP)
#if defined(_OPENMP)
fprintf(stderr,"Use OMP = True\n");
#else
fprintf(stderr,"Use OMP = False\n");
Expand Down
15 changes: 14 additions & 1 deletion mocks/vpf_mocks/vpf_mocks.c
Expand Up @@ -154,7 +154,7 @@ int main(int argc, char *argv[])

results_countspheres_mocks results;
struct config_options options = get_config_options();
options.float_type=sizeof(DOUBLE);

int status = countspheres_mocks(Ngal, ra, dec, cz,
Nran, xran, yran, zran,
threshold_neighbors,
Expand Down Expand Up @@ -208,5 +208,18 @@ void Printhelp(void)
fprintf(stderr," * random file format (a -> ascii, f-> fast-food)\n");
fprintf(stderr," * file with sphere centers (centers will be read-in if enough centers exist, otherwise centers will be output into this file)\n");
fprintf(stderr," > output: <R P0 P1 P2 ...>\n") ;

#ifdef COMOVING_DIST
fprintf(stderr,"CZ column contains co-moving distance = True\n");
#else
fprintf(stderr,"CZ column contains co-moving distance = False\n");
#endif

#ifdef DOUBLE_PREC
fprintf(stderr,"Precision = double\n");
#else
fprintf(stderr,"Precision = float\n");
#endif

fprintf(stderr,"=========================================================================\n") ;
}

0 comments on commit f9e5d0e

Please sign in to comment.