INFO: No output directory specified (--dir) INFO: Using directory: "NCrystal_example_20250514_085439" INFO: Regenerating c-file: NCrystal_example.c WARNING: Full-path code-generator "/u/data/pkwi/McStas/mcstas/3.x-dev/bin/mcstas-antlr -I$MCSTAS" not found!! WARNING: Attempting replacement by "mcstas-antlr -I$MCSTAS" DEBUG: CMD: mcstas-antlr -I$MCSTAS -t -o ./NCrystal_example.c NCrystal_example.instr 2025-05-14 08:54:56.907 | WARNING | mccode_antlr.instr.instr:_replace_keywords:285 - Guessing that @NCRYSTALFLAGS@ should be -lncrystal No initialization present? ----------------------------------------------------------- Generating single GPU kernel or single CPU section layout: -> SPLIT 10 at component monochromator -> SPLIT 10 at component powder_sample ----------------------------------------------------------- Generating GPU/CPU -DFUNNEL layout: -> GPU kernel from component origin -> GPU kernel from component source -> GPU kernel from component mono_arm Component monochromator is NOACC, CPUONLY=True ->FUNNEL mode enabled, SPLIT within buffer. -> SPLIT within buffer at component monochromator Component powder_sample is NOACC, CPUONLY=True ->FUNNEL mode enabled, SPLIT within buffer. -> SPLIT within buffer at component powder_sample ----------------------------------------------------------- CFLAGS= -lncrystal -DFUNNEL DEBUG: CMD: mcstas-antlr -I$MCSTAS finished INFO: Recompiling: ./NCrystal_example.out --> launching cmd: ncrystal-config --show buildflags DEBUG: CMD: nvc -o ./NCrystal_example.out ./NCrystal_example.c -lm -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,--allow-shlib-undefined -Wl,-rpath,/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/lib -Wl,-rpath-link,/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/lib -L/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/lib -mtune=haswell -fPIC -O2 -isystem /u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/include -fast -Minfo=accel -acc=gpu -gpu=mem:managed -DOPENACC -Wl,-rpath,/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/lib -Wl,/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/lib/libNCrystal.so -I/u/data/pkwi/McStas/mcstas/3.x-dev/miniconda3/include -DFUNNEL "./NCrystal_example.c", line 93: warning: Routine "mcgenstate" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_particle mcgenstate(void); ^ Remark: individual warnings can be suppressed with "--diag_suppress " "./NCrystal_example.c", line 95: warning: Routine "mcsetstate" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_particle mcsetstate(double x, double y, double z, double vx, double vy, double vz, double t, double sx, double sy, double sz, double p, int mcgravitation, void * mcMagnet, int allow_backprop); ^ "./NCrystal_example.c", line 97: warning: Routine "mcgetstate" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_particle mcgetstate(_class_particle mcparticle, double * x, double * y, double * z, double * vx, double * vy, double * vz, double * t, double * sx, double * sy, double * sz, double * p); ^ "./NCrystal_example.c", line 111: warning: Routine "particle_getvar" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double particle_getvar(_class_particle *p, char *name, int *suc); ^ "./NCrystal_example.c", line 115: warning: Routine "str_comp" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] int str_comp(char *str1, char *str2); ^ "./NCrystal_example.c", line 143: warning: Routine "particle_getvar_void" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] void* particle_getvar_void(_class_particle *p, char *name, int *suc); ^ "./NCrystal_example.c", line 115: warning: Routine "str_comp" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] int str_comp(char *str1, char *str2); ^ "./NCrystal_example.c", line 175: warning: Routine "particle_setvar_void" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] int particle_setvar_void(_class_particle *, char *, void*); ^ "./NCrystal_example.c", line 200: warning: Routine "particle_setvar_void_array" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] int particle_setvar_void_array(_class_particle *, char *, void*, int); ^ "./NCrystal_example.c", line 213: warning: Routine "particle_restore" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] void particle_restore(_class_particle *p, _class_particle *p0); ^ "./NCrystal_example.c", line 230: warning: Routine "particle_getuservar_byid" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double particle_getuservar_byid(_class_particle *p, int id, int *suc){ ^ "./NCrystal_example.c", line 241: warning: Routine "particle_uservar_init" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] void particle_uservar_init(_class_particle *p){ ^ "./NCrystal_example.c", line 313: warning: Routine "noprintf" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] int noprintf(); ^ "./NCrystal_example.c", line 315: warning: Routine "str_len" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] size_t str_len(const char *s); ^ "./NCrystal_example.c", line 665: warning: Routine "mcget_ncount" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] unsigned long long int mcget_ncount(void); /* wrapper to set mcncount */ ^ "./NCrystal_example.c", line 886: warning: Routine "_randnorm2" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _randnorm2(randstate_t* state); ^ "./NCrystal_example.c", line 903: warning: Routine "kiss_srandom" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] uint64_t *kiss_srandom(uint64_t state[7], uint64_t seed); ^ "./NCrystal_example.c", line 905: warning: Routine "kiss_random" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] uint64_t kiss_random(uint64_t state[7]); ^ "./NCrystal_example.c", line 913: warning: Routine "_rand01" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _rand01(randstate_t* state); ^ "./NCrystal_example.c", line 915: warning: Routine "_randpm1" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _randpm1(randstate_t* state); ^ "./NCrystal_example.c", line 917: warning: Routine "_rand0max" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _rand0max(double max, randstate_t* state); ^ "./NCrystal_example.c", line 919: warning: Routine "_randminmax" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _randminmax(double min, double max, randstate_t* state); ^ "./NCrystal_example.c", line 921: warning: Routine "_randtriangle" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double _randtriangle(randstate_t* state); ^ "./NCrystal_example.c", line 1017: warning: Routine "coords_set" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_set(MCNUM x, MCNUM y, MCNUM z); ^ "./NCrystal_example.c", line 1019: warning: Routine "coords_get" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_get(Coords a, MCNUM *x, MCNUM *y, MCNUM *z); ^ "./NCrystal_example.c", line 1021: warning: Routine "coords_add" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_add(Coords a, Coords b); ^ "./NCrystal_example.c", line 1023: warning: Routine "coords_sub" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_sub(Coords a, Coords b); ^ "./NCrystal_example.c", line 1025: warning: Routine "coords_neg" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_neg(Coords a); ^ "./NCrystal_example.c", line 1027: warning: Routine "coords_scale" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_scale(Coords b, double scale); ^ "./NCrystal_example.c", line 1029: warning: Routine "coords_sp" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double coords_sp(Coords a, Coords b); ^ "./NCrystal_example.c", line 1031: warning: Routine "coords_xp" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] Coords coords_xp(Coords b, Coords c); ^ "./NCrystal_example.c", line 1033: warning: Routine "coords_len" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] double coords_len(Coords a); ^ "./NCrystal_example.c", line 4585: warning: variable "num" was declared but never referenced [declared_but_not_referenced] int num = 3; ^ "./NCrystal_example.c", line 5040: warning: variable "randstate" was declared but never referenced [declared_but_not_referenced] randstate_t randstate[7]; ^ "./NCrystal_example.c", line 4959: warning: variable "newlen" was declared but never referenced [declared_but_not_referenced] long newlen = 0; ^ "./NCrystal_example.c", line 6286: warning: variable "status" was set but never used [set_but_not_used] int status; ^ "./NCrystal_example.c", line 7016: warning: missing return statement at end of non-void function "ncrystalsample_surfintersect" [implicit_return_from_non_void_function] } ^ "./NCrystal_example.c", line 7255: warning: variable "tc2" was set but never used [set_but_not_used] Coords tc1, tc2; ^ "./NCrystal_example.c", line 7960: warning: Routine "class_Progress_bar_trace" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_Progress_bar *class_Progress_bar_trace(_class_Progress_bar *_comp, _class_particle *_particle) { ^ "./NCrystal_example.c", line 8050: warning: Routine "class_Source_div_trace" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_Source_div *class_Source_div_trace(_class_Source_div *_comp, _class_particle *_particle) { ^ "./NCrystal_example.c", line 8149: warning: Routine "class_NCrystal_sample_trace" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_NCrystal_sample *class_NCrystal_sample_trace(_class_NCrystal_sample *_comp, _class_particle *_particle) { ^ "./NCrystal_example.c", line 8311: warning: Routine "class_Cyl_monitor_trace" will be treated as sequential because its "routine" directive doesn't specify a level of parallelism [no_routine_type] _class_Cyl_monitor *class_Cyl_monitor_trace(_class_Cyl_monitor *_comp, _class_particle *_particle) { ^ "./NCrystal_example.c", line 8326: warning: variable "j" was declared but never referenced [declared_but_not_referenced] int i, j; ^ "./NCrystal_example.c", line 8773: warning: variable "_particle_save" was declared but never referenced [declared_but_not_referenced] _class_particle _particle_save; ^ "./NCrystal_example.c", line 9493: warning: variable "t" was declared but never referenced [declared_but_not_referenced] time_t t; ^ "./NCrystal_example.c", line 9494: warning: variable "ct" was set but never used [set_but_not_used] clock_t ct; ^ "./NCrystal_example.c", line 1522: warning: variable "mcstartdate" was set but never used [set_but_not_used] static long mcstartdate = 0; /* start simulation time */ ^ "./NCrystal_example.c", line 2942: warning: function "strcpy_valid" was declared but never referenced [declared_but_not_referenced] static char *strcpy_valid(char *valid, char *original) ^ mcgenstate: 104, Generating acc routine seq Generating NVIDIA GPU code particle_getvar: 118, Generating acc routine seq Generating NVIDIA GPU code particle_getvar_void: 150, Generating acc routine seq Generating NVIDIA GPU code particle_setvar_void: 177, Generating acc routine seq Generating NVIDIA GPU code particle_setvar_void_array: 202, Generating acc routine seq Generating NVIDIA GPU code particle_restore: 214, Generating acc routine seq Generating NVIDIA GPU code particle_getuservar_byid: 230, Generating acc routine seq Generating NVIDIA GPU code particle_uservar_init: 241, Generating acc routine seq Generating NVIDIA GPU code noprintf: 1570, Generating acc routine seq Generating NVIDIA GPU code str_comp: 1574, Generating acc routine seq Generating NVIDIA GPU code str_len: 1583, Generating acc routine seq Generating NVIDIA GPU code mcget_ncount: 4206, Generating acc routine seq Generating NVIDIA GPU code coords_set: 4637, Generating acc routine seq Generating NVIDIA GPU code coords_get: 4648, Generating acc routine seq Generating NVIDIA GPU code coords_add: 4657, Generating acc routine seq Generating NVIDIA GPU code coords_sub: 4669, Generating acc routine seq Generating NVIDIA GPU code coords_neg: 4681, Generating acc routine seq Generating NVIDIA GPU code coords_scale: 4691, Generating acc routine seq Generating NVIDIA GPU code coords_sp: 4701, Generating acc routine seq Generating NVIDIA GPU code coords_xp: 4709, Generating acc routine seq Generating NVIDIA GPU code coords_len: 4719, Generating acc routine seq Generating NVIDIA GPU code coords_print: 4741, Generating acc routine seq Generating NVIDIA GPU code coords_norm: 4748, Generating acc routine seq Generating NVIDIA GPU code rot_set_rotation: 4794, Generating acc routine seq Generating NVIDIA GPU code rot_test_identity: 4829, Generating acc routine seq Generating NVIDIA GPU code rot_mul: 4840, Generating acc routine seq Generating NVIDIA GPU code rot_copy: 4857, Generating acc routine seq Generating NVIDIA GPU code rot_transpose: 4868, Generating acc routine seq Generating NVIDIA GPU code rot_apply: 4884, Generating acc routine seq Generating NVIDIA GPU code vec_prod_func: 4913, Generating acc routine seq Generating NVIDIA GPU code scalar_prod: 4924, Generating acc routine seq Generating NVIDIA GPU code norm_func: 4928, Generating acc routine seq Generating NVIDIA GPU code sort_absorb_last: 4963, Generating present(particles[:buffer_len],pbuffer[:buffer_len]) Generating implicit firstprivate(tidx) Generating NVIDIA GPU code 4970, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 4979, #pragma acc loop seq 4963, Generating implicit copy(lens[:]) [if not already present] 4970, Generating implicit firstprivate(ll,l) 4981, Accelerator restriction: induction variable live-out from loop: i 4982, Accelerator restriction: induction variable live-out from loop: i 4983, Accelerator restriction: induction variable live-out from loop: i 4984, Accelerator restriction: induction variable live-out from loop: i 4986, Accelerator restriction: induction variable live-out from loop: j 4987, Accelerator restriction: induction variable live-out from loop: j 4988, Accelerator restriction: induction variable live-out from loop: j 4989, Accelerator restriction: induction variable live-out from loop: j 5011, Generating present(pbuffer[:buffer_len]) Generating implicit firstprivate(tidx) Generating NVIDIA GPU code 5015, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 5018, #pragma acc loop seq 5011, Generating implicit copyin(lens[:]) [if not already present] Generating implicit copy(particles[:]) [if not already present] Generating implicit copyin(los[:]) [if not already present] 5018, Generating implicit firstprivate(l) 5035, Generating present(particles[:buffer_len]) Generating implicit firstprivate(accumlen,tidx,mult) Generating NVIDIA GPU code 5039, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 5046, #pragma acc loop seq 5035, Local memory used for targetbuffer,sourcebuffer mccoordschange: 5105, Generating acc routine seq Generating NVIDIA GPU code mccoordschange_polarisation: 5136, Generating acc routine seq Generating NVIDIA GPU code normal_vec: 5153, Generating acc routine seq Generating NVIDIA GPU code solve_2nd_order: 5252, Generating acc routine seq Generating NVIDIA GPU code _randvec_target_circle: 5336, Generating acc routine seq Generating NVIDIA GPU code _randvec_target_rect_angular: 5402, Generating acc routine seq Generating NVIDIA GPU code _randvec_target_rect_real: 5479, Generating acc routine seq Generating NVIDIA GPU code kiss_srandom: 5751, Generating acc routine seq Generating NVIDIA GPU code kiss_random: 5763, Generating acc routine seq Generating NVIDIA GPU code _hash: 5795, Generating acc routine seq Generating NVIDIA GPU code _randnorm2: 5836, Generating acc routine seq Generating NVIDIA GPU code _randtriangle: 5847, Generating acc routine seq Generating NVIDIA GPU code _rand01: 5852, Generating acc routine seq Generating NVIDIA GPU code _randpm1: 5860, Generating acc routine seq Generating NVIDIA GPU code _rand0max: 5868, Generating acc routine seq Generating NVIDIA GPU code _randminmax: 5875, Generating acc routine seq Generating NVIDIA GPU code mcsetstate: 6553, Generating acc routine seq Generating NVIDIA GPU code mcgetstate: 6590, Generating acc routine seq Generating NVIDIA GPU code inside_rectangle: 6650, Generating acc routine seq Generating NVIDIA GPU code box_intersect: 6667, Generating acc routine seq Generating NVIDIA GPU code cylinder_intersect: 6782, Generating acc routine seq Generating NVIDIA GPU code sphere_intersect: 6837, Generating acc routine seq Generating NVIDIA GPU code ncrystalsample_surfintersect: 7007, Generating implicit acc routine seq Generating implicit acc routine seq Generating NVIDIA GPU code init: 7919, Generating update device(_monochromator_var,_source_var,_powder_sample_var,_instrument_var,_mono_out_var,_mono_arm_var,_powder_pattern_detc_var,_origin_var) class_Progress_bar_trace: 7960, Generating acc routine seq Generating NVIDIA GPU code class_Source_div_trace: 8050, Generating acc routine seq Generating NVIDIA GPU code class_NCrystal_sample_trace: 8149, Generating acc routine seq Generating NVIDIA GPU code 8253, Reference argument passing prevents parallelization: xsect_abs 8255, Reference argument passing prevents parallelization: xsect_scat class_Cyl_monitor_trace: 8311, Generating acc routine seq Generating NVIDIA GPU code raytrace_all_funnel: 8683, Generating present(particles[:livebatchsize]) Generating implicit firstprivate(livebatchsize) Generating NVIDIA GPU code 8687, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 8683, Local memory used for .inl_.inl_mcneutron_0_9195,.inl_particle_9180,.inl_.X1838_9197,.inl_.inl_.X2031_15_9196 8687, Generating implicit private(_particle,seed) 8697, Generating present(particles[:livebatchsize]) Generating implicit firstprivate(livebatchsize) Generating NVIDIA GPU code 8702, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 8697, Local memory used for .inl_.inl_c_1933_9244,.inl_.inl_.inl_b_1907_1939_9249,.inl_.inl_.inl_.X1996_1906_1938_9248,.inl_.inl_b_1929_9243,.inl_.inl_c_1922_9233,.inl_.inl_.inl_b_1907_1928_9238,.inl_.inl_.inl_.X1996_1906_1927_9237,.inl_.inl_b_1918_9232,.inl_.inl_.X1980_1917_9227,.inl_.inl_c_1914_9226,.inl_c_9259,.inl_.inl_b_1913_9224,.inl_.inl_.X1996_1912_9223,.inl_b_9216,.inl_.X1979_9215,.inl_.X1980_9210,.inl_c_9218,.inl_.X1978_9206,.inl_a_9202,_particle_save,.inl_c_9270,.inl_.inl_c_1922_9285,.inl_.inl_.inl_b_1907_1928_9290,.inl_.inl_.inl_.X1996_1906_1927_9289,.inl_.inl_b_1918_9284,.inl_.inl_c_1914_9278,.inl_.inl_.inl_.X1996_1906_1938_9300,.inl_.inl_.X1996_1912_9275,.inl_.inl_b_1913_9276,.inl_.X1980_9262,.inl_.inl_b_1929_9295,.inl_c_9207,.inl_.inl_.inl_b_1907_1939_9301,.inl_.inl_.X1980_1917_9279,.inl_a_9254,.inl_.X1978_9258,.inl_.X1979_9267,.inl_b_9268,.inl_.inl_c_1933_9296 8768, Generating present(particles[:livebatchsize]) Generating implicit firstprivate(livebatchsize) Generating NVIDIA GPU code 8771, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 8807, Generating present(particles[:livebatchsize]) Generating implicit firstprivate(livebatchsize) Generating NVIDIA GPU code 8810, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */ 8807, Local memory used for _particle_save,.inl_c_9420,.inl_.inl_c_1922_9435,.inl_.inl_.inl_b_1907_1928_9440,.inl_.inl_.inl_.X1996_1906_1927_9439,.inl_.inl_b_1918_9434,.inl_.inl_c_1914_9428,.inl_.inl_.inl_.X1996_1906_1938_9450,.inl_.inl_.X1996_1912_9425,.inl_.inl_b_1913_9426,.inl_.X1980_9412,.inl_.inl_b_1929_9445,.inl_c_9409,.inl_.inl_.inl_b_1907_1939_9451,.inl_.inl_.X1980_1917_9429,.inl_a_9404,.inl_.X1978_9408,.inl_.X1979_9417,.inl_b_9418,.inl_.inl_c_1933_9446 finally: 9076, Generating update self(_monochromator_var,_source_var,_powder_sample_var,_instrument_var,_mono_out_var,_mono_arm_var,_powder_pattern_detc_var,_origin_var) mcenabletrace: 5995, Generating update device(mcdotrace) DEBUG: CMD: nvc finished INFO: ===